diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/i386-asm-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/i386-asm-1.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/i386-asm-1.c b/gcc/testsuite/gcc.dg/i386-asm-1.c new file mode 100644 index 00000000000..aae0de845b3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/i386-asm-1.c @@ -0,0 +1,24 @@ +/* PR inline-asm/11676 */ +/* { dg-do run { target i?86-*-* } } */ +/* { dg-options "-O2" } */ + +static int bar(int x) __asm__("bar"); +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; +} |