Debian Codegraph @

gcc/testsuite/gcc.target/arm/thumb1-far-jump-2.c

raw
1 /* Check for thumb1 far jump. This is the extreme case that far jump
2 * will be used with minimum number of instructions. By passing this case
3 * it means the heuristic of saving lr for far jump meets the most extreme
4 * requirement. */
5 /* { dg-options "-Os" } */
6 /* { dg-skip-if "" { ! { arm_thumb1 } } } */
7
8 volatile int r4;
9
10 #define GO() \
11 r4 = 1;
12
13 #define GO8() \
14 GO() \
15 GO() \
16 GO() \
17 GO() \
18 GO() \
19 GO() \
20 GO() \
21 GO()
22
23 #define GO32() \
24 GO8() \
25 GO8() \
26 GO8() \
27 GO8()
28
29 #define GO128() \
30 GO32() \
31 GO32() \
32 GO32() \
33 GO32()
34
35 #define GO512() \
36 GO128() \
37 GO128() \
38 GO128() \
39 GO128()
40
41 #define GO1018() \
42 GO512() \
43 GO128() \
44 GO128() \
45 GO128() \
46 GO32() \
47 GO32() \
48 GO32() \
49 GO8() \
50 GO8() \
51 GO8() \
52 GO() \
53 GO()
54
55 void f3(int i)
56 {
57 GO();
58 if (i) {
59 GO1018();
60 }
61 }
62
63 /* { dg-final { scan-assembler "\tpush.*lr" } } */
64 /* { dg-final { scan-assembler "\tbl\t\\.L\[0-9\]+\t@far jump" } } */