Patchwork Testcases for 58431 and 58419

login
register
mail settings
Submitter Jeff Law
Date Sept. 16, 2013, 7:31 p.m.
Message ID <52375C88.3080800@redhat.com>
Download mbox | patch
Permalink /patch/275281/
State New
Headers show

Comments

Jeff Law - Sept. 16, 2013, 7:31 p.m.
Just for completeness. Installed.

Patch

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f606965..7150063 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@ 
+2013-09-16  Jeff Law  <law@redhat.com>
+
+	* gcc.c-torture/execute/pr58419.c: New test.
+	* gcc.c-torture/execute/pr58431.c: New test.
+
 2013-09-16  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/58356
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58419.c b/gcc/testsuite/gcc.c-torture/execute/pr58419.c
new file mode 100644
index 0000000..527fcb7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr58419.c
@@ -0,0 +1,35 @@ 
+int printf(const char *, ...);
+
+int a, g, i, k, *p; 
+char b, e;
+short c, h;
+static short *d = &c;
+
+char
+foo (int p1, int p2)
+{
+  return p1 - p2;
+}
+
+int
+bar ()
+{
+  short *q = &c;
+  *q = 1;
+  *p = 0;
+  return 0;
+}
+
+int
+main ()
+{
+  for (b = -22; b >= -29; b--)
+    {
+      short *l = &h;
+      char *m = &e;
+      *l = a;
+      g = foo (*m = k && *d, 1 > i) || bar (); 
+    }
+  getpid();
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58431.c b/gcc/testsuite/gcc.c-torture/execute/pr58431.c
new file mode 100644
index 0000000..1a992c5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr58431.c
@@ -0,0 +1,33 @@ 
+char a, h;
+int b, d, e, g, j, k;
+volatile int c;
+short i;
+
+int
+main ()
+{
+  int m;
+
+  m = i ^= 1;
+  for (b = 0; b < 1; b++)
+    {
+      char o = m;
+      g = k;
+      j = j || c;
+      if (a != o)
+	for (; d < 1; d++)
+	  ;
+      else
+	{
+	  char *p = &h;
+	  *p = 1;
+	  for (; e; e++)
+	    ;
+	}
+    }
+
+  if (h != 0)
+    __builtin_abort(); 
+
+  return 0;
+}