diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/local.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/local.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/local.c b/gcc/testsuite/gcc.target/i386/local.c new file mode 100644 index 000000000..4cb5c81eb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/local.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -funit-at-a-time" } */ +/* { dg-final { scan-assembler "magic\[^\\n\]*eax" { target ilp32 } } } */ +/* { dg-final { scan-assembler "magic\[^\\n\]*edi" { target lp64 } } } */ + +/* Verify that local calling convention is used. */ +static t(int) __attribute__ ((noinline)); +extern volatile int i; + +void m(void) +{ + t(i); +} + +static t(int a) +{ + asm("magic %0"::"g"(a)); +} |