diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pic-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pic-1.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pic-1.c b/gcc/testsuite/gcc.target/i386/pic-1.c new file mode 100644 index 000000000..bdf6267c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pic-1.c @@ -0,0 +1,21 @@ +/* PR target/8340 */ +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-require-effective-target fpic } */ +/* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } */ +/* { dg-options "-fPIC" } */ + +int foo () +{ + static int a; + + __asm__ __volatile__ ( /* { dg-error "PIC register" } */ + "xorl %%ebx, %%ebx\n" + "movl %%ebx, %0\n" + : "=m" (a) + : + : "%ebx" + ); + + return a; +} |