OSDN Git Service

* gcc.c-torture/execute/20060905-1.c: New test.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Sep 2006 07:05:08 +0000 (07:05 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Sep 2006 07:05:08 +0000 (07:05 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116692 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20060905-1.c [new file with mode: 0644]

index 0355796..a2b7e9c 100644 (file)
@@ -1,3 +1,7 @@
+2006-09-05  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.c-torture/execute/20060905-1.c: New test.
+
 2006-09-05 Paul Thomas <pault@gcc.gnu.org>
 
        PR fortran/28908
diff --git a/gcc/testsuite/gcc.c-torture/execute/20060905-1.c b/gcc/testsuite/gcc.c-torture/execute/20060905-1.c
new file mode 100644 (file)
index 0000000..eac884f
--- /dev/null
@@ -0,0 +1,35 @@
+/* PR rtl-optimization/28386 */
+/* Origin: Volker Reichelt <reichelt@gcc.gnu.org> */
+
+extern void abort(void);
+
+volatile char s[256][3];
+
+char g;
+
+static void dummy(char a)
+{
+  g = a;
+}
+
+static int foo(void)
+{
+  int i, j=0;
+
+  for (i = 0; i < 256; i++)
+    if (i >= 128 && i < 256)
+      {
+       dummy (s[i - 128][0]);
+       ++j;
+      }
+
+  return j;
+}
+
+int main(void)
+{
+  if (foo () != 128)
+    abort ();
+
+  return 0;
+}