diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
103 files changed, 1807 insertions, 482 deletions
diff --git a/gcc/testsuite/gcc.dg/Walloca-1.c b/gcc/testsuite/gcc.dg/Walloca-1.c index ad39373fb9f..85e9160e845 100644 --- a/gcc/testsuite/gcc.dg/Walloca-1.c +++ b/gcc/testsuite/gcc.dg/Walloca-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target alloca } */ -/* { dg-options "-Walloca-larger-than=2000 -O2" } */ +/* { dg-options "-Walloca-larger-than=2000 -O2 -ftrack-macro-expansion=0" } */ #define alloca __builtin_alloca diff --git a/gcc/testsuite/gcc.dg/Wunknownprag.c b/gcc/testsuite/gcc.dg/Wunknownprag.c index c5ba58f767d..3514825a97e 100644 --- a/gcc/testsuite/gcc.dg/Wunknownprag.c +++ b/gcc/testsuite/gcc.dg/Wunknownprag.c @@ -5,7 +5,7 @@ /* We used to get "unspellable token: CPP_EOF" warnings. */ -#pragma /* { dg-warning "ignoring #pragma" } */ -#pragma ~ /* { dg-warning "ignoring #pragma" } */ -#pragma baz /* { dg-warning "ignoring #pragma" } */ -#pragma baz baz /* { dg-warning "ignoring #pragma" } */ +#pragma /* { dg-warning "-:ignoring #pragma" } */ +#pragma ~ /* { dg-warning "-:ignoring #pragma" } */ +#pragma baz /* { dg-warning "-:ignoring #pragma" } */ +#pragma baz baz /* { dg-warning "-:ignoring #pragma" } */ diff --git a/gcc/testsuite/gcc.dg/builtin-redefine.c b/gcc/testsuite/gcc.dg/builtin-redefine.c index 8090015f693..882b2210992 100644 --- a/gcc/testsuite/gcc.dg/builtin-redefine.c +++ b/gcc/testsuite/gcc.dg/builtin-redefine.c @@ -27,8 +27,8 @@ #define __TIME__ "X" /* Define while undefined. */ #define __TIME__ "X" /* Re-define while defined. */ /* { dg-line time_prev } */ -#define __TIME__ "Y" /* { dg-warning "\"__TIME__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } time_prev } */ +#define __TIME__ "Y" /* { dg-warning "-:\"__TIME__\" redefined" } */ +/* { dg-message "-:previous definition" "" { target *-*-* } time_prev } */ #undef __TIME__ /* Undefine while defined. */ @@ -38,8 +38,8 @@ #define __DATE__ "X" /* Define while undefined. */ #define __DATE__ "X" /* Re-define while defined. */ /* { dg-line date_prev } */ -#define __DATE__ "Y" /* { dg-warning "\"__DATE__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } date_prev } */ +#define __DATE__ "Y" /* { dg-warning "-:\"__DATE__\" redefined" } */ +/* { dg-message "-:previous definition" "" { target *-*-* } date_prev } */ #undef __DATE__ /* Undefine while defined. */ @@ -47,8 +47,8 @@ #define __TIMESTAMP__ "X" /* Define while already defined. */ #define __TIMESTAMP__ "X" /* Re-define while defined. */ /* { dg-line timestamp_prev } */ -#define __TIMESTAMP__ "Y" /* { dg-warning "\"__TIMESTAMP__\" redefined" } */ -/* { dg-message "previous definition" "" { target *-*-* } timestamp_prev } */ +#define __TIMESTAMP__ "Y" /* { dg-warning "-:\"__TIMESTAMP__\" redefined" } */ +/* { dg-message "-:previous definition" "" { target *-*-* } timestamp_prev } */ #undef __TIMESTAMP__ /* Undefine while defined. */ @@ -71,9 +71,9 @@ /* { dg-bogus "Expected built-in is not defined" "" { target *-*-* } .-1 } */ #endif -#define __LINE__ 0 /* { dg-warning "\"__LINE__\" redef" } */ -#define __INCLUDE_LEVEL__ 0 /* { dg-warning "\"__INCLUDE_LEVEL__\" redef" } */ -#define __COUNTER__ 0 /* { dg-warning "\"__COUNTER__\" redef" } */ +#define __LINE__ 0 /* { dg-warning "-:\"__LINE__\" redef" } */ +#define __INCLUDE_LEVEL__ 0 /* { dg-warning "-:\"__INCLUDE_LEVEL__\" redef" } */ +#define __COUNTER__ 0 /* { dg-warning "-:\"__COUNTER__\" redef" } */ int unused; /* Silence `ISO C forbids an empty translation unit' warning. */ diff --git a/gcc/testsuite/gcc.dg/builtin-stpncpy.c b/gcc/testsuite/gcc.dg/builtin-stpncpy.c index e4290d5635c..920079892dd 100644 --- a/gcc/testsuite/gcc.dg/builtin-stpncpy.c +++ b/gcc/testsuite/gcc.dg/builtin-stpncpy.c @@ -1,6 +1,6 @@ /* PR tree-optimization/80669 - Bad -Wstringop-overflow warnings for stpncpy { dg-do compile } - { dg-options "-O2 -Wall" } */ + { dg-options "-O2 -Wall -Wno-stringop-truncation" } */ #define SIZE_MAX __SIZE_MAX__ @@ -18,7 +18,9 @@ size_t range (size_t min, size_t max) return val < min || max < val ? min : val; } -/* Verify that no warning is issued for stpncpy with constant size. */ +/* Verify that no -Wstringop-overflow warning is issued for stpncpy + with constant size. (Some tests cause -Wstringop-truncation and + that's expected). */ void test_cst (char *d) { __builtin_stpncpy (d, "123", 0); @@ -37,7 +39,8 @@ void test_cst (char *d) } -/* Verify that no warning is issued for stpncpy with size in some range. */ +/* Verify that no -Wstringop-overflow warning is issued for stpncpy + with size in some range. */ void test_rng (char *d) { #define R(min, max) range (min, max) diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-1.c b/gcc/testsuite/gcc.dg/builtin-tgmath-1.c new file mode 100644 index 00000000000..ff87ace42fd --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-tgmath-1.c @@ -0,0 +1,322 @@ +/* Test __builtin_tgmath: valid uses, standard floating-point types. */ +/* { dg-do run } */ +/* { dg-options "" } */ + +extern void abort (void); +extern void exit (int); + +#define CHECK_CALL(C, E, V) \ + do \ + { \ + if ((C) != (E)) \ + abort (); \ + extern __typeof (C) V; \ + } \ + while (0) + +extern float var_f; +extern double var_d; +extern long double var_ld; +extern _Complex float var_cf; +extern _Complex double var_cd; +extern _Complex long double var_cld; +extern int var_i; + +typedef float float_type; +typedef double double_type; + +/* Test simple case, real arguments and return type. */ + +float_type t1f (float x) { return x + 1; } +double t1d (double_type x) { return x + 2; } +long double t1l (volatile long double x) { return x + 3; } + +#define t1v(x) __builtin_tgmath (t1f, t1d, t1l, x) +#define t1vr(x) __builtin_tgmath (t1l, t1d, t1f, x) + +static void +test_1 (void) +{ + float_type f = 1; + volatile float vf = 2; + double d = 3; + long double ld = 4; + int i = 5; + long long ll = 6; + CHECK_CALL (t1v (f), 2, var_f); + CHECK_CALL (t1v (vf), 3, var_f); + CHECK_CALL (t1v (d), 5, var_d); + CHECK_CALL (t1v (ld), 7, var_ld); + CHECK_CALL (t1v (i), 7, var_d); + CHECK_CALL (t1v (ll), 8, var_d); + CHECK_CALL (t1vr (f), 2, var_f); + CHECK_CALL (t1vr (vf), 3, var_f); + CHECK_CALL (t1vr (d), 5, var_d); + CHECK_CALL (t1vr (ld), 7, var_ld); + CHECK_CALL (t1vr (i), 7, var_d); + CHECK_CALL (t1vr (ll), 8, var_d); +} + +/* Test first argument not type-generic. */ + +float t2f (int a, float x) { return a * x + 1; } +double t2d (int a, double x) { return a * x + 2; } +long double t2l (int a, long double x) { return a * x + 3; } + +#define t2v(a, x) __builtin_tgmath (t2f, t2d, t2l, a, x) + +static void +test_2 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + int i = 4; + unsigned long long ll = 5; + CHECK_CALL (t2v (1, f), 2, var_f); + CHECK_CALL (t2v (2, d), 6, var_d); + CHECK_CALL (t2v (3, ld), 12, var_ld); + CHECK_CALL (t2v (4, i), 18, var_d); + CHECK_CALL (t2v (5, ll), 27, var_d); +} + +/* Test return type not type-generic. */ + +int t3f (float x) { return x + 1; } +int t3d (double x) { return x + 2; } +int t3l (long double x) { return x + 3; } + +#define t3v(x) __builtin_tgmath (t3f, t3d, t3l, x) + +static void +test_3 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + short s = 4; + CHECK_CALL (t3v (f), 2, var_i); + CHECK_CALL (t3v (d), 4, var_i); + CHECK_CALL (t3v (ld), 6, var_i); + CHECK_CALL (t3v (s), 6, var_i); +} + +/* Test multiple type-generic arguments. */ + +float t4f (float x, float y) { return 10 * x + y; } +double t4d (double x, double y) { return 100 * x + y; } +long double t4l (long double x, long double y) { return 1000 * x + y; } + +#define t4v(x, y) __builtin_tgmath (t4f, t4d, t4l, x, y) + +static void +test_4 (void) +{ + float f1 = 1; + float f2 = 2; + double d1 = 3; + double d2 = 4; + long double ld = 5; + long int l = 6; + CHECK_CALL (t4v (f1, f2), 12, var_f); + CHECK_CALL (t4v (f2, f1), 21, var_f); + CHECK_CALL (t4v (f1, d1), 103, var_d); + CHECK_CALL (t4v (d2, f2), 402, var_d); + CHECK_CALL (t4v (f1, l), 106, var_d); + CHECK_CALL (t4v (ld, f1), 5001, var_ld); + CHECK_CALL (t4v (l, l), 606, var_d); + CHECK_CALL (t4v (l, ld), 6005, var_ld); +} + +/* Test complex argument, real return type. */ + +float t5f (_Complex float x) { return 1 + __real__ x + 3 * __imag__ x; } +double t5d (_Complex double x) { return 2 + __real__ x + 4 * __imag__ x; } +long double t5l (_Complex long double x) { return 3 + __real__ x + 5 * __imag__ x; } + +#define t5v(x) __builtin_tgmath (t5f, t5d, t5l, x) + +static void +test_5 (void) +{ + float f = 1; + _Complex float cf = 2 + 3i; + double d = 4; + _Complex double cd = 5 + 6i; + long double ld = 7; + _Complex long double cld = 8 + 9i; + int i = 10; + _Complex int ci = 11 + 12i; + CHECK_CALL (t5v (f), 2, var_f); + CHECK_CALL (t5v (cf), 12, var_f); + CHECK_CALL (t5v (d), 6, var_d); + CHECK_CALL (t5v (cd), 31, var_d); + CHECK_CALL (t5v (ld), 10, var_ld); + CHECK_CALL (t5v (cld), 56, var_ld); + CHECK_CALL (t5v (i), 12, var_d); + CHECK_CALL (t5v (ci), 61, var_d); +} + +/* Test complex argument, complex return type. */ + +_Complex float t6f (_Complex float x) { return 1 + x; } +_Complex double t6d (_Complex double x) { return 2 + x; } +_Complex long double t6l (_Complex long double x) { return 3 + x; } + +#define t6v(x) __builtin_tgmath (t6f, t6d, t6l, x) + +static void +test_6 (void) +{ + float f = 1; + _Complex float cf = 2 + 3i; + double d = 4; + _Complex double cd = 5 + 6i; + long double ld = 7; + _Complex long double cld = 8 + 9i; + int i = 10; + _Complex int ci = 11 + 12i; + CHECK_CALL (t6v (f), 2, var_cf); + CHECK_CALL (t6v (cf), 3 + 3i, var_cf); + CHECK_CALL (t6v (d), 6, var_cd); + CHECK_CALL (t6v (cd), 7 + 6i, var_cd); + CHECK_CALL (t6v (ld), 10, var_cld); + CHECK_CALL (t6v (cld), 11 + 9i, var_cld); + CHECK_CALL (t6v (i), 12, var_cd); + CHECK_CALL (t6v (ci), 13 + 12i, var_cd); +} + +/* Test real and complex argument, real return type. */ + +float t7f (float x) { return 1 + x; } +float t7cf (_Complex float x) { return 2 + __real__ x; } +double t7d (double x) { return 3 + x; } +double t7cd (_Complex double x) { return 4 + __real__ x; } +long double t7l (long double x) { return 5 + x; } +long double t7cl (_Complex long double x) { return 6 + __real__ x; } + +#define t7v(x) __builtin_tgmath (t7f, t7d, t7l, t7cf, t7cd, t7cl, x) + +static void +test_7 (void) +{ + float f = 1; + _Complex float cf = 2 + 3i; + double d = 4; + _Complex double cd = 5 + 6i; + long double ld = 7; + _Complex long double cld = 8 + 9i; + int i = 10; + _Complex int ci = 11 + 12i; + CHECK_CALL (t7v (f), 2, var_f); + CHECK_CALL (t7v (cf), 4, var_f); + CHECK_CALL (t7v (d), 7, var_d); + CHECK_CALL (t7v (cd), 9, var_d); + CHECK_CALL (t7v (ld), 12, var_ld); + CHECK_CALL (t7v (cld), 14, var_ld); + CHECK_CALL (t7v (i), 13, var_d); + CHECK_CALL (t7v (ci), 15, var_d); +} + +/* Test real and complex argument, real and complex return type. */ + +float t8f (float x) { return 1 + x; } +_Complex float t8cf (_Complex float x) { return 2 + x; } +double t8d (double x) { return 3 + x; } +_Complex double t8cd (_Complex double x) { return 4 + x; } +long double t8l (long double x) { return 5 + x; } +_Complex long double t8cl (_Complex long double x) { return 6 + x; } + +#define t8v(x) __builtin_tgmath (t8f, t8d, t8l, t8cf, t8cd, t8cl, x) + +static void +test_8 (void) +{ + float f = 1; + _Complex float cf = 2 + 3i; + double d = 4; + _Complex double cd = 5 + 6i; + long double ld = 7; + _Complex long double cld = 8 + 9i; + int i = 10; + _Complex int ci = 11 + 12i; + CHECK_CALL (t8v (f), 2, var_f); + CHECK_CALL (t8v (cf), 4 + 3i, var_cf); + CHECK_CALL (t8v (d), 7, var_d); + CHECK_CALL (t8v (cd), 9 + 6i, var_cd); + CHECK_CALL (t8v (ld), 12, var_ld); + CHECK_CALL (t8v (cld), 14 + 9i, var_cld); + CHECK_CALL (t8v (i), 13, var_d); + CHECK_CALL (t8v (ci), 15 + 12i, var_cd); +} + +/* Test multiple type-generic arguments, real and complex. */ + +float t9f (float x, float y) { return x + 10 * y; } +_Complex float t9cf (_Complex float x, _Complex float y) { return x + 100 * y; } +double t9d (double x, double y) { return x + 1000 * y; } +_Complex double t9cd (_Complex double x, _Complex double y) { return x + 10000 * y; } +long double t9l (long double x, long double y) { return x + 100000 * y; } +_Complex long double t9cl (_Complex long double x, _Complex long double y) { return x + 1000000 * y; } + +#define t9v(x, y) __builtin_tgmath (t9f, t9d, t9l, t9cf, t9cd, t9cl, x, y) + +static void +test_9 (void) +{ + float f = 1; + _Complex float cf = 2 + 3i; + double d = 4; + _Complex double cd = 5 + 6i; + long double ld = 7; + _Complex long double cld = 8 + 9i; + int i = 10; + _Complex int ci = 11 + 12i; + CHECK_CALL (t9v (f, f), 11, var_f); + CHECK_CALL (t9v (f, cf), 201 + 300i, var_cf); + CHECK_CALL (t9v (cf, f), 102 + 3i, var_cf); + CHECK_CALL (t9v (f, i), 10001, var_d); + CHECK_CALL (t9v (i, f), 1010, var_d); + CHECK_CALL (t9v (d, d), 4004, var_d); + CHECK_CALL (t9v (d, cd), 50004 + 60000i, var_cd); + CHECK_CALL (t9v (ld, i), 1000007, var_ld); + CHECK_CALL (t9v (cf, cld), 8000002 + 9000003i, var_cld); + CHECK_CALL (t9v (i, i), 10010, var_d); + CHECK_CALL (t9v (ci, i), 100011 + 12i, var_cd); +} + +/* Test functions rounding result to narrower type. */ + +float t10d (double x) { return 1 + x; } +float t10l (long double x) { return 2 + x; } + +#define t10v(x) __builtin_tgmath (t10d, t10l, x) + +static void +test_10 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + short s = 4; + CHECK_CALL (t10v (f), 2, var_f); + CHECK_CALL (t10v (d), 3, var_f); + CHECK_CALL (t10v (ld), 5, var_f); + CHECK_CALL (t10v (s), 5, var_f); +} + +int +main (void) +{ + test_1 (); + test_2 (); + test_3 (); + test_4 (); + test_5 (); + test_6 (); + test_7 (); + test_8 (); + test_9 (); + test_10 (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-2.c b/gcc/testsuite/gcc.dg/builtin-tgmath-2.c new file mode 100644 index 00000000000..c4140cc2bd5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-tgmath-2.c @@ -0,0 +1,51 @@ +/* Test __builtin_tgmath: valid uses, _FloatN types. */ +/* { dg-do run } */ +/* { dg-options "" } */ +/* { dg-add-options float32 } */ +/* { dg-require-effective-target float32_runtime } */ + +extern void abort (void); +extern void exit (int); + +#define CHECK_CALL(C, E, V) \ + do \ + { \ + if ((C) != (E)) \ + abort (); \ + extern __typeof (C) V; \ + } \ + while (0) + +extern float var_f; +extern double var_d; +extern long double var_ld; +extern _Float32 var_f32; + +float t1f (float x) { return x + 1; } +double t1d (double x) { return x + 2; } +long double t1l (long double x) { return x + 3; } +_Float32 t1f32 (_Float32 x) { return x + 4; } + +#define t1v(x) __builtin_tgmath (t1f, t1d, t1l, t1f32, x) + +static void +test_1 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + _Float32 f32 = 4; + int i = 5; + CHECK_CALL (t1v (f), 2, var_f); + CHECK_CALL (t1v (d), 4, var_d); + CHECK_CALL (t1v (ld), 6, var_ld); + CHECK_CALL (t1v (f32), 8, var_f32); + CHECK_CALL (t1v (i), 7, var_d); +} + +int +main (void) +{ + test_1 (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c new file mode 100644 index 00000000000..9016ec742be --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c @@ -0,0 +1,76 @@ +/* Test __builtin_tgmath: errors that indicate a bad definition of a + type-generic macro rather than bad arguments in a call to it. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void *p; +double d; +double unprototyped_d (); +long double unprototyped_ld (); +double variadic_d (double, ...); +long double variadic_ld (long double, ...); +double no_arguments_d (void); +long double no_arguments_ld (void); +double f_d (double); +long double f_ld (long double); +double many_args (double, double, double, double); +int f_i_d (double); +_Complex int f_ci_d (double); +void * f_p_d (double); +double f_d_i (int); +double f_d_ci (_Complex int); +double f_d_p (void *); +long double f_ld_d (double); +_Complex double f_cd_d (double); +double f_d_f (float); +double f_d_dd (double, double); +long double f_ld_ldld (long double, long double); +float f_f_fd (float, double); + +void +test (void) +{ + /* Arguments individually invalid or no consistent number of + arguments followed by those arguments. */ + __builtin_tgmath (); /* { dg-error "too few arguments" } */ + __builtin_tgmath (f_d); /* { dg-error "too few arguments" } */ + __builtin_tgmath (f_d, f_ld); /* { dg-error "too few arguments" } */ + __builtin_tgmath (many_args, many_args, many_args); /* { dg-error "too few arguments" } */ + __builtin_tgmath (many_args, d, d, d, d); /* { dg-error "too few arguments" } */ + __builtin_tgmath (f_ld, many_args, d); /* { dg-error "has wrong number of arguments" } */ + __builtin_tgmath (unprototyped_d, unprototyped_ld, d); /* { dg-error "is unprototyped" } */ + __builtin_tgmath (f_d, unprototyped_ld, d); /* { dg-error "is unprototyped" } */ + __builtin_tgmath (variadic_d, variadic_ld, d); /* { dg-error "variable arguments" } */ + __builtin_tgmath (f_d, variadic_ld, d); /* { dg-error "variable arguments" } */ + __builtin_tgmath (p, p, p); /* { dg-error "is not a function pointer" } */ + __builtin_tgmath (f_d, p, p); /* { dg-error "is not a function pointer" } */ + __builtin_tgmath (no_arguments_d, no_arguments_d, no_arguments_ld); /* { dg-error "has no arguments" } */ + __builtin_tgmath (f_d, no_arguments_d, no_arguments_ld); /* { dg-error "has no arguments" } */ + + /* Invalid varying types of arguments. */ + __builtin_tgmath (f_i_d, f_ld, 0); /* { dg-error "invalid type-generic return type" } */ + __builtin_tgmath (f_ci_d, f_ld, 0); /* { dg-error "invalid type-generic return type" } */ + __builtin_tgmath (f_p_d, f_ld, 0); /* { dg-error "invalid type-generic return type" } */ + __builtin_tgmath (f_ld, f_i_d, 0); /* { dg-error "invalid type-generic return type" } */ + __builtin_tgmath (f_ld, f_ci_d, 0); /* { dg-error "invalid type-generic return type" } */ + __builtin_tgmath (f_ld, f_p_d, 0); /* { dg-error "invalid type-generic return type" } */ + __builtin_tgmath (f_d_i, f_ld, 0); /* { dg-error "invalid type-generic type for argument" } */ + __builtin_tgmath (f_d_ci, f_ld, 0); /* { dg-error "invalid type-generic type for argument" } */ + __builtin_tgmath (f_d_p, f_ld, 0); /* { dg-error "invalid type-generic type for argument" } */ + __builtin_tgmath (f_ld, f_d_i, 0); /* { dg-error "invalid type-generic type for argument" } */ + __builtin_tgmath (f_ld, f_d_ci, 0); /* { dg-error "invalid type-generic type for argument" } */ + __builtin_tgmath (f_ld, f_d_p, 0); /* { dg-error "invalid type-generic type for argument" } */ + + /* Arguments same type. */ + __builtin_tgmath (f_d, f_d, 0); /* { dg-error "all have the same type" } */ + + /* Missing or invalid type-generic parameter. */ + __builtin_tgmath (f_d, f_ld_d, 0); /* { dg-error "lack type-generic parameter" } */ + __builtin_tgmath (f_d, f_ld, f_cd_d, 0); /* { dg-error "lack type-generic parameter" } */ + __builtin_tgmath (f_d, f_ld, f_d, 0); /* { dg-error "duplicate type-generic parameter type" } */ + + /* Variation not consistent with the identified type-generic + parameter. */ + __builtin_tgmath (f_d, f_ld, f_d_f, 0); /* { dg-error "bad return type for function argument" } */ + __builtin_tgmath (f_d_dd, f_ld_ldld, f_f_fd, 0, 0); /* { dg-error "bad type for argument" } */ +} diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c b/gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c new file mode 100644 index 00000000000..df5655ef402 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c @@ -0,0 +1,19 @@ +/* Test __builtin_tgmath: errors that indicate bad arguments in a call + to a type-generic macro, non-DFP. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +float f_f (float); +double f_d (double); +long double f_ld (long double); +void *p; +long double ld; +_Complex float cf; + +void +test (void) +{ + __builtin_tgmath (f_f, f_d, f_ld, p); /* { dg-error "invalid type of argument" } */ + __builtin_tgmath (f_f, f_d, ld); /* { dg-error "no matching function for type-generic call" } */ + __builtin_tgmath (f_f, f_d, cf); /* { dg-error "no matching function for type-generic call" } */ +} diff --git a/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c b/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c index 4f6a04be45a..06a244e097d 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c +++ b/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c @@ -5,25 +5,25 @@ /* Make sure we get warnings in the expected lines. */ -#pragma unknown1 /* { dg-warning "unknown1" "unknown1" } */ +#pragma unknown1 /* { dg-warning "-:unknown1" "unknown1" } */ #define COMMA , #define FOO(x) x #define BAR(x) _Pragma("unknown_before") x #define BAZ(x) x _Pragma("unknown_after") -int _Pragma("unknown2") bar1; /* { dg-warning "unknown2" "unknown2" } */ +int _Pragma("unknown2") bar1; /* { dg-warning "-:unknown2" "unknown2" } */ -FOO(int _Pragma("unknown3") bar2); /* { dg-warning "unknown3" "unknown3" } */ +FOO(int _Pragma("unknown3") bar2); /* { dg-warning "-:unknown3" "unknown3" } */ -int BAR(bar3); /* { dg-warning "unknown_before" "unknown_before 1" } */ +int BAR(bar3); /* { dg-warning "-:unknown_before" "unknown_before 1" } */ -BAR(int bar4); /* { dg-warning "unknown_before" "unknown_before 2" } */ +BAR(int bar4); /* { dg-warning "-:unknown_before" "unknown_before 2" } */ -int BAZ(bar5); /* { dg-warning "unknown_after" "unknown_after 1" } */ +int BAZ(bar5); /* { dg-warning "-:unknown_after" "unknown_after 1" } */ -int BAZ(bar6;) /* { dg-warning "unknown_after" "unknown_after 2" } */ +int BAZ(bar6;) /* { dg-warning "-:unknown_after" "unknown_after 2" } */ -FOO(int bar7; _Pragma("unknown4")) /* { dg-warning "unknown4" "unknown4" } */ +FOO(int bar7; _Pragma("unknown4")) /* { dg-warning "-:unknown4" "unknown4" } */ -#pragma unknown5 /* { dg-warning "unknown5" "unknown5" } */ +#pragma unknown5 /* { dg-warning "-:unknown5" "unknown5" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/Wunused.c b/gcc/testsuite/gcc.dg/cpp/Wunused.c index ac363ad04b8..d6f76288cd7 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wunused.c +++ b/gcc/testsuite/gcc.dg/cpp/Wunused.c @@ -15,9 +15,9 @@ #define used3 /* { dg-bogus "used" } */ #define used4 used4 /* { dg-bogus "used" } */ -#define unused5 /* { dg-warning "used" } */ -#define unused6 /* { dg-warning "used" } */ -#define unused7() /* { dg-warning "used" } */ +#define unused5 /* { dg-warning "-:used" } */ +#define unused6 /* { dg-warning "-:used" } */ +#define unused7() /* { dg-warning "-:used" } */ #if defined used1 #endif diff --git a/gcc/testsuite/gcc.dg/cpp/macsyntx.c b/gcc/testsuite/gcc.dg/cpp/macsyntx.c index 146dcedab5f..ff7e37a0d06 100644 --- a/gcc/testsuite/gcc.dg/cpp/macsyntx.c +++ b/gcc/testsuite/gcc.dg/cpp/macsyntx.c @@ -51,15 +51,15 @@ one(ichi\ two(ichi) /* { dg-error "requires 2" } */ var0() /* OK. */ var0(ichi) /* OK. */ -var1() /* { dg-warning "requires at least one" } */ -var1(ichi) /* { dg-warning "requires at least one" } */ +var1() /* { dg-warning "requires at least one" "" { xfail *-*-* } } */ +var1(ichi) /* { dg-warning "requires at least one" "" { xfail *-*-* } } */ var1(ichi, ni) /* OK. */ /* This tests two oddities of GNU rest args - omitting a comma is OK, and backtracking a token on pasting an empty rest args. */ #define rest(x, y...) x ## y /* { dg-warning "ISO C" } */ rest(ichi,) /* OK. */ -rest(ichi) /* { dg-warning "requires at least one" } */ +rest(ichi) /* { dg-warning "requires at least one" "" { xfail *-*-* } } */ #if 23 != rest(2, 3) /* OK, no warning. */ #error 23 != 23 !! #endif diff --git a/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c b/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c index f79670a17cb..d4176144f5d 100644 --- a/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c +++ b/gcc/testsuite/gcc.dg/cpp/misspelled-directive-1.c @@ -1,4 +1,4 @@ -#ifndef SOME_GUARD /* { dg-error "unterminated" } */ +#ifndef SOME_GUARD /* { dg-error "-:unterminated" } */ #if 1 /* Typo here: "endfi" should have been "endif". */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef2.c b/gcc/testsuite/gcc.dg/cpp/redef2.c index 1dbc10033ed..439d33a7057 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef2.c +++ b/gcc/testsuite/gcc.dg/cpp/redef2.c @@ -17,15 +17,15 @@ #define foo(x) x #define foo(x)x /* { dg-bogus "redefined" "redefined foo" } */ -/* { dg-warning "redefined" "redef mac" { target *-*-* } 7 } - { dg-warning "redefined" "redef mac" { target *-*-* } 8 } - { dg-warning "redefined" "redef mac" { target *-*-* } 9 } - { dg-warning "redefined" "redef ro" { target *-*-* } 12 } - { dg-warning "redefined" "redef va" { target *-*-* } 15 } +/* { dg-warning "-:redefined" "redef mac" { target *-*-* } 7 } + { dg-warning "-:redefined" "redef mac" { target *-*-* } 8 } + { dg-warning "-:redefined" "redef mac" { target *-*-* } 9 } + { dg-warning "-:redefined" "redef ro" { target *-*-* } 12 } + { dg-warning "-:redefined" "redef va" { target *-*-* } 15 } - { dg-message "previous" "prev def mac" { target *-*-* } 6 } - { dg-message "previous" "prev def mac" { target *-*-* } 7 } - { dg-message "previous" "prev def mac" { target *-*-* } 8 } - { dg-message "previous" "prev def ro" { target *-*-* } 11 } - { dg-message "previous" "prev def va" { target *-*-* } 14 } + { dg-message "-:previous" "prev def mac" { target *-*-* } 6 } + { dg-message "-:previous" "prev def mac" { target *-*-* } 7 } + { dg-message "-:previous" "prev def mac" { target *-*-* } 8 } + { dg-message "-:previous" "prev def ro" { target *-*-* } 11 } + { dg-message "-:previous" "prev def va" { target *-*-* } 14 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef3.c b/gcc/testsuite/gcc.dg/cpp/redef3.c index 1c541a45bb1..4e4ef128b10 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef3.c +++ b/gcc/testsuite/gcc.dg/cpp/redef3.c @@ -11,11 +11,11 @@ #define D 1 2 #define E -/* { dg-warning "redefined" "redef A" { target *-*-* } 7 } - { dg-warning "redefined" "redef B" { target *-*-* } 9 } - { dg-warning "redefined" "redef D" { target *-*-* } 11 } - { dg-warning "redefined" "redef E" { target *-*-* } 12 } - { dg-message "previous" "prev def A" { target *-*-* } 6 } - { dg-message "previous" "prev def B" { target *-*-* } 8 } - { dg-message "previous" "prev def D/E" { target *-*-* } 0 } +/* { dg-warning "-:redefined" "redef A" { target *-*-* } 7 } + { dg-warning "-:redefined" "redef B" { target *-*-* } 9 } + { dg-warning "-:redefined" "redef D" { target *-*-* } 11 } + { dg-warning "-:redefined" "redef E" { target *-*-* } 12 } + { dg-message "-:previous" "prev def A" { target *-*-* } 6 } + { dg-message "-:previous" "prev def B" { target *-*-* } 8 } + { dg-message "-:previous" "prev def D/E" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef4.c b/gcc/testsuite/gcc.dg/cpp/redef4.c index b34635b2e42..aa6729b770b 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef4.c +++ b/gcc/testsuite/gcc.dg/cpp/redef4.c @@ -4,41 +4,41 @@ /* { dg-do preprocess } */ /* { dg-options "" } */ -#define str(x) #x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) #x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) #x /* { dg-message "previous definition" } */ -#define str(x) # x /* { dg-warning "redefined" } */ +#define str(x) #x /* { dg-message "-:previous definition" } */ +#define str(x) # x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) #x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) #x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) #x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) #x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) # x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) # x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %:x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) %:x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) # x /* { dg-message "previous definition" } */ -#define str(x) #x /* { dg-warning "redefined" } */ +#define str(x) # x /* { dg-message "-:previous definition" } */ +#define str(x) #x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) # x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) # x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) # x /* { dg-message "previous definition" } */ -#define str(x) %: x /* { dg-warning "redefined" } */ +#define str(x) # x /* { dg-message "-:previous definition" } */ +#define str(x) %: x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %: x /* { dg-message "previous definition" } */ -#define str(x) #x /* { dg-warning "redefined" } */ +#define str(x) %: x /* { dg-message "-:previous definition" } */ +#define str(x) #x /* { dg-warning "-:redefined" } */ #undef str -#define str(x) %: x /* { dg-message "previous definition" } */ -#define str(x) # x /* { dg-warning "redefined" } */ +#define str(x) %: x /* { dg-message "-:previous definition" } */ +#define str(x) # x /* { dg-warning "-:redefined" } */ #undef str #define str(x) #x @@ -54,173 +54,173 @@ #define str(x) %: x #undef str -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a#x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a#x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%:x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a%:x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a# x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a# x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a%: x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a%: x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a #x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a #x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %:x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a %:x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a # x /* { dg-message "previous definition" } */ -#define astr(x) a %: x /* { dg-warning "redefined" } */ +#define astr(x) a # x /* { dg-message "-:previous definition" } */ +#define astr(x) a %: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a#x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a#x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a# x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a# x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a%: x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a%: x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a #x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a #x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a %:x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a %:x /* { dg-warning "-:redefined" } */ #undef astr -#define astr(x) a %: x /* { dg-message "previous definition" } */ -#define astr(x) a # x /* { dg-warning "redefined" } */ +#define astr(x) a %: x /* { dg-message "-:previous definition" } */ +#define astr(x) a # x /* { dg-warning "-:redefined" } */ #undef astr #define astr(x) a#x @@ -248,173 +248,173 @@ #define astr(x) a %: x #undef astr -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x%:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ##y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ##y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%:y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x ## y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x ## y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x## y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x%:%: y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ##y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ##y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x %:%:y /* { dg-warning "-:redefined" } */ #undef cat -#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */ -#define cat(x,y) x ## y /* { dg-warning "redefined" } */ +#define cat(x,y) x %:%: y /* { dg-message "-:previous definition" } */ +#define cat(x,y) x ## y /* { dg-warning "-:redefined" } */ #undef cat #define cat(x,y) x##y @@ -442,28 +442,28 @@ #define cat(x,y) x %:%: y #undef cat -#define cat3(x,y,z) x##y##z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y####z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y##z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y####z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x####y##z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x####y##z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y## ##z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y## ##z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y##%:%:z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y##%:%:z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y######## ####z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y############z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y######## ####z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y############z /* { dg-warning "-:redefined" } */ #undef cat3 -#define cat3(x,y,z) x##y############z /* { dg-message "previous definition" } */ -#define cat3(x,y,z) x##y########%:%:##z /* { dg-warning "redefined" } */ +#define cat3(x,y,z) x##y############z /* { dg-message "-:previous definition" } */ +#define cat3(x,y,z) x##y########%:%:##z /* { dg-warning "-:redefined" } */ #undef cat3 #define cat3(x,y,z) x##y##z diff --git a/gcc/testsuite/gcc.dg/cpp/sysmac1.c b/gcc/testsuite/gcc.dg/cpp/sysmac1.c index 54f161e020f..55ec200ffff 100644 --- a/gcc/testsuite/gcc.dg/cpp/sysmac1.c +++ b/gcc/testsuite/gcc.dg/cpp/sysmac1.c @@ -22,5 +22,5 @@ (str); /* { dg-warning "used with arguments" } */ (sys_str); /* { dg-bogus "used with arguments" } */ -foo (one_arg); /* { dg-warning "requires at least one" } */ +foo (one_arg); /* { dg-warning "requires at least one" "" { xfail *-*-* } } */ sys_foo (one_arg); /* { dg-bogus "requires at least one" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c b/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c index 403d617f5d0..97465f3967c 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c @@ -14,9 +14,9 @@ #define used3 /* { dg-bogus "used" } */ #define used4 something /* { dg-bogus "used" } */ -#define unused5 /* { dg-warning "used" } */ -#define unused6 /* { dg-warning "used" } */ -#define unused7() /* { dg-warning "used" } */ +#define unused5 /* { dg-warning "-:used" } */ +#define unused6 /* { dg-warning "-:used" } */ +#define unused7() /* { dg-warning "-:used" } */ #if defined used1 #endif diff --git a/gcc/testsuite/gcc.dg/cpp/trad/argcount.c b/gcc/testsuite/gcc.dg/cpp/trad/argcount.c index 208cd44b3b0..7098caf7d76 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/argcount.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/argcount.c @@ -7,15 +7,15 @@ #define g(x, y) x y #define h() -f(); /* { dg-bogus "requires 1" "no arg is 1 empty arg" } */ -f( ); /* { dg-bogus "macro" "1 arg to 1 param macro" } */ -f(1,); /* { dg-error "passed 2" "2 args to 1 param macro" } */ -f(1,2); /* { dg-error "passed 2" "2 args to 1 param macro" } */ -h(); /* { dg-bogus "macro" "no arg to 1 param macro" } */ -h( ); /* { dg-error "passed 1" "1 arg to 0 param macro" } */ -h(1,2); /* { dg-error "passed 2" "2 args to 0 param macro" } */ -g(); /* { dg-error "requires 2" "0 args to 2 param macro" } */ -g( ); /* { dg-error "requires 2" "1 args to 2 param macro" } */ -g( ,2); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */ -g(,); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */ -g(1,2,3); /* { dg-error "passed 3" "3 args to 2 param macro" } */ +f(); /* { dg-bogus "-:requires 1" "no arg is 1 empty arg" } */ +f( ); /* { dg-bogus "-:macro" "1 arg to 1 param macro" } */ +f(1,); /* { dg-error "-:passed 2" "2 args to 1 param macro" } */ +f(1,2); /* { dg-error "-:passed 2" "2 args to 1 param macro" } */ +h(); /* { dg-bogus "-:macro" "no arg to 1 param macro" } */ +h( ); /* { dg-error "-:passed 1" "1 arg to 0 param macro" } */ +h(1,2); /* { dg-error "-:passed 2" "2 args to 0 param macro" } */ +g(); /* { dg-error "-:requires 2" "0 args to 2 param macro" } */ +g( ); /* { dg-error "-:requires 2" "1 args to 2 param macro" } */ +g( ,2); /* { dg-bogus "-:requires 2" "2 args to 2 param macro" } */ +g(,); /* { dg-bogus "-:requires 2" "2 args to 2 param macro" } */ +g(1,2,3); /* { dg-error "-:passed 3" "3 args to 2 param macro" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c index e2710ad5629..7d1d8252f01 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c @@ -3,4 +3,4 @@ /* { dg-do preprocess } */ #if 0 -#endif // /* { dg-warning "extra tokens" } */ +#endif // /* { dg-warning "-:extra tokens" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment.c b/gcc/testsuite/gcc.dg/cpp/trad/comment.c index 971a78a6d10..36fa90d3f37 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/comment.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/comment.c @@ -2,4 +2,4 @@ /* { dg-do preprocess } */ -/* { dg-error "unterminated comment" } +/* { dg-error "-:unterminated comment" } diff --git a/gcc/testsuite/gcc.dg/cpp/trad/defined.c b/gcc/testsuite/gcc.dg/cpp/trad/defined.c index 5fa1d93b8aa..fa4c4119d3d 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/defined.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/defined.c @@ -16,7 +16,7 @@ #error REGPARMS should be defined #endif -#define defined /* { dg-error "defined" } */ +#define defined /* { dg-error "-:defined" } */ /* No diagnostics, though you could argue there should be. */ #if defined defined diff --git a/gcc/testsuite/gcc.dg/cpp/trad/directive.c b/gcc/testsuite/gcc.dg/cpp/trad/directive.c index ee7ebcab031..0a42df62639 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/directive.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/directive.c @@ -12,7 +12,7 @@ HASH /* Directives with their #s indented are not recognized. */ #if 0 /* { dg-bogus "unterminated" } */ -#wrong /* { dg-error "invalid" } */ +#wrong /* { dg-error "-:invalid" } */ #define foo 2 #define bar + 3 diff --git a/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c b/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c index 5300afba708..2baa99a31c3 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c @@ -5,8 +5,8 @@ #define f(x) x -#if 2 f(/* { dg-error "unterminated" "unterminated macro in directive" } */ +#if 2 f(/* { dg-error "-:unterminated" "unterminated macro in directive" } */ ) #endif -f( /* { dg-error "unterminated" "unterminated macro" } */ +f( /* { dg-error "-:unterminated" "unterminated macro" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/funlike.c b/gcc/testsuite/gcc.dg/cpp/trad/funlike.c index db550d53c76..1af6f9fcf97 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/funlike.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/funlike.c @@ -21,5 +21,5 @@ # error /* { dg-bogus "error" "empty macro" } */ #endif -#if f paren 6) /* { dg-error "missing binary" "macro-expanded parenthesis" } */ +#if f paren 6) /* { dg-error "-:missing binary" "macro-expanded parenthesis" } */ #endif diff --git a/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c b/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c index faa7bd87674..a6f9637c640 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c @@ -2,7 +2,7 @@ recognized. */ /* { dg-do preprocess } */ -/* { dg-warning "missing terminating" "bad charconst" { target *-*-* } .+2 } */ -/* { dg-error "not valid" "bad charconst" { target *-*-* } .+1 } */ +/* { dg-warning "-:missing terminating" "bad charconst" { target *-*-* } .+2 } */ +/* { dg-error "-:not valid" "bad charconst" { target *-*-* } .+1 } */ #if 'x #endif diff --git a/gcc/testsuite/gcc.dg/cpp/trad/macro.c b/gcc/testsuite/gcc.dg/cpp/trad/macro.c index 164b4ecfee6..6f8aa9ac239 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/macro.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/macro.c @@ -4,7 +4,7 @@ /* { dg-do preprocess } */ #define f(x) -#define g(x, y...) /* { dg-error "macro parameter list" } */ +#define g(x, y...) /* { dg-error "-:macro parameter list" } */ #if 0 #define f(a,b) /* { dg-bogus "passed 2 arguments" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c b/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c index cf2f449133c..3cee7b9888b 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/pr65238-4.c @@ -11,9 +11,9 @@ #if __has_attribute(__has_attribute(unused)) #endif -/* { dg-error "unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 5 } */ -/* { dg-error "#if with no expression" "" {target "*-*-*"} 5 } */ -/* { dg-error "unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 7 } */ -/* { dg-error "macro .__has_attribute. passed 2 arguments, but takes just 1" "" {target "*-*-*"} 9 } */ -/* { dg-error "missing ... in expression" "" {target "*-*-*"} 9 } */ -/* { dg-error "macro .__has_attribute. requires an identifier" "" {target "*-*-*"} 11 } */ +/* { dg-error "-:unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 5 } */ +/* { dg-error "-:#if with no expression" "" {target "*-*-*"} 5 } */ +/* { dg-error "-:unterminated argument list invoking macro .__has_attribute." "" {target "*-*-*"} 7 } */ +/* { dg-error "-:macro .__has_attribute. passed 2 arguments, but takes just 1" "" {target "*-*-*"} 9 } */ +/* { dg-error "-:missing ... in expression" "" {target "*-*-*"} 9 } */ +/* { dg-error "-:macro .__has_attribute. requires an identifier" "" {target "*-*-*"} 11 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c b/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c index b5fd7af7f5f..31c020bad87 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c @@ -4,7 +4,7 @@ /* { dg-do preprocess } */ #define foo foo -foo /* { dg-error "detected recursion" } */ +foo /* { dg-error "-:detected recursion" } */ #define bar a bar b -bar /* { dg-error "detected recursion" } */ +bar /* { dg-error "-:detected recursion" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c b/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c index 5c6550fae2a..3e5929d5a04 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c @@ -4,13 +4,13 @@ /* { dg-do preprocess } */ #define foo() foo() -foo(); /* { dg-error "detected recursion" } */ +foo(); /* { dg-error "-:detected recursion" } */ #define bar() bar baz() bar bar(); /* { dg-bogus "detected recursion" } */ #define baz() foo() -baz(); /* { dg-error "detected recursion" } */ +baz(); /* { dg-error "-:detected recursion" } */ #define a(x) x(a) -a(a); /* { dg-error "detected recursion" } */ +a(a); /* { dg-error "-:detected recursion" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/redef2.c b/gcc/testsuite/gcc.dg/cpp/trad/redef2.c index 5fcd5eb32e8..ad10b86fd3d 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/redef2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/redef2.c @@ -2,31 +2,31 @@ /* { dg-do preprocess } */ -#define foo bar /* { dg-message "previous def" "foo prev def" } */ -#define foo barr /* { dg-warning "redefined" "foo redefined" } */ +#define foo bar /* { dg-message "-:previous def" "foo prev def" } */ +#define foo barr /* { dg-warning "-:redefined" "foo redefined" } */ #undef foo -#define foo bar /* { dg-message "previous def" "foo prev def 2" } */ -#define foo() bar /* { dg-warning "redefined" "foo redefined 2" } */ +#define foo bar /* { dg-message "-:previous def" "foo prev def 2" } */ +#define foo() bar /* { dg-warning "-:redefined" "foo redefined 2" } */ #undef foo -#define foo() bar /* { dg-message "previous def" "foo prev def" } */ -#define foo() barr /* { dg-warning "redefined" "foo redefined" } */ +#define foo() bar /* { dg-message "-:previous def" "foo prev def" } */ +#define foo() barr /* { dg-warning "-:redefined" "foo redefined" } */ -#define quux(thud) a thud b /* { dg-message "previous def" "quux prev def" } */ -#define quux(thu) a thud b /* { dg-warning "redefined" "quux redefined" } */ +#define quux(thud) a thud b /* { dg-message "-:previous def" "quux prev def" } */ +#define quux(thu) a thud b /* { dg-warning "-:redefined" "quux redefined" } */ -#define bar(x, y) x+y /* { dg-message "previous def" "bar prev def" } */ -#define bar(x, y) x+x /* { dg-warning "redefined" "bar redefined" } */ +#define bar(x, y) x+y /* { dg-message "-:previous def" "bar prev def" } */ +#define bar(x, y) x+x /* { dg-warning "-:redefined" "bar redefined" } */ -#define bat(x, y) x+y /* { dg-message "previous def" "bat prev def" } */ -#define bat(x, y) x+ y /* { dg-warning "redefined" "bat redefined" } */ +#define bat(x, y) x+y /* { dg-message "-:previous def" "bat prev def" } */ +#define bat(x, y) x+ y /* { dg-warning "-:redefined" "bat redefined" } */ -#define baz(x, y) x+y /* { dg-message "previous def" "baz prev def" } */ -#define baz(x, y) x +y /* { dg-warning "redefined" "baz redefined" } */ +#define baz(x, y) x+y /* { dg-message "-:previous def" "baz prev def" } */ +#define baz(x, y) x +y /* { dg-warning "-:redefined" "baz redefined" } */ -#define f(x, y) "x y" /* { dg-message "previous def" "f prev def" } */ -#define f(x, y) "x y" /* { dg-warning "redefined" "f redefined" } */ +#define f(x, y) "x y" /* { dg-message "-:previous def" "f prev def" } */ +#define f(x, y) "x y" /* { dg-warning "-:redefined" "f redefined" } */ -#define g(x, y) 'x' /* { dg-message "previous def" "g prev def" } */ -#define g(x, y) ' x' /* { dg-warning "redefined" "g redefined" } */ +#define g(x, y) 'x' /* { dg-message "-:previous def" "g prev def" } */ +#define g(x, y) ' x' /* { dg-warning "-:redefined" "g redefined" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-11.c b/gcc/testsuite/gcc.dg/cpp/ucnid-11.c index a44a3eaf421..b6956f54454 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-11.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-11.c @@ -4,23 +4,23 @@ /* { dg-options "-std=c99 -pedantic-errors" } */ /* Different spelling of UCN in expansion. */ -#define m1 \u00c1 /* { dg-message "previous definition" } */ -#define m1 \u00C1 /* { dg-error "redefined" } */ +#define m1 \u00c1 /* { dg-message "-:previous definition" } */ +#define m1 \u00C1 /* { dg-error "-:redefined" } */ #define m1ok \u00c1 #define m1ok \u00c1 /* Different spelling of UCN in argument name. */ -#define m2(\u00c1) /* { dg-message "previous definition" } */ -#define m2(\u00C1) /* { dg-error "redefined" } */ +#define m2(\u00c1) /* { dg-message "-:previous definition" } */ +#define m2(\u00C1) /* { dg-error "-:redefined" } */ #define m2ok(\u00c1) #define m2ok(\u00c1) /* Same spelling in argument name but different spelling when used in expansion. */ -#define m3(\u00c1) \u00c1 /* { dg-message "previous definition" } */ -#define m3(\u00c1) \u00C1 /* { dg-error "redefined" } */ +#define m3(\u00c1) \u00c1 /* { dg-message "-:previous definition" } */ +#define m3(\u00c1) \u00C1 /* { dg-error "-:redefined" } */ #define m3ok(\u00c1) \u00C1 #define m3ok(\u00c1) \u00C1 diff --git a/gcc/testsuite/gcc.dg/cpp/unc1.c b/gcc/testsuite/gcc.dg/cpp/unc1.c index 18c306fc89e..d8eb1923103 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc1.c +++ b/gcc/testsuite/gcc.dg/cpp/unc1.c @@ -1,7 +1,7 @@ /* Tests for un-terminated conditionals: 1. */ /* { dg-do preprocess } */ -#if 1 /* { dg-error "unterminated" "unterminated #if" } */ +#if 1 /* { dg-error "-:unterminated" "unterminated #if" } */ #ifdef notdef /* { dg-bogus "unterminated" "nested terminated #ifdef" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/unc2.c b/gcc/testsuite/gcc.dg/cpp/unc2.c index 976d2b181ab..faa4b2905b4 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc2.c +++ b/gcc/testsuite/gcc.dg/cpp/unc2.c @@ -1,7 +1,7 @@ /* Tests for unterminated conditionals: 2. */ /* { dg-do preprocess } */ -#ifdef __sparc__ /* { dg-error "unterminated" "unterminated if-elif-elif..." } */ +#ifdef __sparc__ /* { dg-error "-:unterminated" "unterminated if-elif-elif..." } */ sparc #elif defined __powerpc__ ppc diff --git a/gcc/testsuite/gcc.dg/cpp/unc3.c b/gcc/testsuite/gcc.dg/cpp/unc3.c index d5f16f738ac..e20339cf809 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc3.c +++ b/gcc/testsuite/gcc.dg/cpp/unc3.c @@ -1,5 +1,5 @@ /* Tests for unterminated conditionals: 3. */ /* { dg-do preprocess } */ -#if 1 /* { dg-error "#else" "unterminated #else" } */ +#if 1 /* { dg-error "-:#else" "unterminated #else" } */ #else diff --git a/gcc/testsuite/gcc.dg/cpp/unc4.c b/gcc/testsuite/gcc.dg/cpp/unc4.c index 10c49e9d4db..410e2fcda0c 100644 --- a/gcc/testsuite/gcc.dg/cpp/unc4.c +++ b/gcc/testsuite/gcc.dg/cpp/unc4.c @@ -36,4 +36,4 @@ ignored /* dg.exp doesn't read the included files for tags, so we have to do them explicitly here. */ -/* { dg-error "#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */ +/* { dg-error "-:#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/undef2.c b/gcc/testsuite/gcc.dg/cpp/undef2.c index 5614e039b22..189a72dd9c2 100644 --- a/gcc/testsuite/gcc.dg/cpp/undef2.c +++ b/gcc/testsuite/gcc.dg/cpp/undef2.c @@ -3,11 +3,11 @@ /* { dg-do preprocess } */ -#undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */ -#undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */ -#undef __FILE__ /* { dg-warning "undefining" "__FILE__" } */ -#undef __LINE__ /* { dg-warning "undefining" "__LINE__" } */ -#undef __STDC__ /* { dg-warning "undefining" "__STDC__" } */ +#undef __DATE__ /* { dg-warning "-:undefining \"__DATE__\"" } */ +#undef __TIME__ /* { dg-warning "-:undefining \"__TIME__\"" } */ +#undef __FILE__ /* { dg-warning "-:undefining \"__FILE__\"" } */ +#undef __LINE__ /* { dg-warning "undefining \"__LINE__\"" } */ +#undef __STDC__ /* { dg-warning "undefining \"__STDC__\"" } */ /* These should be protected from #undef, but aren't, because they are set with normal #define commands - and on top of that, some diff --git a/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c b/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c index 3e2e57a79bb..ea5ad8170cd 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c @@ -6,13 +6,13 @@ // { dg-bogus "__TIME__ builtin is not defined" "no-time" { target *-*-* } .-1 } #endif -#define __TIME__ "X" // { dg-error "\"__TIME__\" redefined .-Werror=builtin-macro-redefined." } +#define __TIME__ "X" // { dg-error "-:\"__TIME__\" redefined .-Werror=builtin-macro-redefined." } #define __TIME__ "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-1" { target *-*-* } 9 } + // { dg-warning "-:\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-1" { target *-*-* } 9 } #define X "X" #define X "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-2" { target *-*-* } 15 } + // { dg-warning "-:\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-2" { target *-*-* } 15 } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-redefined.c b/gcc/testsuite/gcc.dg/cpp/warn-redefined.c index c562d072e40..e0446689706 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-redefined.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-redefined.c @@ -6,13 +6,13 @@ // { dg-bogus "__TIME__ builtin is not defined" "no-time" { target *-*-* } .-1 } #endif -#define __TIME__ "X" // { dg-warning "\"__TIME__\" redefined .-Wbuiltin-macro-redefined." } +#define __TIME__ "X" // { dg-warning "-:\"__TIME__\" redefined .-Wbuiltin-macro-redefined." } #define __TIME__ "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-1" { target *-*-* } 9 } + // { dg-warning "-:\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-1" { target *-*-* } 9 } #define X "X" #define X "Y" // { dg-bogus "-Wbuiltin-macro-redefined" } - // { dg-warning "\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } - // { dg-message "previous definition" "previous-2" { target *-*-* } 15 } + // { dg-warning "-:\"X\" redefined" "not-builtin-2" { target *-*-* } .-1 } + // { dg-message "-:previous definition" "previous-2" { target *-*-* } 15 } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c index d7fe145c8cc..f82d67fe9c2 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c @@ -1,4 +1,4 @@ // { dg-do preprocess } // { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=unused-macros" } /* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ -#define X X // { dg-error "macro \"X\" is not used .-Werror=unused-macros." } +#define X X // { dg-error "-:macro \"X\" is not used .-Werror=unused-macros." } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c index e1ce94eeee6..b18f506b13b 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c @@ -1,4 +1,4 @@ // { dg-do preprocess } // { dg-options "-std=gnu99 -fdiagnostics-show-option -Wunused-macros" } -#define X X // { dg-warning "macro \"X\" is not used .-Wunused-macros." } +#define X X // { dg-warning "-:macro \"X\" is not used .-Wunused-macros." } diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr82837.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr82837.c new file mode 100644 index 00000000000..743fb28ca41 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr82837.c @@ -0,0 +1,29 @@ +/* PR debug/82837 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ +/* { dg-additional-options "-march=athlon" { target ia32 } } */ +/* { dg-additional-options "-fPIE" { target pie } } */ + +static char b[100]; +static int *c; +char *e; +void a(char *f, char *i) { + int d = __builtin_object_size(f, 1); + __builtin___strcpy_chk(f, i, d); +} +void g(void) { + int h; + switch (*c) { + case 8: + e = "swapgs"; + break; + case 9: + e = "rdtscp"; + break; + default: + return; + } + h = __builtin_strlen(b); + a(b + h - 6, e); + c++; +} diff --git a/gcc/testsuite/gcc.dg/dfp/builtin-tgmath-dfp-err.c b/gcc/testsuite/gcc.dg/dfp/builtin-tgmath-dfp-err.c new file mode 100644 index 00000000000..b94c760c3ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/builtin-tgmath-dfp-err.c @@ -0,0 +1,33 @@ +/* Test __builtin_tgmath: errors that indicate bad arguments in a call + to a type-generic macro, DFP involved. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +float f_f (float); +double f_d (double); +long double f_ld (long double); +_Complex float f_cf (_Complex float); +_Complex double f_cd (_Complex double); +_Complex long double f_cld (_Complex long double); +_Decimal32 f_d32 (_Decimal32); +_Decimal64 f_d64 (_Decimal64); +_Decimal128 f_d128 (_Decimal128); +float f_ff (float, float); +_Complex float f_cfcf (_Complex float, _Complex float); +_Decimal32 f_d32d32 (_Decimal32, _Decimal32); +_Complex float cf; +float f; +_Decimal32 d32; + +void +test (void) +{ + __builtin_tgmath (f_cf, f_cd, f_cld, d32); /* { dg-error "decimal floating-point argument 1 to complex-only type-generic function" } */ + __builtin_tgmath (f_f, f_d, f_ld, d32); /* { dg-error "decimal floating-point argument 1 to binary-only type-generic function" } */ + __builtin_tgmath (f_cfcf, f_d32d32, cf, d32); /* { dg-error "both complex and decimal floating-point arguments to type-generic function" } */ + __builtin_tgmath (f_ff, f_d32d32, f, d32); /* { dg-error "both binary and decimal floating-point arguments to type-generic function" } */ + __builtin_tgmath (f_d32, f_d64, f_d128, cf); /* { dg-error "complex argument 1 to decimal-only type-generic function" } */ + __builtin_tgmath (f_d32, f_d64, f_d128, f); /* { dg-error "binary argument 1 to decimal-only type-generic function" } */ + __builtin_tgmath (f_cfcf, f_d32d32, d32, cf); /* { dg-error "both complex and decimal floating-point arguments to type-generic function" } */ + __builtin_tgmath (f_ff, f_d32d32, d32, f); /* { dg-error "both binary and decimal floating-point arguments to type-generic function" } */ +} diff --git a/gcc/testsuite/gcc.dg/dfp/builtin-tgmath-dfp.c b/gcc/testsuite/gcc.dg/dfp/builtin-tgmath-dfp.c new file mode 100644 index 00000000000..256a71e68be --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/builtin-tgmath-dfp.c @@ -0,0 +1,263 @@ +/* Test __builtin_tgmath: valid uses, decimal floating-point types. */ +/* { dg-do run } */ +/* { dg-options "" } */ + +extern void abort (void); +extern void exit (int); + +#define CHECK_CALL(C, E, V) \ + do \ + { \ + if ((C) != (E)) \ + abort (); \ + extern __typeof (C) V; \ + } \ + while (0) + +extern float var_f; +extern double var_d; +extern long double var_ld; +extern _Complex float var_cf; +extern _Complex double var_cd; +extern _Complex long double var_cld; +extern _Decimal32 var_d32; +extern _Decimal64 var_d64; +extern _Decimal128 var_d128; +extern int var_i; + +/* Test decimal-only function, single argument. */ + +_Decimal32 t1d32 (_Decimal32 x) { return x + 1; } +_Decimal64 t1d64 (_Decimal64 x) { return x + 2; } +_Decimal128 t1d128 (_Decimal128 x) { return x + 3; } + +#define t1v(x) __builtin_tgmath (t1d32, t1d64, t1d128, x) + +static void +test_1 (void) +{ + _Decimal32 d32 = 32; + _Decimal64 d64 = 64; + _Decimal128 d128 = 128; + int i = 256; + CHECK_CALL (t1v (d32), 33, var_d32); + CHECK_CALL (t1v (d64), 66, var_d64); + CHECK_CALL (t1v (d128), 131, var_d128); + CHECK_CALL (t1v (i), 258, var_d64); +} + +/* Test decimal-only function, two arguments. */ + +_Decimal32 t2d32 (_Decimal32 x, _Decimal32 y) { return 10 * x + y; } +_Decimal64 t2d64 (_Decimal64 x, _Decimal64 y) { return 100 * x + y;; } +_Decimal128 t2d128 (_Decimal128 x, _Decimal128 y) { return 1000 * x + y; } + +#define t2v(x, y) __builtin_tgmath (t2d32, t2d64, t2d128, x, y) + +static void +test_2 (void) +{ + _Decimal32 d32 = 1; + _Decimal64 d64 = 2; + _Decimal128 d128 = 3; + int i = 4; + CHECK_CALL (t2v (d32, d32), 11, var_d32); + CHECK_CALL (t2v (d64, d64), 202, var_d64); + CHECK_CALL (t2v (d32, d64), 102, var_d64); + CHECK_CALL (t2v (d128, d64), 3002, var_d128); + CHECK_CALL (t2v (d128, i), 3004, var_d128); + CHECK_CALL (t2v (i, i), 404, var_d64); + CHECK_CALL (t2v (i, d32), 401, var_d64); +} + +/* Test real-only function, single argument. */ + +float t3f (float x) { return x + 1; } +double t3d (double x) { return x + 2; } +long double t3l (long double x) { return x + 3; } +_Decimal32 t3d32 (_Decimal32 x) { return x + 4; } +_Decimal64 t3d64 (_Decimal64 x) { return x + 5; } +_Decimal128 t3d128 (_Decimal128 x) { return x + 6; } + +#define t3v(x) __builtin_tgmath (t3f, t3d, t3l, t3d32, t3d64, t3d128, x) + +static void +test_3 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + int i = 4; + _Decimal32 d32 = 5; + _Decimal64 d64 = 6; + _Decimal128 d128 = 7; + CHECK_CALL (t3v (f), 2, var_f); + CHECK_CALL (t3v (d), 4, var_d); + CHECK_CALL (t3v (ld), 6, var_ld); + CHECK_CALL (t3v (i), 6, var_d); + CHECK_CALL (t3v (d32), 9, var_d32); + CHECK_CALL (t3v (d64), 11, var_d64); + CHECK_CALL (t3v (d128), 13, var_d128); +} + +/* Test real-and-complex function, single argument. */ + +float t4f (float x) { return x + 1; } +double t4d (double x) { return x + 2; } +long double t4l (long double x) { return x + 3; } +_Complex float t4cf (_Complex float x) { return x + 4; } +_Complex double t4cd (_Complex double x) { return x + 5; } +_Complex long double t4cl (_Complex long double x) { return x + 6; } +_Decimal32 t4d32 (_Decimal32 x) { return x + 7; } +_Decimal64 t4d64 (_Decimal64 x) { return x + 8; } +_Decimal128 t4d128 (_Decimal128 x) { return x + 9; } + +#define t4v(x) __builtin_tgmath (t4f, t4d, t4l, t4cf, t4cd, t4cl, t4d32, t4d64, t4d128, x) + +static void +test_4 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + int i = 4; + _Complex float cf = 5; + _Complex double cd = 6; + _Complex long double cld = 7; + _Complex int ci = 8; + _Decimal32 d32 = 9; + _Decimal64 d64 = 10; + _Decimal128 d128 = 11; + CHECK_CALL (t4v (f), 2, var_f); + CHECK_CALL (t4v (d), 4, var_d); + CHECK_CALL (t4v (ld), 6, var_ld); + CHECK_CALL (t4v (i), 6, var_d); + CHECK_CALL (t4v (cf), 9, var_cf); + CHECK_CALL (t4v (cd), 11, var_cd); + CHECK_CALL (t4v (cld), 13, var_cld); + CHECK_CALL (t4v (ci), 13, var_cd); + CHECK_CALL (t4v (d32), 16, var_d32); + CHECK_CALL (t4v (d64), 18, var_d64); + CHECK_CALL (t4v (d128), 20, var_d128); +} + +/* Test real-and-complex function, real return type, single argument. */ + +float t5f (float x) { return x + 1; } +double t5d (double x) { return x + 2; } +long double t5l (long double x) { return x + 3; } +float t5cf (_Complex float x) { return __real__ x + 4; } +double t5cd (_Complex double x) { return __real__ x + 5; } +long double t5cl (_Complex long double x) { return __real__ x + 6; } +_Decimal32 t5d32 (_Decimal32 x) { return x + 7; } +_Decimal64 t5d64 (_Decimal64 x) { return x + 8; } +_Decimal128 t5d128 (_Decimal128 x) { return x + 9; } + +#define t5v(x) __builtin_tgmath (t5f, t5d, t5l, t5cf, t5cd, t5cl, t5d32, t5d64, t5d128, x) + +static void +test_5 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + int i = 4; + _Complex float cf = 5; + _Complex double cd = 6; + _Complex long double cld = 7; + _Complex int ci = 8; + _Decimal32 d32 = 9; + _Decimal64 d64 = 10; + _Decimal128 d128 = 11; + CHECK_CALL (t5v (f), 2, var_f); + CHECK_CALL (t5v (d), 4, var_d); + CHECK_CALL (t5v (ld), 6, var_ld); + CHECK_CALL (t5v (i), 6, var_d); + CHECK_CALL (t5v (cf), 9, var_f); + CHECK_CALL (t5v (cd), 11, var_d); + CHECK_CALL (t5v (cld), 13, var_ld); + CHECK_CALL (t5v (ci), 13, var_d); + CHECK_CALL (t5v (d32), 16, var_d32); + CHECK_CALL (t5v (d64), 18, var_d64); + CHECK_CALL (t5v (d128), 20, var_d128); +} + +/* Test real-and-complex function, two arguments. */ + +float t6f (float x, float y) { return x * 10 + y; } +double t6d (double x, double y) { return x * 100 + y; } +long double t6l (long double x, long double y) { return x * 1000 + y; } +_Complex float t6cf (_Complex float x, _Complex float y) { return x * 10000 + y; } +_Complex double t6cd (_Complex double x, _Complex double y) { return x * 100000 + y; } +_Complex long double t6cl (_Complex long double x, _Complex long double y) { return x * 1000000 + y; } +_Decimal32 t6d32 (_Decimal32 x, _Decimal32 y) { return x * 50 + y; } +_Decimal64 t6d64 (_Decimal64 x, _Decimal64 y) { return x * 500 + y; } +_Decimal128 t6d128 (_Decimal128 x, _Decimal128 y) { return x * 5000 + y; } + +#define t6v(x, y) __builtin_tgmath (t6f, t6d, t6l, t6cf, t6cd, t6cl, t6d32, t6d64, t6d128, x, y) + +static void +test_6 (void) +{ + float f = 1; + double d = 2; + long double ld = 3; + int i = 4; + _Complex float cf = 5; + _Complex double cd = 6; + _Complex long double cld = 7; + _Complex int ci = 8; + _Decimal32 d32 = 9; + _Decimal64 d64 = 10; + _Decimal128 d128 = 11; + CHECK_CALL (t6v (f, f), 11, var_f); + CHECK_CALL (t6v (d, f), 201, var_d); + CHECK_CALL (t6v (f, d), 102, var_d); + CHECK_CALL (t6v (f, i), 104, var_d); + CHECK_CALL (t6v (ld, f), 3001, var_ld); + CHECK_CALL (t6v (i, ld), 4003, var_ld); + CHECK_CALL (t6v (i, i), 404, var_d); + CHECK_CALL (t6v (cf, f), 50001, var_cf); + CHECK_CALL (t6v (cf, cf), 50005, var_cf); + CHECK_CALL (t6v (cd, cf), 600005, var_cd); + CHECK_CALL (t6v (d, cld), 2000007, var_cld); + CHECK_CALL (t6v (ci, ci), 800008, var_cd); + CHECK_CALL (t6v (ci, f), 800001, var_cd); + CHECK_CALL (t6v (d32, d32), 459, var_d32); + CHECK_CALL (t6v (d64, i), 5004, var_d64); + CHECK_CALL (t6v (i, d32), 2009, var_d64); + CHECK_CALL (t6v (d128, d32), 55009, var_d128); +} + +/* Test decimal-only function rounding result to narrower type. */ + +_Decimal32 t7d64 (_Decimal64 x) { return 1 + x; } +_Decimal32 t7d128 (_Decimal128 x) { return 2 + x; } + +#define t7v(x) __builtin_tgmath (t7d64, t7d128, x) + +static void +test_7 (void) +{ + _Decimal32 d32 = 1; + _Decimal64 d64 = 2; + _Decimal128 d128 = 3; + short s = 4; + CHECK_CALL (t7v (d32), 2, var_d32); + CHECK_CALL (t7v (d64), 3, var_d32); + CHECK_CALL (t7v (d128), 5, var_d32); + CHECK_CALL (t7v (s), 5, var_d32); +} + +int +main (void) +{ + test_1 (); + test_2 (); + test_3 (); + test_4 (); + test_5 (); + test_6 (); + test_7 (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/div_neg.c b/gcc/testsuite/gcc.dg/div_neg.c new file mode 100644 index 00000000000..da499cda2fb --- /dev/null +++ b/gcc/testsuite/gcc.dg/div_neg.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +float +div_neg (float x, float y) +{ + return (-x / y) * (x / -y); +} + +/* { dg-final { scan-tree-dump-times " / " 1 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/empty-source-2.c b/gcc/testsuite/gcc.dg/empty-source-2.c index ae36159b5af..e0180ec9475 100644 --- a/gcc/testsuite/gcc.dg/empty-source-2.c +++ b/gcc/testsuite/gcc.dg/empty-source-2.c @@ -3,4 +3,4 @@ /* { dg-do compile } */ /* { dg-options "-pedantic" } */ -/* { dg-warning "ISO C forbids an empty translation unit" "empty" } */ +/* { dg-warning "-:ISO C forbids an empty translation unit" "empty" } */ diff --git a/gcc/testsuite/gcc.dg/empty-source-3.c b/gcc/testsuite/gcc.dg/empty-source-3.c index bcd76ac2905..f8c58b3ef3f 100644 --- a/gcc/testsuite/gcc.dg/empty-source-3.c +++ b/gcc/testsuite/gcc.dg/empty-source-3.c @@ -4,4 +4,4 @@ /* { dg-do compile } */ /* { dg-options "-pedantic-errors" } */ -/* { dg-error "ISO C forbids an empty translation unit" "empty" } */ +/* { dg-error "-:ISO C forbids an empty translation unit" "empty" } */ diff --git a/gcc/testsuite/gcc.dg/gomp/macro-4.c b/gcc/testsuite/gcc.dg/gomp/macro-4.c index 7d20f4cd68d..28d198b1ce3 100644 --- a/gcc/testsuite/gcc.dg/gomp/macro-4.c +++ b/gcc/testsuite/gcc.dg/gomp/macro-4.c @@ -10,9 +10,9 @@ void bar (void); void foo (void) { -#pragma omp p /* { dg-warning "ignoring #pragma omp _Pragma" } */ +#pragma omp p /* { dg-warning "-:ignoring #pragma omp _Pragma" } */ bar (); - omp_p /* { dg-warning "ignoring #pragma omp _Pragma" } */ + omp_p /* { dg-warning "-:ignoring #pragma omp _Pragma" } */ bar (); } @@ -22,8 +22,8 @@ foo (void) void baz (void) { -#pragma omp parallel /* { dg-warning "ignoring #pragma omp serial" } */ +#pragma omp parallel /* { dg-warning "-:ignoring #pragma omp serial" } */ bar (); - omp_parallel /* { dg-warning "ignoring #pragma omp serial" } */ + omp_parallel /* { dg-warning "-:ignoring #pragma omp serial" } */ bar (); } diff --git a/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c b/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c index 9c31e9bb617..b9bbb733fae 100644 --- a/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c @@ -4,4 +4,4 @@ void foo() { ({ int i().; }); /* { dg-error "expected" } */ -} /* { dg-error "expected" } */ +} /* { dg-error "-:expected" } */ diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c index 7983c035862..1a80a668a0f 100644 --- a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c +++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c @@ -5,7 +5,7 @@ numbers are available. */ /* Verify that we're in column-less mode. */ -extern unknown_type test; /* { dg-error "0: unknown type name" } */ +extern unknown_type test; /* { dg-error "-:unknown type name" } */ /* PR c++/68819: verify that -Wmisleading-indentation is suppressed. */ @@ -13,7 +13,7 @@ int fn_1 (int flag) { int x = 4, y = 5; - if (flag) x = 3; y = 2; /* { dg-message "disabled from this point" } */ + if (flag) x = 3; y = 2; /* { dg-message "-:disabled from this point" } */ return x * y; } diff --git a/gcc/testsuite/gcc.dg/pr20245-1.c b/gcc/testsuite/gcc.dg/pr20245-1.c index 51089c6e996..b5767d88b7b 100644 --- a/gcc/testsuite/gcc.dg/pr20245-1.c +++ b/gcc/testsuite/gcc.dg/pr20245-1.c @@ -2,4 +2,4 @@ /* { dg-do compile } */ /* { dg-options "" } */ -void foo() x; /* { dg-error "expected" } */ +void foo() x; /* { dg-error "-:expected" } */ diff --git a/gcc/testsuite/gcc.dg/pr28419.c b/gcc/testsuite/gcc.dg/pr28419.c index a1aa4bfe8db..9974864034b 100644 --- a/gcc/testsuite/gcc.dg/pr28419.c +++ b/gcc/testsuite/gcc.dg/pr28419.c @@ -1,3 +1,4 @@ /* { dg-do compile } */ void foo() const char* p = __FUNCTION__; /* { dg-error "" } */ +/* { dg-error "-:expected" "" } */ diff --git a/gcc/testsuite/gcc.dg/pr44545.c b/gcc/testsuite/gcc.dg/pr44545.c index 51983ef76b9..8058261f850 100644 --- a/gcc/testsuite/gcc.dg/pr44545.c +++ b/gcc/testsuite/gcc.dg/pr44545.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fnon-call-exceptions -ftrapv -fexceptions" } */ -int +void DrawChunk(int *tabSize, int x) { const int numEnds = 10; diff --git a/gcc/testsuite/gcc.dg/pr80131-1.c b/gcc/testsuite/gcc.dg/pr80131-1.c new file mode 100644 index 00000000000..0bfe1f4f3da --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr80131-1.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target int32plus } */ +/* { dg-options "-fdump-tree-gimple" } */ + +/* Checks the simplification of: + 1 << (C - x) to (1 << C) >> x, where C = precision (type) - 1 + f1 is not simplified but f2, f3 and f4 are. */ + +__INT64_TYPE__ f1 (__INT64_TYPE__ i) +{ + return (__INT64_TYPE__)1 << (31 - i); +} + +__INT64_TYPE__ f2 (__INT64_TYPE__ i) +{ + return (__INT64_TYPE__)1 << (63 - i); +} + +__UINT64_TYPE__ f3 (__INT64_TYPE__ i) +{ + return (__UINT64_TYPE__)1 << (63 - i); +} + +__INT32_TYPE__ f4 (__INT32_TYPE__ i) +{ + return (__INT32_TYPE__)1 << (31 - i); +} + +/* { dg-final { scan-tree-dump-times "= 31 -" 1 "gimple" } } */ +/* { dg-final { scan-tree-dump-times "9223372036854775808 >>" 2 "gimple" } } */ +/* { dg-final { scan-tree-dump "2147483648 >>" "gimple" } } */ diff --git a/gcc/testsuite/gcc.dg/pr82788.c b/gcc/testsuite/gcc.dg/pr82788.c new file mode 100644 index 00000000000..a8f628fd7f6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82788.c @@ -0,0 +1,4 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-probe-interval=10 --param stack-clash-protection-guard-size=12" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ +int main() { int a[1442]; return 0;} diff --git a/gcc/testsuite/gcc.dg/pr82863.c b/gcc/testsuite/gcc.dg/pr82863.c new file mode 100644 index 00000000000..b4028169a96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82863.c @@ -0,0 +1,12 @@ +/* PR c/82167 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef long long a; +a b; +float +c () +{ + float d = b > 0; + return d; +} diff --git a/gcc/testsuite/gcc.dg/pr82916.c b/gcc/testsuite/gcc.dg/pr82916.c new file mode 100644 index 00000000000..50e467f3244 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82916.c @@ -0,0 +1,47 @@ +/* PR bootstrap/82916 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-tree-dse" } */ + +struct A { struct A *next; }; +struct C +{ + int *of; + struct C *parent, *prev, *next; + int depth; + int min; + struct C *min_occ; +}; + +__attribute__((noipa)) struct C * +foo (int *node) +{ + struct A *p = __builtin_malloc (sizeof (struct C)); + if (!p) + return 0; + p->next = 0; + /* Originally placement new. */ + struct C *nw = (struct C *)(void *)p; + nw->of = node; + nw->parent = 0; + nw->prev = 0; + nw->next = 0; + nw->depth = 0; + nw->min_occ = nw; + nw->min = 0; + return nw; +} + +int +main () +{ + int o; + struct C *p = foo (&o); + if (p) + { + if (p->of != &o || p->parent || p->prev || p->next || p->depth + || p->min || p->min_occ != p) + __builtin_abort (); + } + __builtin_free (p); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr82929.c b/gcc/testsuite/gcc.dg/pr82929.c new file mode 100644 index 00000000000..afe9394ab31 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr82929.c @@ -0,0 +1,18 @@ +/* PR tree-optimization/82929 */ +/* { dg-do compile { target store_merge } } */ +/* { dg-options "-O2 -fdump-tree-store-merging" } */ + +void +foo (short *p, short *q, short *r) +{ + short a = q[0]; + short b = q[1]; + short c = ~a; + short d = r[0]; + short e = r[1]; + short f = ~b; + p[0] = c & d; + p[1] = e & f; +} + +/* { dg-final { scan-tree-dump-times "Merging successful" 1 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c b/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c index 4dd8214317b..fffb4d7011a 100644 --- a/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c +++ b/gcc/testsuite/gcc.dg/rtl/truncated-rtl-file.c @@ -1,2 +1,2 @@ void __RTL test (void) -{ /* { dg-error "no closing brace" } */ +{ /* { dg-error "-:no closing brace" } */ diff --git a/gcc/testsuite/gcc.dg/store_merging_13.c b/gcc/testsuite/gcc.dg/store_merging_13.c index d4e9ad2d260..6ee0a9c2c80 100644 --- a/gcc/testsuite/gcc.dg/store_merging_13.c +++ b/gcc/testsuite/gcc.dg/store_merging_13.c @@ -104,6 +104,90 @@ f6 (struct S *p, struct S *q) p->g = pg; } +__attribute__((noipa)) void +f7 (struct S *__restrict p, struct S *__restrict q) +{ + p->a |= q->a; + p->b |= q->b; + p->c |= q->c; + p->d |= q->d; + p->e |= q->e; + p->f |= q->f; + p->g |= q->g; +} + +__attribute__((noipa)) void +f8 (struct S *__restrict p, struct S *__restrict q) +{ + p->a &= q->a; + p->b &= q->b; + p->c &= q->c; + p->d &= q->d; + p->e &= q->e; + p->f &= q->f; + p->g &= q->g; +} + +__attribute__((noipa)) void +f9 (struct S *__restrict p, struct S *__restrict q) +{ + p->a ^= q->a; + p->b ^= q->b; + p->c ^= q->c; + p->d ^= q->d; + p->e ^= q->e; + p->f ^= q->f; + p->g ^= q->g; +} + +__attribute__((noipa)) void +f10 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = ~q->a; + p->b = ~q->b; + p->c = ~q->c; + p->d = ~q->d; + p->e = ~q->e; + p->f = ~q->f; + p->g = ~q->g; +} + +__attribute__((noipa)) void +f11 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = p->a | (unsigned char) ~q->a; + p->b = p->b | (unsigned char) ~q->b; + p->c = p->c | (unsigned short) ~q->c; + p->d = p->d | (unsigned char) ~q->d; + p->e = p->e | (unsigned char) ~q->e; + p->f = p->f | (unsigned char) ~q->f; + p->g = p->g | (unsigned char) ~q->g; +} + +__attribute__((noipa)) void +f12 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = p->a & (unsigned char) ~q->a; + p->b = p->b & (unsigned char) ~q->b; + p->c = p->c & (unsigned short) ~q->c; + p->d = p->d & (unsigned char) ~q->d; + p->e = p->e & (unsigned char) ~q->e; + p->f = p->f & (unsigned char) ~q->f; + p->g = p->g & (unsigned char) ~q->g; +} + +__attribute__((noipa)) void +f13 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = p->a ^ (unsigned char) ~q->a; + p->b = p->b ^ (unsigned char) ~q->b; + p->c = p->c ^ (unsigned short) ~q->c; + p->d = p->d ^ (unsigned char) ~q->d; + p->e = p->e ^ (unsigned char) ~q->e; + p->f = p->f ^ (unsigned char) ~q->f; + p->g = p->g ^ (unsigned char) ~q->g; +} + struct S s = { 20, 21, 22, 23, 24, 25, 26, 27 }; struct S t = { 0x71, 0x72, 0x7f04, 0x78, 0x31, 0x32, 0x34, 0xf1f2f3f4f5f6f7f8ULL }; struct S u = { 28, 29, 30, 31, 32, 33, 34, 35 }; @@ -151,7 +235,62 @@ main () || s.e != (40 ^ 0x31) || s.f != (41 ^ 0x32) || s.g != (42 ^ 0x34) || s.h != 27) __builtin_abort (); + f3 (&s, &v); + f7 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (36 | 0x71) || s.b != (37 | 0x72) + || s.c != (38 | 0x7f04) || s.d != (39 | 0x78) + || s.e != (40 | 0x31) || s.f != (41 | 0x32) + || s.g != (42 | 0x34) || s.h != 27) + __builtin_abort (); + f3 (&s, &u); + f8 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (28 & 0x71) || s.b != (29 & 0x72) + || s.c != (30 & 0x7f04) || s.d != (31 & 0x78) + || s.e != (32 & 0x31) || s.f != (33 & 0x32) + || s.g != (34 & 0x34) || s.h != 27) + __builtin_abort (); + f2 (&s, &v); + f9 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (36 ^ 0x71) || s.b != (37 ^ 0x72) + || s.c != (38 ^ 0x7f04) || s.d != (39 ^ 0x78) + || s.e != (40 ^ 0x31) || s.f != (41 ^ 0x32) + || s.g != (42 ^ 0x34) || s.h != 27) + __builtin_abort (); + f10 (&s, &u); + asm volatile ("" : : : "memory"); + if (s.a != (unsigned char) ~28 || s.b != (unsigned char) ~29 + || s.c != (unsigned short) ~30 || s.d != (unsigned char) ~31 + || s.e != (unsigned char) ~32 || s.f != (unsigned char) ~33 + || s.g != (unsigned char) ~34 || s.h != 27) + __builtin_abort (); + f3 (&s, &v); + f11 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (36 | (unsigned char) ~0x71) || s.b != (37 | (unsigned char) ~0x72) + || s.c != (38 | (unsigned short) ~0x7f04) || s.d != (39 | (unsigned char) ~0x78) + || s.e != (40 | (unsigned char) ~0x31) || s.f != (41 | (unsigned char) ~0x32) + || s.g != (42 | (unsigned char) ~0x34) || s.h != 27) + __builtin_abort (); + f3 (&s, &u); + f12 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (28 & (unsigned char) ~0x71) || s.b != (29 & (unsigned char) ~0x72) + || s.c != (30 & (unsigned short) ~0x7f04) || s.d != (31 & (unsigned char) ~0x78) + || s.e != (32 & (unsigned char) ~0x31) || s.f != (33 & (unsigned char) ~0x32) + || s.g != (34 & (unsigned char) ~0x34) || s.h != 27) + __builtin_abort (); + f2 (&s, &v); + f13 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.a != (36 ^ (unsigned char) ~0x71) || s.b != (37 ^ (unsigned char) ~0x72) + || s.c != (38 ^ (unsigned short) ~0x7f04) || s.d != (39 ^ (unsigned char) ~0x78) + || s.e != (40 ^ (unsigned char) ~0x31) || s.f != (41 ^ (unsigned char) ~0x32) + || s.g != (42 ^ (unsigned char) ~0x34) || s.h != 27) + __builtin_abort (); return 0; } -/* { dg-final { scan-tree-dump-times "Merging successful" 6 "store-merging" } } */ +/* { dg-final { scan-tree-dump-times "Merging successful" 13 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/store_merging_14.c b/gcc/testsuite/gcc.dg/store_merging_14.c index 49af24951cb..3885acb10a2 100644 --- a/gcc/testsuite/gcc.dg/store_merging_14.c +++ b/gcc/testsuite/gcc.dg/store_merging_14.c @@ -104,6 +104,42 @@ f6 (struct S *p, struct S *q) p->g = pg; } +__attribute__((noipa)) void +f7 (struct S *__restrict p, struct S *__restrict q) +{ + p->a |= q->a; + p->b |= q->b; + p->c |= q->c; + p->d |= q->d; + p->e |= q->e; + p->f |= q->f; + p->g |= q->g; +} + +__attribute__((noipa)) void +f8 (struct S *__restrict p, struct S *__restrict q) +{ + p->a &= q->a; + p->b &= q->b; + p->c &= q->c; + p->d &= q->d; + p->e &= q->e; + p->f &= q->f; + p->g &= q->g; +} + +__attribute__((noipa)) void +f9 (struct S *__restrict p, struct S *__restrict q) +{ + p->a ^= q->a; + p->b ^= q->b; + p->c ^= q->c; + p->d ^= q->d; + p->e ^= q->e; + p->f ^= q->f; + p->g ^= q->g; +} + struct S s = { 72, 20, 21, 73, 22, 23, 24, 25, 26, 74, 27 }; struct S t = { 75, 0x71, 0x72, 76, 0x7f04, 0x78, 0x31, 0x32, 0x34, 77, 0xf1f2f3f4f5f6f7f8ULL }; struct S u = { 78, 28, 29, 79, 30, 31, 32, 33, 34, 80, 35 }; @@ -151,7 +187,31 @@ main () || s.e != (40 ^ 0x31) || s.f != (41 ^ 0x32) || s.g != (42 ^ 0x34) || s.k != 74 || s.h != 27) __builtin_abort (); + f3 (&s, &v); + f7 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != (36 | 0x71) || s.b != (37 | 0x72) || s.j != 73 + || s.c != (38 | 0x7f04) || s.d != (39 | 0x78) + || s.e != (40 | 0x31) || s.f != (41 | 0x32) + || s.g != (42 | 0x34) || s.k != 74 || s.h != 27) + __builtin_abort (); + f3 (&s, &u); + f8 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != (28 & 0x71) || s.b != (29 & 0x72) || s.j != 73 + || s.c != (30 & 0x7f04) || s.d != (31 & 0x78) + || s.e != (32 & 0x31) || s.f != (33 & 0x32) + || s.g != (34 & 0x34) || s.k != 74 || s.h != 27) + __builtin_abort (); + f2 (&s, &v); + f9 (&s, &t); + asm volatile ("" : : : "memory"); + if (s.i != 72 || s.a != (36 ^ 0x71) || s.b != (37 ^ 0x72) || s.j != 73 + || s.c != (38 ^ 0x7f04) || s.d != (39 ^ 0x78) + || s.e != (40 ^ 0x31) || s.f != (41 ^ 0x32) + || s.g != (42 ^ 0x34) || s.k != 74 || s.h != 27) + __builtin_abort (); return 0; } -/* { dg-final { scan-tree-dump-times "Merging successful" 6 "store-merging" } } */ +/* { dg-final { scan-tree-dump-times "Merging successful" 9 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/store_merging_15.c b/gcc/testsuite/gcc.dg/store_merging_15.c new file mode 100644 index 00000000000..57075ebea28 --- /dev/null +++ b/gcc/testsuite/gcc.dg/store_merging_15.c @@ -0,0 +1,56 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target store_merge } */ +/* { dg-options "-O2 -fdump-tree-store-merging" } */ + +struct S { unsigned char a, b; unsigned short c; unsigned char d, e, f, g; unsigned long long h; }; + +__attribute__((noipa)) void +f1 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = ~q->a; + p->b = q->b; + p->c = ~q->c; + p->d = ~q->d; + p->e = q->e; + p->f = ~q->f; + p->g = ~q->g; +} + +__attribute__((noipa)) void +f2 (struct S *__restrict p, struct S *__restrict q) +{ + p->a = ~(unsigned char) (p->a & q->a); + p->b = ((unsigned char) ~p->b) & q->b; + p->c = p->c & (unsigned short) ~q->c; + p->d = p->d & q->d; + p->e = p->e & (unsigned char) ~q->e; + p->f = p->f & (unsigned char) ~q->f; + p->g = ~(unsigned char) (p->g & q->g); +} + +struct S s = { 20, 21, 22, 23, 24, 25, 26, 27 }; +struct S u = { 28, 29, 30, 31, 32, 33, 34, 35 }; +struct S v = { 36, 37, 38, 39, 40, 41, 42, 43 }; + +int +main () +{ + asm volatile ("" : : : "memory"); + f1 (&s, &u); + asm volatile ("" : : : "memory"); + if (s.a != (unsigned char) ~28 || s.b != 29 + || s.c != (unsigned short) ~30 || s.d != (unsigned char) ~31 + || s.e != 32 || s.f != (unsigned char) ~33 || s.g != (unsigned char) ~34 + || s.h != 27) + __builtin_abort (); + f2 (&u, &v); + asm volatile ("" : : : "memory"); + if (u.a != (unsigned char) ~(28 & 36) || u.b != (((unsigned char) ~29) & 37) + || u.c != (30 & (unsigned short) ~38) || u.d != (31 & 39) + || u.e != (32 & (unsigned char) ~40) || u.f != (33 & (unsigned char) ~41) + || u.g != (unsigned char) ~(34 & 42) || u.h != 35) + __builtin_abort (); + return 0; +} + +/* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-33g.c b/gcc/testsuite/gcc.dg/strlenopt-33g.c index 0223f82f1d1..7d24d2bfc32 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-33g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-33g.c @@ -1,5 +1,4 @@ /* { dg-do run { target *-*-linux* *-*-gnu* } } */ -/* { dg-do run } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strncpy-fix-1.c b/gcc/testsuite/gcc.dg/strncpy-fix-1.c index b8bc916e008..b4fd4aa4877 100644 --- a/gcc/testsuite/gcc.dg/strncpy-fix-1.c +++ b/gcc/testsuite/gcc.dg/strncpy-fix-1.c @@ -1,7 +1,7 @@ /* Test that use of strncpy does not result in a "value computed is not used" warning. */ /* { dg-do compile } */ -/* { dg-options "-O2 -Wall" } */ +/* { dg-options "-O2 -Wall -Wno-stringop-truncation" } */ #include <string.h> void diff --git a/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c b/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c index f9bc57c4e86..cd9dc72decb 100644 --- a/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c +++ b/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c @@ -1,6 +1,6 @@ /* Test -Wsizeof-pointer-memaccess warnings. */ /* { dg-do compile } */ -/* { dg-options "-Wall -Wno-sizeof-array-argument -Wno-stringop-overflow" } */ +/* { dg-options "-Wall -Wno-sizeof-array-argument -Wno-stringop-overflow -Wno-stringop-truncation" } */ /* Test just twice, once with -O0 non-fortified, once with -O2 fortified. */ /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } } */ /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ @@ -704,12 +704,17 @@ f4 (char *x, char **y, int z, char w[64]) strncat (w, s2, sizeof (w)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */ stpncpy (w, s1, sizeof (w)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */ - /* These are correct, no warning. */ + /* These are pointless when the destination is large enough, and + cause overflow otherwise. If the copies are guaranteed to be + safe the calls might as well be replaced by strcat(), strcpy(), + or memcpy(). */ const char s3[] = "foobarbaz"; const char s4[] = "abcde12345678"; - strncpy (x, s3, sizeof (s3)); - strncat (x, s4, sizeof (s4)); - stpncpy (x, s3, sizeof (s3)); + strncpy (x, s3, sizeof (s3)); /* { dg-warning "call is the same expression as the source; did you mean to use the size of the destination?" } */ + strncat (x, s4, sizeof (s4)); /* { dg-warning "call is the same expression as the source; did you mean to use the size of the destination?" } */ + stpncpy (x, s3, sizeof (s3)); /* { dg-warning "call is the same expression as the source; did you mean to use the size of the destination?" } */ + + /* These are correct, no warning. */ y[1] = strndup (s3, sizeof (s3)); z += strncmp (s3, s4, sizeof (s3)); z += strncmp (s3, s4, sizeof (s4)); diff --git a/gcc/testsuite/gcc.dg/torture/pr60092.c b/gcc/testsuite/gcc.dg/torture/pr60092.c index c23516c73b4..74e7c174a83 100644 --- a/gcc/testsuite/gcc.dg/torture/pr60092.c +++ b/gcc/testsuite/gcc.dg/torture/pr60092.c @@ -4,7 +4,6 @@ /* { dg-skip-if "No undefined weak" { nvptx-*-* } } */ /* { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */ /* { dg-additional-options "-Wl,-flat_namespace" { target *-*-darwin[89]* } } */ -/* { dg-xfail-run-if "posix_memalign modifies first arg on error" { *-*-solaris2.11* } { "-O0" } } */ typedef __SIZE_TYPE__ size_t; extern int posix_memalign(void **memptr, size_t alignment, size_t size) __attribute__((weak)); diff --git a/gcc/testsuite/gcc.dg/torture/pr63554.c b/gcc/testsuite/gcc.dg/torture/pr63554.c index fa06c5a55d1..9162266da2c 100644 --- a/gcc/testsuite/gcc.dg/torture/pr63554.c +++ b/gcc/testsuite/gcc.dg/torture/pr63554.c @@ -1,4 +1,5 @@ -/* { dg-do compile } */ +/* PR c/63554 - ice in "execute_todo, at passes.c:1797" with -O3 + { dg-do compile } */ char *a; void @@ -7,3 +8,5 @@ nssutil_ReadSecmodDB (void) long b = __builtin_object_size (0, 0); a = __builtin___strncat_chk (a, " ", 1, b); } + +/* { dg-prune-output "\\\[-Wstringop-overflow=]" } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr78305.c b/gcc/testsuite/gcc.dg/torture/pr78305.c index ccb8c6faa78..36d3620179e 100644 --- a/gcc/testsuite/gcc.dg/torture/pr78305.c +++ b/gcc/testsuite/gcc.dg/torture/pr78305.c @@ -1,5 +1,5 @@ -/* { dg-require-effective-target int32plus } */ /* { dg-do run } */ +/* { dg-require-effective-target int32plus } */ int main () { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bitops-1.c b/gcc/testsuite/gcc.dg/tree-ssa/bitops-1.c new file mode 100644 index 00000000000..cf2823deb62 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/bitops-1.c @@ -0,0 +1,72 @@ +/* { dg-do run } */ +/* { dg-options "-O -fdump-tree-optimized-raw" } */ + +#define DECLS(n,VOL) \ +__attribute__((noinline,noclone)) \ +int f##n(int A,int B){ \ + VOL int C = A & ~B; \ + VOL int D = A ^ B; \ + return C | D; \ +} \ +__attribute__((noinline,noclone)) \ +int g##n(int A,int B){ \ + VOL int C = A & ~B; \ + return C ^ ~A; \ +} \ +__attribute__((noinline,noclone)) \ +int h##n(int A,int B){ \ + VOL int C = A | B; \ + VOL int D = A ^ B; \ + return C & ~D; \ +} \ +__attribute__((noinline,noclone)) \ +int i##n(int A,int B){ \ + VOL int C = A ^ B; \ + return A | ~C; \ +} \ +__attribute__((noinline,noclone)) \ +int J##n(int A,int B){ \ + VOL int C = A | B; \ + VOL int D = A & B; \ + return C | D; \ +} \ +__attribute__((noinline,noclone)) \ +int k##n(int A,int B){ \ + VOL int C = A & B; \ + VOL int D = A ^ B; \ + return C | ~D; \ +} \ +__attribute__((noinline,noclone)) \ +int l##n(int A,int B){ \ + VOL int C = A & ~B; \ + return ~C; \ +} \ +__attribute__((noinline,noclone)) \ +int m##n(int A,int B){ \ + VOL int C = A & B; \ + VOL int D = A ^ B; \ + return C ^ D; \ +} + +DECLS(0,) +DECLS(1,volatile) + +int main(){ + for(int A = 0; A <= 1; ++A) + for(int B = 0; B <= 1; ++B) + { + if (f0 (A, B) != f1 (A, B)) __builtin_abort(); + if (g0 (A, B) != g1 (A, B)) __builtin_abort(); + if (h0 (A, B) != h1 (A, B)) __builtin_abort(); + if (i0 (A, B) != i1 (A, B)) __builtin_abort(); + if (J0 (A, B) != J1 (A, B)) __builtin_abort(); + if (k0 (A, B) != k1 (A, B)) __builtin_abort(); + if (l0 (A, B) != l1 (A, B)) __builtin_abort(); + if (m0 (A, B) != m1 (A, B)) __builtin_abort(); + } +} + +/* { dg-final { scan-tree-dump-times "bit_not_expr" 12 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "bit_and_expr" 9 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "bit_ior_expr" 10 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "bit_xor_expr" 9 "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c b/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c index ad5fc101cd8..1b9696dcb11 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c @@ -19,4 +19,5 @@ main(void) return 0; } /* { dg-final { scan-tree-dump-times "Splitting function at:" 1 "fnsplit"} } */ +/* { dg-final { scan-tree-dump-times "Invalid sum" 0 "fnsplit"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-2.c b/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-2.c new file mode 100644 index 00000000000..c00213cc182 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-2.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-fnsplit-blocks-details" } */ +void q (void); +int b; +void test (void); +void +split_me (int *a) +{ + if (__builtin_expect (a==0, 0)) + do + { + test(); + test(); + test(); + test(); + test(); + } + while (b); + else + q(); +} + +int +main(void) +{ + int i; + for (i = 0; i < 1000; i++) + split_me(&i); + return 0; +} + +/* { dg-final { scan-tree-dump-times "Splitting function at:" 1 "fnsplit"} } */ +/* { dg-final { scan-tree-dump-times "Invalid sum" 0 "fnsplit"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/negminus.c b/gcc/testsuite/gcc.dg/tree-ssa/negminus.c new file mode 100644 index 00000000000..f857a007983 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/negminus.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fno-rounding-math -fno-signed-zeros -fdump-tree-optimized-raw" } */ + +double f(double a, double b){ + double c = a - b; + return -c; +} + +int g(unsigned x){ + unsigned y = ~x; + int z = (int) y; + return -z; +} + +unsigned h(unsigned a, unsigned b, unsigned c){ + unsigned d = b - c; + unsigned e = a + d; + return -e; +} + +/* { dg-final { scan-tree-dump-not "negate_expr" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr82726.c b/gcc/testsuite/gcc.dg/tree-ssa/pr82726.c new file mode 100644 index 00000000000..22bc59dacc8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82726.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 --param tree-reassoc-width=4" } */ +/* { dg-additional-options "-mavx2" { target { x86_64-*-* i?86-*-* } } } */ + +#define N 40 +#define M 128 +unsigned int in[N+M]; +unsigned short out[N]; + +/* Outer-loop vectorization. */ + +void +foo (){ + int i,j; + unsigned int diff; + + for (i = 0; i < N; i++) { + diff = 0; + for (j = 0; j < M; j+=8) { + diff += in[j+i]; + } + out[i]=(unsigned short)diff; + } + + return; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c index aad41f91f47..95b4d2b05a8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp101.c @@ -10,4 +10,4 @@ int main () return 0; } -/* { dg-final { scan-tree-dump "<bb 2> \\\[\[0-9.\]+%\\\] \\\[count: \[0-9INV\]*\\\]:\[\n\r \]*return 0;" "optimized" { xfail aarch64*-*-* } } } */ +/* { dg-final { scan-tree-dump "<bb 2> \\\[local count: \[0-9INV\]*\\\]:\[\n\r \]*return 0;" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/unclosed-init.c b/gcc/testsuite/gcc.dg/unclosed-init.c index c0e4dd8da9b..3deb88e777c 100644 --- a/gcc/testsuite/gcc.dg/unclosed-init.c +++ b/gcc/testsuite/gcc.dg/unclosed-init.c @@ -1,3 +1,3 @@ int unclosed[] = { /* { dg-message "18: to match this '.'" } */ 42 - /* { dg-error "0: expected '.' at end of input" } */ + /* { dg-error "-: expected '.' at end of input" } */ diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c index e78dc46611e..0e4f1a71b6b 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c @@ -59,6 +59,4 @@ int main() /* We should also be able to use 2-lane SLP to initialize the real and imaginary components in the first loop of main. */ -/* For targets with gather/scatter we can vectorize the unrolled loop - directly, before SLP runs. That's probably a pessimisation though. */ -/* { dg-final { scan-tree-dump-times "basic block vectorized" 2 "slp1" { xfail vect_gather_scatter } } } */ +/* { dg-final { scan-tree-dump-times "basic block vectorized" 2 "slp1" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c index 99ecb793973..7c7acd5bab6 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c @@ -18,5 +18,4 @@ foo (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* Requires VF <= 4. */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail { aarch64_sve && { ! vect256 } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c b/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c index a9a8b864e66..6c97e5f9c12 100644 --- a/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c +++ b/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c @@ -34,4 +34,4 @@ int main (void) } /* Requires fast-math. */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_ieee_add_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_fold_left_plus } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr25413a.c b/gcc/testsuite/gcc.dg/vect/pr25413a.c index a80ca868112..e444b2c3e8e 100644 --- a/gcc/testsuite/gcc.dg/vect/pr25413a.c +++ b/gcc/testsuite/gcc.dg/vect/pr25413a.c @@ -123,6 +123,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_scatter_store } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_scatter_store } } } */ /* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr45752.c b/gcc/testsuite/gcc.dg/vect/pr45752.c index 755205b275a..4ddac7ad509 100644 --- a/gcc/testsuite/gcc.dg/vect/pr45752.c +++ b/gcc/testsuite/gcc.dg/vect/pr45752.c @@ -158,4 +158,4 @@ int main (int argc, const char* argv[]) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "gaps requires scalar epilogue loop" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { vect_gather_scatter && { ! vect_perm5_int } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-1.c b/gcc/testsuite/gcc.dg/vect/pr65947-1.c index bb886137dfd..bf6c098b3ee 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-1.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-1.c @@ -41,4 +41,4 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction" 4 "vect" } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction" 4 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-10.c b/gcc/testsuite/gcc.dg/vect/pr65947-10.c index 6016cefc6a1..b58b3456bd4 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-10.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-10.c @@ -42,6 +42,6 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-12.c b/gcc/testsuite/gcc.dg/vect/pr65947-12.c index 973105cc251..1c959e16ab8 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-12.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-12.c @@ -42,5 +42,5 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-13.c b/gcc/testsuite/gcc.dg/vect/pr65947-13.c index f0735072df0..fc88cbe6227 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-13.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-13.c @@ -42,5 +42,5 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-14.c b/gcc/testsuite/gcc.dg/vect/pr65947-14.c index c118f2a1b6e..194e40f280e 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-14.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-14.c @@ -1,4 +1,3 @@ -/* { dg-do run { xfail { ! vect_last_reduc } } } */ /* { dg-require-effective-target vect_condition } */ #include "tree-vect.h" @@ -42,5 +41,5 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction based on integer induction" 4 "vect" { target { ! vect_last_reduc } } } }*/ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction based on integer induction" 4 "vect" { target { ! vect_fold_extract_last } } } }*/ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-2.c b/gcc/testsuite/gcc.dg/vect/pr65947-2.c index 0dbf9e5622b..569da87ceaa 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-2.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-2.c @@ -42,5 +42,5 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-3.c b/gcc/testsuite/gcc.dg/vect/pr65947-3.c index ba5b9c2c76a..05c266686b0 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-3.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-3.c @@ -52,5 +52,5 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-4.c b/gcc/testsuite/gcc.dg/vect/pr65947-4.c index a6f92d9757c..0fa50cef31f 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-4.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-4.c @@ -41,5 +41,5 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction" 4 "vect" } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction" 4 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-5.c b/gcc/testsuite/gcc.dg/vect/pr65947-5.c index 709f17f80a4..15f5ea8d8fa 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-5.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-5.c @@ -50,8 +50,8 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" { target { ! vect_last_reduc } } } } */ -/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump "loop size is greater than data size" "vect" { xfail vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" { target { ! vect_fold_extract_last } } } } */ +/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump "loop size is greater than data size" "vect" { xfail vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-6.c b/gcc/testsuite/gcc.dg/vect/pr65947-6.c index 7a93326582b..1c760366e71 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-6.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-6.c @@ -41,5 +41,5 @@ main (void) } /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 4 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-9.c b/gcc/testsuite/gcc.dg/vect/pr65947-9.c index 8ef154d1751..49dc7cb9ed2 100644 --- a/gcc/testsuite/gcc.dg/vect/pr65947-9.c +++ b/gcc/testsuite/gcc.dg/vect/pr65947-9.c @@ -45,8 +45,8 @@ main () return 0; } -/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_last_reduc } } } } */ -/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump "loop size is greater than data size" "vect" { target { ! vect_last_reduc } } } } */ -/* { dg-final { scan-tree-dump-times "Optimizing condition reduction with CLASTB" 2 "vect" { target vect_last_reduc } } } */ -/* { dg-final { scan-tree-dump-not "Optimizing condition reduction" "vect" { target { ! vect_last_reduc } } } } */ +/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { ! vect_fold_extract_last } } } } */ +/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump "loop size is greater than data size" "vect" { target { ! vect_fold_extract_last } } } } */ +/* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 2 "vect" { target vect_fold_extract_last } } } */ +/* { dg-final { scan-tree-dump-not "optimizing condition reduction" "vect" { target { ! vect_fold_extract_last } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr79920.c b/gcc/testsuite/gcc.dg/vect/pr79920.c index b2640e83091..3ad68788f0a 100644 --- a/gcc/testsuite/gcc.dg/vect/pr79920.c +++ b/gcc/testsuite/gcc.dg/vect/pr79920.c @@ -41,5 +41,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_double && { ! vect_ieee_add_reduc } } && { vect_perm && vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_double && vect_ieee_add_reduc } && { vect_perm && vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_double && { ! vect_fold_left_plus } } && { vect_perm && vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_double && vect_fold_left_plus } && { vect_perm && vect_hw_misalign } } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c b/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c index b553b61cc5a..a16656ace00 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c +++ b/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c @@ -131,8 +131,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && { { ! vect_pack_trunc } && { ! vect_gather_scatter } } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_gather_scatter } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && { ! vect_pack_trunc } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { ! vect_pack_trunc } } } } */ /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && vect_pack_trunc } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_pack_trunc xfail vect_variable_length } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-13.c b/gcc/testsuite/gcc.dg/vect/slp-13.c index 57dc28bafe3..8769d62cfd4 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-13.c +++ b/gcc/testsuite/gcc.dg/vect/slp-13.c @@ -125,8 +125,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && { { ! vect_pack_trunc } && { ! vect_gather_scatter } } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_gather_scatter } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && { ! vect_pack_trunc } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { ! vect_pack_trunc } } } } */ /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && vect_pack_trunc } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_pack_trunc xfail vect_variable_length } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-16.c b/gcc/testsuite/gcc.dg/vect/slp-16.c index a19deb92552..a7da9932c54 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-16.c +++ b/gcc/testsuite/gcc.dg/vect/slp-16.c @@ -66,5 +66,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_int_mult } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_int_mult xfail { vect_variable_length && vect_gather_scatter } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_int_mult } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-19c.c b/gcc/testsuite/gcc.dg/vect/slp-19c.c index cda6a096332..32566cb5e13 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-19c.c +++ b/gcc/testsuite/gcc.dg/vect/slp-19c.c @@ -103,7 +103,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_gather } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_gather } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_gather } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_gather } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-23.c b/gcc/testsuite/gcc.dg/vect/slp-23.c index 88708e645d6..3cda497db0c 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-23.c +++ b/gcc/testsuite/gcc.dg/vect/slp-23.c @@ -109,6 +109,6 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided8 || vect_no_align } } } } } */ /* We fail to vectorize the second loop with variable-length SVE but fall back to 128-bit vectors, which does use SLP. */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_perm } xfail aarch64_sve } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_perm } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-35.c b/gcc/testsuite/gcc.dg/vect/slp-35.c index 2e8f57c7067..76dd7456d89 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-35.c +++ b/gcc/testsuite/gcc.dg/vect/slp-35.c @@ -67,5 +67,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail { vect_variable_length && vect_gather_scatter } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-37.c b/gcc/testsuite/gcc.dg/vect/slp-37.c index 700ffd85f91..b6a044dfd3a 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-37.c +++ b/gcc/testsuite/gcc.dg/vect/slp-37.c @@ -58,7 +58,6 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_scatter } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_scatter xfail vect_variable_length } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-4.c b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c index 3a4420c53e4..8457e4f45d6 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-perm-4.c +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c @@ -114,4 +114,4 @@ int main (int argc, const char* argv[]) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "gaps requires scalar epilogue loop" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail { { ! vect_perm5_int } && vect_gather_scatter } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-71.c b/gcc/testsuite/gcc.dg/vect/vect-71.c index 2d1a3ffd0ad..f15521176df 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-71.c +++ b/gcc/testsuite/gcc.dg/vect/vect-71.c @@ -36,4 +36,4 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_scatter_store } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c index 0f9fc20567e..a9a6021ed2b 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c @@ -50,5 +50,5 @@ int main (void) /* need -ffast-math to vectorizer these loops. */ /* ARM NEON passes -ffast-math to these tests, so expect this to fail. */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_ieee_add_reduc || arm_neon_ok } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_ieee_add_reduc } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_fold_left_plus } xfail arm_neon_ok } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_fold_left_plus } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-or_1.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-or_1.c index ead9548c4a6..cff3f16107f 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-or_1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-or_1.c @@ -24,17 +24,17 @@ main (unsigned char argc, char **argv) check_vect (); for (i = 0; i < N; i++) - in[i] = (i + i + 1) & 0xfd; + { + in[i] = (i + i + 1) & 0xfd; + asm volatile ("" ::: "memory"); + } for (i = 0; i < N; i++) { expected |= in[i]; - asm volatile (""); + asm volatile ("" ::: "memory"); } - /* Prevent constant propagation of the entire loop below. */ - asm volatile ("" : : : "memory"); - for (i = 0; i < N; i++) sum |= in[i]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-or_2.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-or_2.c index 799ac173e21..cd1af6dc9ae 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-or_2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-or_2.c @@ -23,17 +23,17 @@ main (unsigned char argc, char **argv) check_vect (); for (i = 0; i < N; i++) - in[i] = (i + i + 1) & 0xfd; + { + in[i] = (i + i + 1) & 0xfd; + asm volatile ("" ::: "memory"); + } for (i = 0; i < N; i++) { expected |= in[i]; - asm volatile (""); + asm volatile ("" ::: "memory"); } - /* Prevent constant propagation of the entire loop below. */ - asm volatile ("" : : : "memory"); - for (i = 0; i < N; i++) sum |= in[i]; |