2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / nobp-indirect-jump-nothunk.c
blob05c8bb8c12d929c4861e995c4ca57f499fb4293a
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -march=z10 --save-temps -mindirect-branch-jump=thunk-extern -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
11 foo(int x) {
12 volatile int b;
13 b = 0xffffffff;
16 void
17 bar(int *pc) {
18 static const void *l[] = {&&lab0, &&end};
20 foo(0);
21 goto *l[*pc];
22 lab0:
23 foo(0);
24 pc++;
25 goto *l[*pc];
26 end:
27 return;
30 int
31 main() {
32 bar(code);
33 return 0;
36 /* 2 x bar
37 /* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */
39 /* No thunks due to thunk-extern. */
40 /* { dg-final { scan-assembler-not "exrl" } } */
41 /* { dg-final { scan-assembler-not ".globl __s390_indirect_jump" } } */
43 /* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */
44 /* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */
45 /* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */
46 /* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */