aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57656.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr85168.c30
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr85244-1.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr85244-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr85284.c20
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr85567.c16
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr85588.c4
7 files changed, 98 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr57656.c b/gcc/testsuite/gcc.dg/torture/pr57656.c
index 4f3645e4693..02490140105 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57656.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57656.c
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-options "-fstrict-overflow" } */
+/* { dg-additional-options "-fstrict-overflow" } */
int main (void)
{
diff --git a/gcc/testsuite/gcc.dg/torture/pr85168.c b/gcc/testsuite/gcc.dg/torture/pr85168.c
new file mode 100644
index 00000000000..cc5e6648c7e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr85168.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target indirect_jumps } */
+
+typedef struct {
+ struct {
+ char a;
+ } b;
+} c;
+
+int d, f;
+c *e;
+
+extern void i(void);
+extern void sejtmp () __attribute__((returns_twice));
+
+void g(void)
+{
+ c *h = e;
+ if (f)
+ {
+ i();
+ h--;
+ if (d)
+ if (h->b.a)
+ i();
+ }
+ if (h->b.a)
+ sejtmp();
+ e = h;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr85244-1.c b/gcc/testsuite/gcc.dg/torture/pr85244-1.c
new file mode 100644
index 00000000000..44716aa9e04
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr85244-1.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-additional-sources "pr85244-2.c" } */
+
+struct s {
+ long a;
+ int b;
+ int tab[];
+};
+
+extern const struct s val;
+extern int idx;
+extern void abort (void);
+
+int main()
+{
+ if (val.tab[0] != 42 || val.tab[1] != 1337 || val.tab[idx] != 1337)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr85244-2.c b/gcc/testsuite/gcc.dg/torture/pr85244-2.c
new file mode 100644
index 00000000000..d57cb712420
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr85244-2.c
@@ -0,0 +1,8 @@
+struct s {
+ long a;
+ int b;
+ int tab[];
+};
+
+int idx = 1;
+const struct s val = { 0, 0, { 42, 1337 } };
diff --git a/gcc/testsuite/gcc.dg/torture/pr85284.c b/gcc/testsuite/gcc.dg/torture/pr85284.c
new file mode 100644
index 00000000000..80e2c5b247b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr85284.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+static int p[48], v;
+
+int
+main ()
+{
+ p[32] = 1;
+ for (int i = 48; i--;)
+ {
+ if (!p[i])
+ continue;
+ if ((i & 7) > 2)
+ break;
+ v = i & 1;
+ }
+ if (v != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr85567.c b/gcc/testsuite/gcc.dg/torture/pr85567.c
new file mode 100644
index 00000000000..f20c69f4201
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr85567.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+extern void sincos(double x, double *sinx, double *cosx);
+
+void apply(void (*f)(double, double *, double *),
+ double x, double *sinx, double *cosx)
+{
+ f(x, sinx, cosx);
+ return;
+}
+
+void apply_sincos(double x, double *sinx, double *cosx)
+{
+ apply(sincos, x, sinx, cosx);
+ return;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr85588.c b/gcc/testsuite/gcc.dg/torture/pr85588.c
new file mode 100644
index 00000000000..5d95c96bc35
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr85588.c
@@ -0,0 +1,4 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fwrapv" } */
+
+#include "pr57656.c"