| 1 |
/* { dg-do compile { target aarch64-*-* } } */ |
| 2 |
/* { dg-additional-options "-O0" } */ |
| 3 |
|
| 4 |
/* |
| 5 |
When compiling __RTL functions the startwith string can be either incorrect |
| 6 |
(i.e. not matching a pass) or be unused (i.e. can refer to a pass that is |
| 7 |
not run at the current optimisation level). |
| 8 |
|
| 9 |
Here we ensure that the state clean up is still run, so that functions other |
| 10 |
than the faulty one can still be compiled. |
| 11 |
*/ |
| 12 |
|
| 13 |
int __RTL (startwith ("peephole2")) badfoo () |
| 14 |
{ |
| 15 |
(function "badfoo" |
| 16 |
(insn-chain |
| 17 |
(block 2 |
| 18 |
(edge-from entry (flags "FALLTHRU")) |
| 19 |
(cnote 3 [bb 2] NOTE_INSN_BASIC_BLOCK) |
| 20 |
(cinsn 101 (set (reg:DI x19) (reg:DI x0))) |
| 21 |
(cinsn 10 (use (reg/i:SI x19))) |
| 22 |
(edge-to exit (flags "FALLTHRU")) |
| 23 |
) ;; block 2 |
| 24 |
) ;; insn-chain |
| 25 |
) ;; function "foo2" |
| 26 |
} |
| 27 |
|
| 28 |
/* Compile a valid __RTL function to test state from the "dfinit" pass has been |
| 29 |
cleaned with the "dfinish" pass. */ |
| 30 |
|
| 31 |
int __RTL (startwith ("final")) foo2 () |
| 32 |
{ |
| 33 |
(function "foo2" |
| 34 |
(insn-chain |
| 35 |
(block 2 |
| 36 |
(edge-from entry (flags "FALLTHRU")) |
| 37 |
(cnote 3 [bb 2] NOTE_INSN_BASIC_BLOCK) |
| 38 |
(cinsn 101 (set (reg:DI x19) (reg:DI x0))) |
| 39 |
(cinsn 10 (use (reg/i:SI x19))) |
| 40 |
(edge-to exit (flags "FALLTHRU")) |
| 41 |
) ;; block 2 |
| 42 |
) ;; insn-chain |
| 43 |
) ;; function "foo2" |
| 44 |
} |
| 45 |
|