PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pic-1.c
blob25b8aae9e80ebe8c77f788e3e8ec420551eb8374
1 /* PR target/8340 */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target ia32 } */
4 /* { dg-require-effective-target fpic } */
5 /* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } } */
6 /* { dg-options "-fPIC" } */
8 /* Test verifies that %ebx is no longer fixed when generating PIC code on i686. */
10 int foo ()
12 static int a;
14 __asm__ __volatile__ (
15 "xorl %%ebx, %%ebx\n"
16 "movl %%ebx, %0\n"
17 : "=m" (a)
19 : "%ebx"
22 return a;