OSDN Git Service

New test.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Apr 2003 22:16:06 +0000 (22:16 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Apr 2003 22:16:06 +0000 (22:16 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65439 138bc75d-0d04-0410-961f-82ee72b054a4

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

diff --git a/gcc/testsuite/g++.dg/opt/reload2.C b/gcc/testsuite/g++.dg/opt/reload2.C
new file mode 100644 (file)
index 0000000..1af8aea
--- /dev/null
@@ -0,0 +1,42 @@
+// PR 10352
+// { dg-do compile }
+// { dg-options -O2 }
+
+extern double fabs(double x);
+
+typedef struct { float x, y; } S;
+typedef struct _T T;
+
+extern void fT( T *p );
+extern T *h();
+extern S g( );
+
+static
+int f(void)
+{
+    T *t=0;
+    int c=0;
+    S s;
+
+    const S exp_s = {0.,0.};
+
+    if(!(t = h()))
+    {
+        c++;
+    }
+
+    if(!c)
+    {
+        s = g();
+        if( (fabs( (s.x) - (exp_s.x) ) > 1 )
+            || (fabs( (s.y) - (exp_s.y) ) > 1 ) )
+        {
+            c++;
+        }
+    }
+
+    if(t)
+        fT(t);
+
+    return c;
+}