OSDN Git Service

2009-09-24 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Sep 2009 16:49:13 +0000 (16:49 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Sep 2009 16:49:13 +0000 (16:49 +0000)
* gcc.target/i386/pr12329.c (dg-do): Changed to run.
(test_nested): Renamed to ...
(test_nested1): This.
(test_nested2): New.
(main): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152126 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr12329.c

index bf75ec2..8e5395f 100644 (file)
@@ -1,3 +1,11 @@
+2009-09-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gcc.target/i386/pr12329.c (dg-do): Changed to run.
+       (test_nested): Renamed to ...
+       (test_nested1): This.
+       (test_nested2): New.
+       (main): Likewise.
+
 2009-09-24  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/36143
index c3d8a61..601480c 100644 (file)
@@ -1,10 +1,10 @@
-/* { dg-do compile } */
+/* { dg-do run } */
 /* { dg-require-effective-target ilp32 } */
 /* { dg-options "-O2" } */
 
 extern void abort (void);
 
-int test_nested (int i)
+int test_nested1 (int i)
 {
   int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l)
   {
@@ -13,3 +13,35 @@ int test_nested (int i)
 
   return foo (i, i+1, i+2);
 }
+
+int test_nested2 (int i)
+{
+  int x;
+
+  int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l)
+  {
+    return i + j + k + l;
+  }
+
+  x = foo (i+3, i+1, i+2);
+  if (x != (4*i + 6))
+    abort ();
+
+  return x;
+}
+
+int
+main ()
+{
+  int i = test_nested1 (3);
+
+  if (i != 15)
+    abort ();
+
+  i = test_nested2 (4);
+
+  if (i != 22)
+    abort ();
+
+  return 0;
+}