Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Unified Diff: gcc/gcc/testsuite/gcc.target/i386/pr12329.c

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/gcc/testsuite/gcc.target/i386/pic-1.c ('k') | gcc/gcc/testsuite/gcc.target/i386/pr13366.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/testsuite/gcc.target/i386/pr12329.c
diff --git a/gcc/gcc/testsuite/gcc.target/i386/pr12329.c b/gcc/gcc/testsuite/gcc.target/i386/pr12329.c
index 21d2c6580e20c15b5b3b9a5111ea06a34bfac4df..601480c028365f3bfc17f2a433611a9f839b9399 100644
--- a/gcc/gcc/testsuite/gcc.target/i386/pr12329.c
+++ b/gcc/gcc/testsuite/gcc.target/i386/pr12329.c
@@ -1,15 +1,47 @@
-/* { 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) /* { dg-error "nested functions are limited to 2 register parameters" } */
+ int __attribute__ ((__noinline__, __regparm__(3))) foo(int j, int k, int l)
{
return i + j + k + l;
}
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;
+}
« no previous file with comments | « gcc/gcc/testsuite/gcc.target/i386/pic-1.c ('k') | gcc/gcc/testsuite/gcc.target/i386/pr13366.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698