Debian Codegraph @

gcc/testsuite/gcc.target/i386/indirect-thunk-attr-8.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk " } */
3 /* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */
4
5 void func0 (void);
6 void func1 (void);
7 void func2 (void);
8 void func3 (void);
9 void func4 (void);
10 void func4 (void);
11 void func5 (void);
12
13 __attribute__ ((indirect_branch("keep")))
14 void
15 bar (int i)
16 {
17 switch (i)
18 {
19 default:
20 func0 ();
21 break;
22 case 1:
23 func1 ();
24 break;
25 case 2:
26 func2 ();
27 break;
28 case 3:
29 func3 ();
30 break;
31 case 4:
32 func4 ();
33 break;
34 case 5:
35 func5 ();
36 break;
37 }
38 }
39
40 /* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */
41 /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
42 /* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
43 /* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */