| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O3 -march=z10 --save-temps -mindirect-branch-table" } */ |
| 3 |
|
| 4 |
int gl = 0; |
| 5 |
|
| 6 |
int __attribute__((function_return_reg("thunk"),noinline,noclone)) |
| 7 |
bar (int a) |
| 8 |
{ |
| 9 |
return a + 2; |
| 10 |
} |
| 11 |
|
| 12 |
void __attribute__((noinline,noclone)) |
| 13 |
foo (int a) |
| 14 |
{ |
| 15 |
int i; |
| 16 |
|
| 17 |
if (a == 42) |
| 18 |
return; |
| 19 |
|
| 20 |
for (i = 0; i < a; i++) |
| 21 |
gl += bar (i); |
| 22 |
} |
| 23 |
|
| 24 |
int |
| 25 |
main () |
| 26 |
{ |
| 27 |
foo (3); |
| 28 |
if (gl != 9) |
| 29 |
__builtin_abort (); |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |
| 33 |
|
| 34 |
/* 1 x bar |
| 35 |
/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */ |
| 36 |
/* { dg-final { scan-assembler "exrl" } } */ |
| 37 |
|
| 38 |
/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ |
| 39 |
/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ |
| 40 |
/* { dg-final { scan-assembler "section\t.s390_return_reg" } } */ |
| 41 |
/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ |