gcc/testsuite/gcc.target/bpf/xbpf-indirect-call-1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-mxbpf -masm=normal" } */ |
| 3 | |
| 4 | /* GCC should generate an indirect call instruction (call %REG) |
| 5 | when targetting xBPF. */ |
| 6 | |
| 7 | void |
| 8 | foo () |
| 9 | { |
| 10 | ; |
| 11 | } |
| 12 | |
| 13 | void |
| 14 | bar() |
| 15 | { |
| 16 | void (*funp) () = &foo; |
| 17 | |
| 18 | (*funp) (); |
| 19 | } |
| 20 | |
| 21 | /* { dg-final { scan-assembler "call\t%r" } } */ |