diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c | 32 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c | 34 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c | 37 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c | 23 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c | 22 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c | 22 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c | 8 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c | 35 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c | 31 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c | 37 |
10 files changed, 281 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c new file mode 100644 index 000000000..2512db396 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-fschedule-insns" { target scheduling } } */ + +extern void abort (void); + +struct S { + int i; + int j; +}; + +struct U { + struct S s; +} __attribute__((may_alias)); + +int __attribute__((noinline,noclone)) +foo (struct U *p, struct U *q) +{ + int i; + q->s.j = 1; + i = p->s.i; + return i; +} + +int main() +{ + int a[3]; + int *p = a; + p[1] = 0; + if (foo ((struct U *)(p + 1), (struct U *)p) != 1) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c new file mode 100644 index 000000000..04f55914e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c @@ -0,0 +1,34 @@ +extern void abort (void); + +struct S { int i; int j; }; +struct X { struct S s; int k; }; +struct Y { int k; struct S s; }; +union U { struct X x; struct Y y; } __attribute__((may_alias)); + +int __attribute__((noinline)) +foo (union U *p, union U *q) +{ + p->x.s.j = 1; + q->y.s.i = 0; + return p->x.s.j; +} + +struct R { int i; int j; } __attribute__((may_alias)); + +int __attribute__((noinline)) +bar (struct R *p, struct R *q) +{ + p->i = 1; + q->j = 0; + return p->i; +} + +int main() +{ + int a[3]; + if (foo ((union U *)&a[0], (union U *)&a[0]) != 0) + abort (); + if (bar ((struct R *)&a[1], (struct R *)&a[0]) != 0) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c new file mode 100644 index 000000000..93962c20e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ + +union U { + double val; + union U *ptr; +}; + +union U *d; +double a; +int b; +int c; + +static void fn1(union U *p1, int p2, _Bool p3) +{ + union U *e; + + if (p2 == 0) + a = ((union U*)((unsigned long)p1 & ~1))->val; + + if (b) { + e = p1; + } else if (c) { + e = ((union U*)((unsigned long)p1 & ~1))->ptr; + d = e; + } else { + e = 0; + d = ((union U*)0)->ptr; + } + + fn1 (e, 0, 0); + fn1 (0, 0, p3); +} + +void fn2 (void) +{ + fn1 (0, 0, 0); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c new file mode 100644 index 000000000..c8fec87ea --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fno-tree-ch -fno-tree-cselim -fno-tree-dominator-opts" } */ + +int a, b, c, d, e, f; + +void foo (int x) +{ + for (;;) + { + int g = c; + if (x) + { + if (e) + while (a) + --f; + } + for (b = 5; b; b--) + { + } + if (!g) + x = 0; + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c new file mode 100644 index 000000000..5d93ae3ee --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ + +extern int a, b, k, q; + +void +foo () +{ + if (a) + { + while (q) + { + lbl: + if (a) + { + a = 0; + goto lbl; + } + } + b = k; + } + goto lbl; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c new file mode 100644 index 000000000..5e35f1988 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ + +int x = 1; + +__attribute__((noinline, noclone)) void +foo (unsigned long long t) +{ + asm volatile ("" : : "r" (&t)); + if (t == 1) + __builtin_abort (); +} + +int +main () +{ +#if __SIZEOF_LONG_LONG__ >= 8 + unsigned long long t = 0xffffffffffffffffULL * (0xffffffffUL * x); + if (t != 0xffffffff00000001ULL) + foo (t);; +#endif + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c new file mode 100644 index 000000000..ed5653982 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +int main (void) +{ + int a = 0; + unsigned b = (a * 64 & 192) | 63U; + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c new file mode 100644 index 000000000..d9a0a0b39 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ + +int a, b = 1, c, d, e, f, g; + +int +fn1 () +{ + int h; + for (;;) + { + g = b; + g = g ? 0 : 1 % g; + e = a + 1; + for (; d < 1; d = e) + { + if (f == 0) + h = 0; + else + h = 1 % f; + if (f < 1) + c = 0; + else if (h) + break; + } + if (b) + return 0; + } +} + +int +main () +{ + fn1 (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c new file mode 100644 index 000000000..a62de30fd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ + +int a, b; +short c, d; +char e, f; + +int +fn1 (int p1, char p2) +{ + return p1 || p2 ? 0 : p2; +} + +void +fn2 () +{ + for (; a;) + { + int g; + g = c = e; + for (; a;) + b = fn1 (g = d = e, g); + f = g; + } +} + +int +main () +{ + fn2 (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c new file mode 100644 index 000000000..226de0c1a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ + +extern void abort (void); + +int a = 1, *e = &a, **f = &e, *l, *p, j; +static int b; +long d; +short g; + +void +fn1 (int *p) +{ + int m; + if (!(*p & j)) + { + int *n = &m; + for (d = 6; d; d--) + { + for (g = 0; g < 1; g++) + { + n = l = *f; + b = *p; + } + *n = 0; + } + } +} + +int +main () +{ + p = *f; + fn1 (p); + if (b != 0) + abort (); + return 0; +} |