diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/asm-pr24146.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/asm-pr24146.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/asm-pr24146.c b/gcc/testsuite/gcc.dg/asm-pr24146.c new file mode 100644 index 000000000..0b1be7da7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/asm-pr24146.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ + +/* Test that asm with no outputs are treated as volatile. */ + +void f(int x) +{ + __asm__ ("extended asm not discarded" : : "r" (x)); +} + +void g (void) +{ + __asm__ ("simple asm not discarded"); +} +/* { dg-final { scan-assembler "extended asm not discarded" } } */ +/* { dg-final { scan-assembler "simple asm not discarded" } } */ + |