2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / nobp-indirect-jump-inline-attr.c
blob63d64c15941ce92705d0c3b0875fa7c3847fcfe0
1 /* { dg-do run } */
2 /* { dg-options "-O3 -march=z10 --save-temps -mindirect-branch-table" } */
3 /* { dg-require-effective-target label_values } */
5 /* This is a copy of the gcc.c-torture/execute/20040302-1.c
6 testcase. */
8 int code[]={0,0,0,0,1};
10 void foo(int x) {
11 volatile int b;
12 b = 0xffffffff;
15 void __attribute__((indirect_branch_jump("thunk-inline")))
16 bar(int *pc) {
17 static const void *l[] = {&&lab0, &&end};
19 foo(0);
20 goto *l[*pc];
21 lab0:
22 foo(0);
23 pc++;
24 goto *l[*pc];
25 end:
26 return;
29 int
30 main() {
31 bar(code);
32 return 0;
35 /* The two gotos in bar get merged. */
36 /* { dg-final { scan-assembler-times "exrl" 1 } } */
38 /* { dg-final { scan-assembler-not "jg\t__s390_indirect_jump" } } */
39 /* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */
40 /* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */
41 /* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */
42 /* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */