aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/asm-5.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/asm-5.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-5.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-5.c
new file mode 100644
index 000000000..d41298023
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-5.c
@@ -0,0 +1,26 @@
+/* PR inline-asm/11676 */
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+static int bar(int x) __asm__("bar") __attribute__((regparm(1)));
+static int __attribute__((regparm(1), noinline, used))
+bar(int x)
+{
+ if (x != 0)
+ abort ();
+}
+
+static int __attribute__((regparm(1), noinline))
+foo(int x)
+{
+ x = 0;
+ __asm__ __volatile__("call bar" : "=a"(x) : "a"(x));
+}
+
+int main()
+{
+ foo(1);
+ return 0;
+}