scalar-by-value-x.h: New.

* gcc.dg/compat/scalar-by-value-x.h: New.
	* gcc.dg/compat/scalar-by-value-y.h: New.
	* gcc.dg/compat/scalar-by-value-5.c: New.
	* gcc.dg/compat/scalar-by-value-5_main.c: New.
	* gcc.dg/compat/scalar-by-value-5_x.c: New.
	* gcc.dg/compat/scalar-by-value-5_y.c: New.
	* gcc.dg/compat/scalar-by-value-6.c: New.
	* gcc.dg/compat/scalar-by-value-6_main.c: New.
	* gcc.dg/compat/scalar-by-value-6_x.c: New.
	* gcc.dg/compat/scalar-by-value-6_y.c: New.

From-SVN: r114058
This commit is contained in:
Alan Modra 2006-05-25 08:49:36 +09:30
parent d7f5de76fd
commit fccd5f9517
11 changed files with 446 additions and 3 deletions

View File

@ -1,3 +1,16 @@
2006-05-25 Alan Modra <amodra@bigpond.net.au>
* gcc.dg/compat/scalar-by-value-x.h: New.
* gcc.dg/compat/scalar-by-value-y.h: New.
* gcc.dg/compat/scalar-by-value-5.c: New.
* gcc.dg/compat/scalar-by-value-5_main.c: New.
* gcc.dg/compat/scalar-by-value-5_x.c: New.
* gcc.dg/compat/scalar-by-value-5_y.c: New.
* gcc.dg/compat/scalar-by-value-6.c: New.
* gcc.dg/compat/scalar-by-value-6_main.c: New.
* gcc.dg/compat/scalar-by-value-6_x.c: New.
* gcc.dg/compat/scalar-by-value-6_y.c: New.
2006-05-24 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/27639
@ -120,7 +133,7 @@
2006-05-20 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/25776
* g++.dg/other/error11.C: New test.
* g++.dg/other/error11.C: New test.
2006-05-20 Richard Sandiford <richard@codesourcery.com>
@ -2266,8 +2279,8 @@
PR c++/26140
Revert
2006-01-30 Richard Guenther <rguenther@suse.de>
PR c++/23372
* gcc.dg/pr23372-1.C: New testcase.
PR c++/23372
* gcc.dg/pr23372-1.C: New testcase.
* g++.dg/tree-ssa/pr26140.C: New testcase.

View File

@ -0,0 +1,16 @@
TEST_FUNCS (longlong_i, long long, int,
1234LL, -987)
TEST_FUNCS (longlong_d, long long, double,
1234LL, -987.0)
TEST_FUNCS (complexint_i, _Complex int, int,
1234 + 567i, -987)
TEST_FUNCS (complexint_d, _Complex int, double,
1234 + 567i, -987.0)
TEST_FUNCS (complexdouble_i, _Complex double, int,
1234.0 + 567.0i, -987)
TEST_FUNCS (complexdouble_d, _Complex double, double,
1234.0 + 567.0i, -987.0)
TEST_FUNCS (complexlonglong_i, _Complex long long, int,
1234LL + 567LLi, -987)
TEST_FUNCS (complexlonglong_d, _Complex long long, double,
1234LL + 567LLi, -987.0)

View File

@ -0,0 +1,30 @@
/* Test that function args can be passed in various positions to both fixed
and variable arg functions. */
/* { dg-options "-O" } */
extern void exit (int);
extern void longlong_i_doit (void);
extern void longlong_d_doit (void);
extern void complexint_i_doit (void);
extern void complexint_d_doit (void);
extern void complexdouble_i_doit (void);
extern void complexdouble_d_doit (void);
extern void complexlonglong_i_doit (void);
extern void complexlonglong_d_doit (void);
int main (void)
{
longlong_i_doit ();
longlong_d_doit ();
#ifndef SKIP_COMPLEX_INT
complexint_i_doit ();
complexint_d_doit ();
#endif
complexdouble_i_doit ();
complexdouble_d_doit ();
#ifndef SKIP_COMPLEX_INT
complexlonglong_i_doit ();
complexlonglong_d_doit ();
#endif
exit (0);
}

View File

@ -0,0 +1,2 @@
#include "scalar-by-value-x.h"
#include "scalar-by-value-5.c"

View File

@ -0,0 +1,2 @@
#include "scalar-by-value-y.h"
#include "scalar-by-value-5.c"

View File

@ -0,0 +1,4 @@
TEST_FUNCS (longdouble_i, long double, int, d, -987)
TEST_FUNCS (longdouble_d, long double, double, d, -987.0)
TEST_FUNCS (complexlongdouble_i, _Complex long double, int, cd, -987)
TEST_FUNCS (complexlongdouble_d, _Complex long double, double, cd, -987.0)

View File

@ -0,0 +1,19 @@
/* Test that function args can be passed in various positions to both fixed
and variable arg functions. */
/* { dg-options "-O" } */
/* { dg-options "-O -mlong-double-128" { target powerpc*-*-* } } */
extern void exit (int);
extern void longdouble_i_doit (void);
extern void longdouble_d_doit (void);
extern void complexlongdouble_i_doit (void);
extern void complexlongdouble_d_doit (void);
int main (void)
{
longdouble_i_doit ();
longdouble_d_doit ();
complexlongdouble_i_doit ();
complexlongdouble_d_doit ();
exit (0);
}

