diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/20040813-1.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/darwin-20040809-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/pr70646.c | 40 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr69802.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr70022.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr70152.c | 27 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr70169.c | 40 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr71558.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr70484.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr71452.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr71606.c | 11 |
11 files changed, 199 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/20040813-1.c b/gcc/testsuite/gcc.dg/20040813-1.c index 8be831d96b6..9cf664dd769 100644 --- a/gcc/testsuite/gcc.dg/20040813-1.c +++ b/gcc/testsuite/gcc.dg/20040813-1.c @@ -1,8 +1,7 @@ /* Test lang in N_SO stab. */ /* Contributed by Devang Patel <dpatel@apple.com> */ -/* { dg-do compile } */ -/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* *-*-vxworks* } { "*" } { "" } } */ +/* { dg-do compile { target stabs } } */ /* { dg-options "-gstabs" } */ int diff --git a/gcc/testsuite/gcc.dg/darwin-20040809-2.c b/gcc/testsuite/gcc.dg/darwin-20040809-2.c index a38f75f26b7..98d571276d0 100644 --- a/gcc/testsuite/gcc.dg/darwin-20040809-2.c +++ b/gcc/testsuite/gcc.dg/darwin-20040809-2.c @@ -1,7 +1,7 @@ /* Test dead code strip support. */ /* Contributed by Devang Patel <dpatel@apple.com> */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile { target { *-*-darwin* && stabs } } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-symbols" } */ int diff --git a/gcc/testsuite/gcc.dg/ipa/pr70646.c b/gcc/testsuite/gcc.dg/ipa/pr70646.c new file mode 100644 index 00000000000..f85816e7303 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr70646.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +#pragma GCC optimize("no-unit-at-a-time") + +typedef unsigned char u8; +typedef unsigned long long u64; + +static inline __attribute__((always_inline)) u64 __swab64p(const u64 *p) +{ + return (__builtin_constant_p((u64)(*p)) ? ((u64)( (((u64)(*p) & (u64)0x00000000000000ffULL) << 56) | (((u64)(*p) & (u64)0x000000000000ff00ULL) << 40) | (((u64)(*p) & (u64)0x0000000000ff0000ULL) << 24) | (((u64)(*p) & (u64)0x00000000ff000000ULL) << 8) | (((u64)(*p) & (u64)0x000000ff00000000ULL) >> 8) | (((u64)(*p) & (u64)0x0000ff0000000000ULL) >> 24) | (((u64)(*p) & (u64)0x00ff000000000000ULL) >> 40) | (((u64)(*p) & (u64)0xff00000000000000ULL) >> 56))) : __builtin_bswap64(*p)); +} + +static inline u64 wwn_to_u64(void *wwn) +{ + return __swab64p(wwn); +} + +void __attribute__((noinline,noclone)) broken(u64* shost) +{ + u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + *shost = wwn_to_u64(node_name); +} + +void __attribute__((noinline,noclone)) dummy(void) +{ + __builtin_abort(); +} + +int main(int argc, char* argv[]) +{ + u64 v; + + broken(&v); + + if(v != (u64)-1) + __builtin_abort(); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr69802.c b/gcc/testsuite/gcc.dg/pr69802.c new file mode 100644 index 00000000000..27ee02f36b5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr69802.c @@ -0,0 +1,23 @@ +/* PR tree-optimization/69802 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wall" } */ + +struct S { unsigned f : 1; }; +int a, d; + +int +foo (void) +{ + unsigned b = 0; + struct S c; + d = ((1 && b) < c.f) & c.f; /* { dg-warning "is used uninitialized" } */ + return a; +} + +int +bar (_Bool c) +{ + unsigned b = 0; + d = ((1 && b) < c) & c; + return a; +} diff --git a/gcc/testsuite/gcc.dg/pr70022.c b/gcc/testsuite/gcc.dg/pr70022.c new file mode 100644 index 00000000000..30eb7ece250 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr70022.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-w -Wno-psabi" } */ + +typedef int v4si __attribute__ ((vector_size (16))); + +int +foo (v4si v) +{ + return v[~0UL]; +} diff --git a/gcc/testsuite/gcc.dg/pr70152.c b/gcc/testsuite/gcc.dg/pr70152.c new file mode 100644 index 00000000000..27a092d199a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr70152.c @@ -0,0 +1,27 @@ +/* PR tree-optimization/70152 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int a; +int foo (void); +int setjmp (char *); +char buf[64]; + +static int +bar (int x) +{ + x = 0; + setjmp (buf); + for (;;) + { + switch (x) + case 5: + x = foo (); + } +} + +void +baz (void) +{ + bar (a); +} diff --git a/gcc/testsuite/gcc.dg/pr70169.c b/gcc/testsuite/gcc.dg/pr70169.c new file mode 100644 index 00000000000..8d08f5c6472 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr70169.c @@ -0,0 +1,40 @@ +/* PR tree-optimization/70169 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-strict-aliasing -fno-tree-dce" } */ + +int printf (const char *, ...); + +void +foo () +{ + unsigned char *p = (unsigned char *) &printf; + for (;;) + (*p)++; +} + +void +bar (int x) +{ + unsigned char *p = (unsigned char *) &printf; + int i; + for (i = 0; i < x; i++) + (*p)++; +} + +void +baz (int x, int y) +{ + unsigned char *p = (unsigned char *) &&lab; + int i; + if (y) + { + for (i = 0; i < x; i++) + (*p)++; + } + else + { + lab: + asm volatile (""); + foo (); + } +} diff --git a/gcc/testsuite/gcc.dg/pr71558.c b/gcc/testsuite/gcc.dg/pr71558.c new file mode 100644 index 00000000000..33a648e108c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr71558.c @@ -0,0 +1,17 @@ +/* PR tree-optimization/71588 */ + +/* strcpy must not be pure, but make sure we don't ICE even when + it is declared incorrectly. */ +char *strcpy (char *, const char *) __attribute__ ((__pure__)); +__SIZE_TYPE__ strlen (const char *); +void *malloc (__SIZE_TYPE__); + +char a[20]; + +char * +foo (void) +{ + __SIZE_TYPE__ b = strlen (a); + char *c = malloc (b); + return strcpy (c, a); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr70484.c b/gcc/testsuite/gcc.dg/torture/pr70484.c new file mode 100644 index 00000000000..7604c654fbe --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr70484.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ + +extern void abort (void); + +int __attribute__((noinline,noclone)) +f(int *pi, long *pl) +{ + *pi = 1; + *pl = 0; + return *(char *)pi; +} + +int main() +{ + union { long l; int i; } a; + if (f (&a.i, &a.l) != 0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr71452.c b/gcc/testsuite/gcc.dg/torture/pr71452.c new file mode 100644 index 00000000000..8948d39fdaf --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr71452.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ + +int main() +{ + _Bool b; + *(char *)&b = 123; + if (*(char *)&b != 123) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr71606.c b/gcc/testsuite/gcc.dg/torture/pr71606.c new file mode 100644 index 00000000000..b0cc26ac771 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr71606.c @@ -0,0 +1,11 @@ +_Complex a; +void fn1 (); + +int main () { + fn1 (a); + return 0; +} + +void fn1 (__complex__ long double p1) { + __imag__ p1 = 6.0L; +} |