aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/asm-3.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/asm-3.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-3.c
new file mode 100644
index 000000000..ec37898ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/asm-3.c
@@ -0,0 +1,35 @@
+/* PR inline-asm/6806 */
+/* { dg-do run } */
+/* { dg-skip-if "" { ia32 && { ! nonpic } } { "*" } { "" } } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+volatile int out = 1;
+volatile int a = 2;
+volatile int b = 4;
+volatile int c = 8;
+volatile int d = 16;
+volatile int e = 32;
+volatile int f = 64;
+
+int
+main ()
+{
+ asm volatile ("xorl %%eax, %%eax \n\t"
+ "xorl %%esi, %%esi \n\t"
+ "addl %1, %0 \n\t"
+ "addl %2, %0 \n\t"
+ "addl %3, %0 \n\t"
+ "addl %4, %0 \n\t"
+ "addl %5, %0 \n\t"
+ "addl %6, %0"
+ : "+r" (out)
+ : "r" (a), "r" (b), "r" (c), "g" (d), "g" (e), "g" (f)
+ : "%eax", "%esi");
+
+ if (out != 127)
+ abort ();
+
+ return 0;
+}