View File

@ -0,0 +1,6 @@
#include "scalar-by-value-x.h"
extern long double d;
extern _Complex long double cd;
#include "scalar-by-value-6.c"

View File

@ -0,0 +1,6 @@
#include "scalar-by-value-y.h"
long double d = 1234.0L + 0x0.abcdp-70L;
_Complex long double cd = 234.0L + 0x0.abcp-70L + 567.0Li +0x0defp-70Li;
#include "scalar-by-value-6.c"

View File

@ -0,0 +1,77 @@
#if DEBUG
#include <stdio.h>
#define DBG(x) fputs (x, stdout); fflush (stdout);
#else
#define DBG(x)
#endif
#define TEST_FUNCS(NAME, TYPE, PADT, VAL, VAL2) \
extern void NAME##_f0 (TYPE a, PADT b); \
extern void NAME##_f1 (PADT z0, TYPE a, PADT b); \
extern void NAME##_f2 (PADT z0, PADT z1, TYPE a, PADT b); \
extern void NAME##_f3 (PADT z0, PADT z1, PADT z2, TYPE a, PADT b); \
extern void NAME##_f4 (PADT z0, PADT z1, PADT z2, PADT z3, TYPE a, \
PADT b); \
extern void NAME##_f5 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
TYPE a, PADT b); \
extern void NAME##_f6 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
PADT z5, TYPE a, PADT b); \
extern void NAME##_f7 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
PADT z5, PADT z6, TYPE a, PADT b); \
extern void NAME##_f8 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
PADT z5, PADT z6, PADT z7, TYPE a, PADT b); \
extern void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
PADT z5, PADT z6, PADT z7, PADT z8, TYPE a, \
PADT b); \
extern void NAME##_fv (int n, ...); \
\
void NAME##_doit (void) \
{ \
NAME##_f0 (VAL, VAL2); \
DBG ("."); \
NAME##_f1 ((PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_f2 ((PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_f3 ((PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_f4 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_f5 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
VAL, VAL2); \
DBG ("."); \
NAME##_f6 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
(PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_f7 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
(PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_f8 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
(PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_f9 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
(PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (1, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (2, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (3, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (4, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (5, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
VAL, VAL2); \
DBG ("."); \
NAME##_fv (6, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
(PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (7, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
(PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("."); \
NAME##_fv (8, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
(PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
DBG ("\n"); \
}

View File

@ -0,0 +1,268 @@
extern void abort (void);
#if USE_MEMCMP
/* For comparing vectors. */
#define TEST_FUNCS(NAME, TYPE, PADT, VAL, VAL2) \
void NAME##_f0 (TYPE a, PADT b) \
{ \
if (memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f1 (PADT z0, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f2 (PADT z0, PADT z1, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f3 (PADT z0, PADT z1, PADT z2, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f4 (PADT z0, PADT z1, PADT z2, PADT z3, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f5 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, TYPE a, \
PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f6 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f7 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
PADT z6, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| z6 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f8 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
PADT z6, PADT z7, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| z6 != (PADT) 0 \
|| z7 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
PADT z6, PADT z7, PADT z8, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| z6 != (PADT) 0 \
|| z7 != (PADT) 0 \
|| z8 != (PADT) 0 \
|| memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
abort (); \
} \
\
void NAME##_fv (int n, ...) \
{ \
__builtin_va_list ap; \
TYPE x; \
__builtin_va_start (ap, n); \
\
while (n-- != 0) \
if (__builtin_va_arg (ap, PADT) != (PADT) 0) \
abort (); \
\
x = __builtin_va_arg (ap, TYPE); \
if (memcmp (&x, &VAL, sizeof (x)) != 0 ) \
abort (); \
\
if (__builtin_va_arg (ap, PADT) != VAL2) \
abort (); \
\
__builtin_va_end (ap); \
}
#else
#define TEST_FUNCS(NAME, TYPE, PADT, VAL, VAL2) \
void NAME##_f0 (TYPE a, PADT b) \
{ \
if (a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f1 (PADT z0, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f2 (PADT z0, PADT z1, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f3 (PADT z0, PADT z1, PADT z2, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f4 (PADT z0, PADT z1, PADT z2, PADT z3, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f5 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, TYPE a, \
PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f6 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f7 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
PADT z6, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| z6 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f8 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
PADT z6, PADT z7, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| z6 != (PADT) 0 \
|| z7 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
PADT z6, PADT z7, PADT z8, TYPE a, PADT b) \
{ \
if (z0 != (PADT) 0 \
|| z1 != (PADT) 0 \
|| z2 != (PADT) 0 \
|| z3 != (PADT) 0 \
|| z4 != (PADT) 0 \
|| z5 != (PADT) 0 \
|| z6 != (PADT) 0 \
|| z7 != (PADT) 0 \
|| z8 != (PADT) 0 \
|| a != VAL || b != VAL2) \
abort (); \
} \
\
void NAME##_fv (int n, ...) \
{ \
__builtin_va_list ap; \
\
__builtin_va_start (ap, n); \
\
while (n-- != 0) \
if (__builtin_va_arg (ap, PADT) != (PADT) 0) \
abort (); \
\
if (__builtin_va_arg (ap, TYPE) != VAL) \
abort (); \
\
if (__builtin_va_arg (ap, PADT) != VAL2) \
abort (); \
\
__builtin_va_end (ap); \
}
#endif