diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/asm-5.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/asm-5.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/asm-5.c b/gcc/testsuite/gcc.target/i386/asm-5.c new file mode 100644 index 000000000..966a824b3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/asm-5.c @@ -0,0 +1,26 @@ +/* PR inline-asm/11676 */ +/* { dg-do run } */ +/* { dg-require-effective-target ilp32 } */ +/* { 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; +} |