diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
21 files changed, 342 insertions, 9 deletions
diff --git a/gcc/testsuite/gcc.dg/attr-alias-3.c b/gcc/testsuite/gcc.dg/attr-alias-3.c index 02637b2313e..6ff1b475ad9 100644 --- a/gcc/testsuite/gcc.dg/attr-alias-3.c +++ b/gcc/testsuite/gcc.dg/attr-alias-3.c @@ -1,5 +1,5 @@ // { dg-do link } -// { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } +// { dg-skip-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } // { dg-require-alias "" } // { dg-options "-O2 -fno-common" } diff --git a/gcc/testsuite/gcc.dg/attr-alias-5.c b/gcc/testsuite/gcc.dg/attr-alias-5.c index d22c286fc65..56d9b302c66 100644 --- a/gcc/testsuite/gcc.dg/attr-alias-5.c +++ b/gcc/testsuite/gcc.dg/attr-alias-5.c @@ -4,6 +4,7 @@ /* { dg-options "-std=gnu99" } */ /* { dg-require-alias "" } */ /* { dg-require-ascii-locale "" } */ +/* { dg-skip-if "" { powerpc*-*-aix* } { "*" } { "" } } */ void f0 (void) __attribute__((alias("\xa1"))); /* { dg-error "undefined symbol '\\\\241'" } */ void f1 (void) __attribute__((alias("\u00e9"))); /* { dg-error "undefined symbol '\\\\U000000e9'" } */ diff --git a/gcc/testsuite/gcc.dg/builtins-85.c b/gcc/testsuite/gcc.dg/builtins-85.c new file mode 100644 index 00000000000..0993fbc19f4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtins-85.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef __SIZE_TYPE__ size_t; +extern void __chk_fail (void); +extern int snprintf (char *, size_t, const char *, ...); +extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) +{ + if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) + __chk_fail (); + return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); +} +extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); + +char buf[10]; + +int +main (void) +{ + snprintf (buf, 10, "%d%d\n", 10, 10); + return 0; +} + +/* { dg-final { scan-assembler "mysnprintf" } } */ +/* { dg-final { scan-assembler-not "__chk_fail" } } */ diff --git a/gcc/testsuite/gcc.dg/dump-ada-spec-1.c b/gcc/testsuite/gcc.dg/dump-ada-spec-1.c new file mode 100644 index 00000000000..eb249e79854 --- /dev/null +++ b/gcc/testsuite/gcc.dg/dump-ada-spec-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-ada-spec" } */ + +struct S +{ + int i; +}; + +/* { dg-final { scan-ada-spec "type S is record" } } */ +/* { dg-final { cleanup-ada-spec } } */ diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-1.c b/gcc/testsuite/gcc.dg/guality/pr54519-1.c new file mode 100644 index 00000000000..98afd45c18f --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr54519-1.c @@ -0,0 +1,48 @@ +/* PR debug/54519 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +__attribute__((noinline, noclone)) void +fn1 (int x) +{ + __asm volatile ("" : "+r" (x) : : "memory"); +} + +static int +fn2 (int x, int y, int z) +{ + int a = 8; + if (x != z) + { + fn1 (x); + fn1 (x); /* { dg-final { gdb-test 20 "x" "36" } } */ + if (x == 36) /* { dg-final { gdb-test 20 "y" "25" } } */ + fn1 (x); /* { dg-final { gdb-test 20 "z" "6" } } */ + fn1 (x); /* { dg-final { gdb-test 23 "x" "98" } } */ + if (x == 98) /* { dg-final { gdb-test 23 "y" "117" } } */ + fn1 (x); /* { dg-final { gdb-test 23 "z" "8" } } */ + fn1 (x); + fn1 (x + a); + } + return y; +} + +__attribute__((noinline, noclone)) int +fn3 (int x, int y) +{ + return fn2 (x, y, 6); +} + +__attribute__((noinline, noclone)) int +fn4 (int x, int y) +{ + return fn2 (x, y, 8); +} + +int +main () +{ + fn3 (36, 25); + fn4 (98, 117); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-2.c b/gcc/testsuite/gcc.dg/guality/pr54519-2.c new file mode 100644 index 00000000000..4ee3c9e2f84 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr54519-2.c @@ -0,0 +1,45 @@ +/* PR debug/54519 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +__attribute__((noinline, noclone)) void +fn1 (int x) +{ + __asm volatile ("" : "+r" (x) : : "memory"); +} + +static int +fn2 (int x, int y) +{ + if (y) + { + fn1 (x); /* { dg-final { gdb-test 17 "x" "6" } } */ + fn1 (x); /* { dg-final { gdb-test 17 "y" "25" } } */ + fn1 (x); + fn1 (x); + y = -2 + x; + y = y * y * y + y; + fn1 (x + y); /* { dg-final { gdb-test 22 "y" "68" } } */ + } + return x; +} + +__attribute__((noinline, noclone)) int +fn3 (int x, int y) +{ + return fn2 (x, y) + y; +} + +__attribute__((noinline, noclone)) int +fn4 (int x, int y) +{ + return fn2 (x, y) + y; +} + +int +main () +{ + fn3 (6, 25); + fn4 (4, 117); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-3.c b/gcc/testsuite/gcc.dg/guality/pr54519-3.c new file mode 100644 index 00000000000..aa8369e15b8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr54519-3.c @@ -0,0 +1,42 @@ +/* PR debug/54519 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +__attribute__((noinline, noclone)) void +fn1 (int x) +{ + __asm volatile ("" : "+r" (x) : : "memory"); +} + +static int +fn2 (int x, int y, int z) +{ + int a = 8; + if (x != z) + { + fn1 (x); + fn1 (x); /* { dg-final { gdb-test 20 "x" "36" } } */ + if (x == 36) /* { dg-final { gdb-test 20 "y" "25" } } */ + fn1 (x); /* { dg-final { gdb-test 20 "z" "6" } } */ + fn1 (x); /* { dg-final { gdb-test 23 "x" "98" } } */ + if (x == 98) /* { dg-final { gdb-test 23 "y" "117" } } */ + fn1 (x); /* { dg-final { gdb-test 23 "z" "8" } } */ + fn1 (x); + fn1 (x + a); + } + return y; +} + +int (*p) (int, int, int) = fn2; + +int +main () +{ + __asm volatile ("" : : : "memory"); + int (*q) (int, int, int) = p; + __asm volatile ("" : : : "memory"); + q (36, 25, 6); + q (98, 117, 8); + q (0, 0, 0); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-4.c b/gcc/testsuite/gcc.dg/guality/pr54519-4.c new file mode 100644 index 00000000000..d2765d148c2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr54519-4.c @@ -0,0 +1,39 @@ +/* PR debug/54519 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +__attribute__((noinline, noclone)) void +fn1 (int x) +{ + __asm volatile ("" : "+r" (x) : : "memory"); +} + +static int +fn2 (int x, int y) +{ + if (y) + { + fn1 (x); /* { dg-final { gdb-test 17 "x" "6" } } */ + fn1 (x); /* { dg-final { gdb-test 17 "y" "25" } } */ + fn1 (x); + fn1 (x); + y = -2 + x; + y = y * y * y + y; + fn1 (x + y); /* { dg-final { gdb-test 22 "y" "68" } } */ + } + return x; +} + +int (*p) (int, int) = fn2; + +int +main () +{ + __asm volatile ("" : : : "memory"); + int (*q) (int, int) = p; + __asm volatile ("" : : : "memory"); + q (6, 25); + q (4, 117); + q (0, 0); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-5.c b/gcc/testsuite/gcc.dg/guality/pr54519-5.c new file mode 100644 index 00000000000..c64527a45d9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr54519-5.c @@ -0,0 +1,45 @@ +/* PR debug/54519 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +__attribute__((noinline, noclone)) void +fn1 (int x) +{ + __asm volatile ("" : "+r" (x) : : "memory"); +} + +static int +fn2 (int x, int y) +{ + if (y) + { + fn1 (x); /* { dg-final { gdb-test 17 "x" "6" } } */ + fn1 (x); /* { dg-final { gdb-test 17 "y" "25" } } */ + fn1 (x); + fn1 (x); + y = -2 + x; + y = y * y * y + y; + fn1 (x + y); /* { dg-final { gdb-test 22 "y" "68" } } */ + } + return x; +} + +__attribute__((noinline, noclone)) int +fn3 (int x, int y) +{ + return fn2 (x, y); +} + +__attribute__((noinline, noclone)) int +fn4 (int x, int y) +{ + return fn2 (x, y); +} + +int +main () +{ + fn3 (6, 25); + fn4 (4, 117); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/guality/pr54519-6.c b/gcc/testsuite/gcc.dg/guality/pr54519-6.c new file mode 100644 index 00000000000..836ab1f6601 --- /dev/null +++ b/gcc/testsuite/gcc.dg/guality/pr54519-6.c @@ -0,0 +1,27 @@ +/* PR debug/54519 */ +/* { dg-do run } */ +/* { dg-options "-g" } */ + +#include "../nop.h" + +static inline void +f1 (int x, int y) +{ + asm volatile (NOP); /* { dg-final { gdb-test 11 "x" "2" } } */ + asm volatile (NOP); /* { dg-final { gdb-test 11 "y" "0" } } */ +} + +static inline void +f2 (int z) +{ + f1 (z, 0); + f1 (z, 1); +} + +int +main () +{ + f2 (2); + f2 (3); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/lto/resolutions_0.c b/gcc/testsuite/gcc.dg/lto/resolutions_0.c new file mode 100644 index 00000000000..9e59cb0690c --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/resolutions_0.c @@ -0,0 +1,10 @@ +/* { dg-require-linker-plugin "" } */ +/* { dg-extra-ld-options "-fuse-linker-plugin -O1" } */ + +link_error() +{ +} +main() +{ + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr51106-2.c b/gcc/testsuite/gcc.dg/torture/pr51106-2.c index 80328a92e7e..bab0987fff7 100644 --- a/gcc/testsuite/gcc.dg/torture/pr51106-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr51106-2.c @@ -1,7 +1,7 @@ /* PR target/51106 */ /* { dg-do "compile" } */ /* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */ -/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ int bar (int x) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c index 27c4bfa27ce..d0225ec164e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c @@ -25,4 +25,4 @@ void f(int x, int y) the testcase around too much. */ /* { dg-final { scan-ipa-dump-times "block 5, loop depth 0, count 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 1 "profile_estimate" } } */ -/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ +/* { dg-final { cleanup-ipa-dump "profile_estimate" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c index 35f01aba2a6..5401dcf0414 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c @@ -9,3 +9,4 @@ void bar(char *p, int n) } /* { dg-final { scan-tree-dump "generated memmove" "ldist" } } */ +/* { dg-final { cleanup-tree-dump "ldist" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c b/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c index 9620f224115..5fea3d3db82 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c @@ -21,4 +21,4 @@ f (int s, long c) } /* { dg-final { scan-tree-dump-times " \\* " 3 "dom2" } } */ -/* { dg-final { cleanup-tree-dump "optimized" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c new file mode 100644 index 00000000000..ad2b38d02c1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c @@ -0,0 +1,40 @@ +/* PR tree-optimization/54810 */ +/* { dg-do link } */ +/* { dg-options "-O2 -fdump-tree-vrp1" } */ + +extern void link_error (void); + +#define T(n, ntype, wtype) \ +void \ +f##n (wtype s) \ +{ \ + if ((ntype) s == 0) \ + return; \ + if (s == 0) \ + link_error (); \ +} + +T(1, unsigned char, unsigned char) +T(2, unsigned char, unsigned short) +T(3, unsigned char, unsigned int) +T(4, unsigned char, unsigned long int) +T(5, unsigned char, unsigned long long int) +T(6, unsigned short int, unsigned short int) +T(7, unsigned short int, unsigned int) +T(8, unsigned short int, unsigned long int) +T(9, unsigned short int, unsigned long long int) +T(10, unsigned int, unsigned int) +T(11, unsigned int, unsigned long int) +T(12, unsigned int, unsigned long long int) +T(13, unsigned long int, unsigned long int) +T(14, unsigned long int, unsigned long long int) +T(15, unsigned long long int, unsigned long long int) + +int +main () +{ + return 0; +} + +/* { dg-final { scan-tree-dump-not "link_error" "vrp1"} } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-10.c b/gcc/testsuite/gcc.dg/ucnid-10.c index 37b18d7e08d..83425d3cf15 100644 --- a/gcc/testsuite/gcc.dg/ucnid-10.c +++ b/gcc/testsuite/gcc.dg/ucnid-10.c @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -fextended-identifiers" } */ /* { dg-require-ascii-locale "" } */ -/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ #pragma pack(push) #pragma pack(pop, \u00f3) /* { dg-warning "pop, \\\\U000000f3.*push, \\\\U000000f3" } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-13.c b/gcc/testsuite/gcc.dg/ucnid-13.c index 24309d125c8..0b94247ba9f 100644 --- a/gcc/testsuite/gcc.dg/ucnid-13.c +++ b/gcc/testsuite/gcc.dg/ucnid-13.c @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -fextended-identifiers -Wpacked" } */ /* { dg-require-ascii-locale "" } */ -/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ int a __attribute__((\u00c0)); /* { dg-warning "'\\\\U000000c0' attribute directive ignored" } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-7.c b/gcc/testsuite/gcc.dg/ucnid-7.c index da5aa0ddb3c..3f73e35d4b1 100644 --- a/gcc/testsuite/gcc.dg/ucnid-7.c +++ b/gcc/testsuite/gcc.dg/ucnid-7.c @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-std=c99 -fextended-identifiers" } */ /* { dg-require-ascii-locale "" } */ -/* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */ +/* { dg-skip-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */ void *p = &\u00e9; /* { dg-error "'\\\\U000000e9' undeclared" } */ void *q = &\u1e00; /* { dg-error "'\\\\U00001e00' undeclared" } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-8.c b/gcc/testsuite/gcc.dg/ucnid-8.c index 0e48a7f6dd7..df1f35053d0 100644 --- a/gcc/testsuite/gcc.dg/ucnid-8.c +++ b/gcc/testsuite/gcc.dg/ucnid-8.c @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -fextended-identifiers -Wvla" } */ /* { dg-require-ascii-locale "" } */ -/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ int a __attribute__((__mode__(\u00e9))); /* { dg-error "unknown machine mode '\\\\U000000e9'" } */ struct s1 { int \u00e9 : 0; }; /* { dg-error "zero width for bit-field '\\\\U000000e9'" } */ diff --git a/gcc/testsuite/gcc.dg/vmx/3b-13.c b/gcc/testsuite/gcc.dg/vmx/3b-13.c index 146f737aebd..42c3ca4fa8a 100644 --- a/gcc/testsuite/gcc.dg/vmx/3b-13.c +++ b/gcc/testsuite/gcc.dg/vmx/3b-13.c @@ -3,7 +3,7 @@ vector signed int f(vector float a, vector signed int b) { - return vec_splat(vec_cts(vec_ctf(vec_ctu(a, 31),0),9),30); + return vec_splat(vec_cts(vec_ctf(vec_ctu(a, 31),0),9),2); } static void test() |