gcc/testsuite/gcc.target/sh/force-cbranch-delay-slot.c
raw| 1 | /* Check that the option -mcbranch-force-delay-slot works as expected on |
| 2 | targets other than SH1, and that it compiles on SH1 targets without fuzz. */ |
| 3 | /* { dg-do compile } */ |
| 4 | /* { dg-options "-O2 -mcbranch-force-delay-slot" } */ |
| 5 | /* { dg-final { scan-assembler-times "nop" 2 { target { ! sh1 } } } } */ |
| 6 | |
| 7 | int g (int, int); |
| 8 | |
| 9 | int |
| 10 | f (int a, int b) |
| 11 | { |
| 12 | /* Expected: 1x bt/s, 1x nop. */ |
| 13 | if (a != 5) |
| 14 | a = 10; |
| 15 | |
| 16 | /* Expected: 1x jmp, 1x nop. */ |
| 17 | return g (a, b); |
| 18 | } |