Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / nobp-return-reg-mixed.c
blob82833f7e0d7b9c91fe6f16ee801c003f3619d67e
1 /* { dg-do run } */
2 /* { dg-options "-O3 -march=z900 --save-temps -mfunction-return-reg=thunk -mindirect-branch-table" } */
4 /* We have to generate different thunks for indirect branches
5 depending on whether the code is compiled for pre z10 machines or
6 later. This testcase makes sure this works within the same compile
7 unit. */
9 int __attribute__((noinline,noclone,target("arch=z10")))
10 bar (int a)
12 return a + 2;
15 int __attribute__((noinline,noclone,target("arch=z9-ec")))
16 foo (int a)
18 return a + 3;
21 int
22 main ()
24 if (bar (42) != 44)
25 __builtin_abort ();
27 if (foo (42) != 45)
28 __builtin_abort ();
30 return 0;
33 /* 1 x bar, 1 x foo */
34 /* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */
35 /* 1 x foo */
36 /* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump_r1use" 1 } } */
38 /* { dg-final { scan-assembler-times "ex\t" 1 } } */
39 /* { dg-final { scan-assembler-times "exrl\t" 1 } } */
41 /* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */
42 /* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */
43 /* { dg-final { scan-assembler "section\t.s390_return_reg" } } */
44 /* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */