1 /* { dg-do run } */
2 /* { dg-options "-O3 -march=z900 --save-temps -mindirect-branch-jump=thunk -mindirect-branch-table" } */
3 /* { dg-require-effective-target label_values } */
4
5 /* This is a copy of the gcc.c-torture/execute/20040302-1.c
6 testcase. */
7
8 int code[]={0,0,0,0,1};
9
10 void
foo(int x)11 foo(int x) {
12 volatile int b;
13 b = 0xffffffff;
14 }
15
16 void
bar(int * pc)17 bar(int *pc) {
18 static const void *l[] = {&&lab0, &&end};
19
20 foo(0);
21 goto *l[*pc];
22 lab0:
23 foo(0);
24 pc++;
25 goto *l[*pc];
26 end:
27 return;
28 }
29
30 int
main()31 main() {
32 bar(code);
33 return 0;
34 }
35
36 /* 2 x bar
37 /* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */
38 /* { dg-final { scan-assembler "ex\t" } } */
39
40 /* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */
41 /* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */
42 /* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */
43 /* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */
44