PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / nobp-return-attr-all.c
blob4bf88cf78c2af0ceadb0298e02be9bbfaf8b10f7
1 /* { dg-do run } */
2 /* { dg-options "-O3 -march=z10 -mzarch --save-temps -mindirect-branch-table" } */
4 int gl = 0;
6 int __attribute__((noinline,noclone))
7 bar (int a)
9 return a + 2;
12 void __attribute__((function_return("thunk"),noinline,noclone))
13 foo (int a)
15 int i;
17 if (a == 42)
18 return;
20 for (i = 0; i < a; i++)
21 gl += bar (i);
24 int
25 main ()
27 foo (3);
28 if (gl != 9)
29 __builtin_abort ();
31 return 0;
34 /* With -march=z10 -mzarch the shrink wrapped returns use compare and
35 swap relative to jump to the exit block instead of making use of
36 the conditional return pattern.
37 FIXME: Use compare and branch register for that!!!! */
39 /* 2 x foo
40 /* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */
41 /* { dg-final { scan-assembler "exrl" } } */
43 /* { dg-final { scan-assembler-not "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 "section\t.s390_return_mem" } } */