]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Mon, 20 Dec 2004 02:43:14 +0000 (02:43 +0000)
committerNo Author <no-author@gcc.gnu.org>
Mon, 20 Dec 2004 02:43:14 +0000 (02:43 +0000)
'gcc-3_3-branch'.

From-SVN: r92403

gcc/testsuite/g++.dg/opt/max1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/opt/max1.C b/gcc/testsuite/g++.dg/opt/max1.C
new file mode 100644 (file)
index 0000000..714116b
--- /dev/null
@@ -0,0 +1,29 @@
+/* PR middle-end/19068 */
+/* Test case by Andrew Pinski <pinskia@physics.uc.edu> */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern "C" void abort (void);
+
+long fff[10];
+
+void f(long a)
+{
+  int i;
+  a =  *((long*)(a+5)) >? *((long*)(a+1)); 
+
+  for(i=0;i<10;i++)
+   fff[i] = a;
+}
+
+int main(void)
+{
+  int i;
+  long a[2] = {10,5};
+  f((long)(&a)-1);
+  for(i = 0;i<10;i++)
+   if (fff[i]!=10)
+    abort ();
+  return 0;
+}
+