* gcc.dg/20020122-3.c: New test.
authorJanis Johnson <janis187@us.ibm.com>
Wed, 23 Jan 2002 18:54:27 +0000 (18:54 +0000)
committerJanis Johnson <janis@gcc.gnu.org>
Wed, 23 Jan 2002 18:54:27 +0000 (18:54 +0000)
From-SVN: r49148

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20020122-3.c [new file with mode: 0644]

index 22bc8a929c44d067580c803fb68ffcf170ea9ee1..7a338d12c38a384f122ba4e697e85c79bff5c67c 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-23  Janis Johnson  <janis187@us.ibm.com>
+
+       * gcc.dg/20020122-3.c: New.
+
 2002-01-23  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.dg/other/gc1.C: New test.
diff --git a/gcc/testsuite/gcc.dg/20020122-3.c b/gcc/testsuite/gcc.dg/20020122-3.c
new file mode 100644 (file)
index 0000000..42a4605
--- /dev/null
@@ -0,0 +1,15 @@
+/* Check that the combination of -Os and -fprefetch-loop-arrays does not
+   cause the compiler to crash, which it originally did on i?86.
+   Warnings are turned off because not all targets support prefetch.  */
+
+/* { dg-do compile } */
+/* { dg-options "-Os -fprefetch-loop-arrays -w" } */
+/* { dg-options "-Os -fprefetch-loop-arrays -mcpu=pentium3 -w" { target i?86-*-* } } */
+
+int foo (int *p, int n)
+{
+  int i, r;
+  for (i = 0; i < n; i++)
+    r += p[i];
+  return r;
+}