aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-12-12 17:38:12 +0000
committerJakub Jelinek <jakub@redhat.com>2007-12-12 17:38:12 +0000
commit7f9ade3fb480974f2475e90a16daa4df6c7689d5 (patch)
tree344fd5dcb7c533bd59bb23abc143c321ed6ef7a4 /gcc/testsuite/gcc.c-torture
parentf3e007de17b66b34012687af4b899e2cdc8c2d76 (diff)
svn merge -r130673:130787 svn+ssh://gcc.gnu.org/svn/gcc/trunk/
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_3-branch@130789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011130-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20071207-1.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20071210-1.c67
3 files changed, 82 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011130-2.c b/gcc/testsuite/gcc.c-torture/compile/20011130-2.c
index 6439527e89c..e3cb5f46a88 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20011130-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20011130-2.c
@@ -1,7 +1,7 @@
/* This testcase caused infinite loop in life info computation
after if conversion on IA-64. Conditional register dead for
pseudo holding sign-extended k was improperly computed,
- resulting in this pseudo beeing live at start of bb if it was
+ resulting in this pseudo being live at start of bb if it was
dead at the end and vice versa; as it was a bb which had edge
to itself, this resulted in alternative propagating this basic
block forever. */
diff --git a/gcc/testsuite/gcc.c-torture/compile/20071207-1.c b/gcc/testsuite/gcc.c-torture/compile/20071207-1.c
new file mode 100644
index 00000000000..27b871616b1
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20071207-1.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/34371 */
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+void centerln (int width, int ch, char *s)
+{
+ unsigned int sidebar;
+ int i;
+ char linet1[1000];
+ char linet2[100];
+ sidebar = (width - __builtin_strlen (s)) / 2;
+ for (i = 0; i < sidebar; i++)
+ linet2[i] = ch;
+ __builtin_strcpy (linet1, linet2);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20071210-1.c b/gcc/testsuite/gcc.c-torture/execute/20071210-1.c
new file mode 100644
index 00000000000..0d113c008f7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20071210-1.c
@@ -0,0 +1,67 @@
+/* PR rtl-optimization/34302 */
+
+extern void abort (void);
+
+struct S
+{
+ int n1, n2, n3, n4;
+};
+
+__attribute__((noinline)) struct S
+foo (int x, int y, int z)
+{
+ if (x != 10 || y != 9 || z != 8)
+ abort ();
+ struct S s = { 1, 2, 3, 4 };
+ return s;
+}
+
+__attribute__((noinline)) void **
+bar (void **u, int *v)
+{
+ void **w = u;
+ int *s = v, x, y, z;
+ void **p, **q;
+ static void *l[] = { &&lab1, &&lab1, &&lab2, &&lab3, &&lab4 };
+
+ if (!u)
+ return l;
+
+ q = *w++;
+ goto *q;
+lab2:
+ p = q;
+ q = *w++;
+ x = s[2];
+ y = s[1];
+ z = s[0];
+ s -= 1;
+ struct S r = foo (x, y, z);
+ s[3] = r.n1;
+ s[2] = r.n2;
+ s[1] = r.n3;
+ s[0] = r.n4;
+ goto *q;
+lab3:
+ p = q;
+ q = *w++;
+ s += 1;
+ s[0] = 23;
+lab1:
+ goto *q;
+lab4:
+ return 0;
+}
+
+int
+main (void)
+{
+ void **u = bar ((void **) 0, (int *) 0);
+ void *t[] = { u[2], u[4] };
+ int s[] = { 7, 8, 9, 10, 11, 12 };
+ if (bar (t, &s[1]) != (void **) 0
+ || s[0] != 4 || s[1] != 3 || s[2] != 2 || s[3] != 1
+ || s[4] != 11 || s[5] != 12)
+ abort ();
+ return 0;
+}