diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/insn-pseudo-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/mips/insn-pseudo-1.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/insn-pseudo-1.c b/gcc/testsuite/gcc.target/mips/insn-pseudo-1.c new file mode 100644 index 0000000..4250195 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/insn-pseudo-1.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-micromips -mno-mips16" } */ + +void +unreachable (int i) +{ + asm volatile goto ("b\t.\n\tbeqz\t%0,%l1" : : "r" (i) : : punt); +punt: + __builtin_unreachable (); +} + +/* Expect assembly like: + + beqz $4,$L2 + # Anything goes here. +$L2: # The label must match. + .insn +$L3 = . # It's there, but we don't care. + .end unreachable + + that is .insn to be inserted if a code label is at function's end. */ + +/* { dg-final { scan-assembler "\tbeqz\t\\\$\[0-9\]+,(.L\[0-9\]+)\n.*\n\\1:\n\t\\.insn\n(?:.L\[0-9\]+ = \\.\n)?\t\\.end\tunreachable\n" } } */ |