PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / indirect-thunk-attr-7.c
blobd53fc887dcc1eadbc44c4c89e33e6fc2d2375f0c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
4 void func0 (void);
5 void func1 (void);
6 void func2 (void);
7 void func3 (void);
8 void func4 (void);
9 void func4 (void);
10 void func5 (void);
12 __attribute__ ((indirect_branch("thunk-extern")))
13 void
14 bar (int i)
16 switch (i)
18 default:
19 func0 ();
20 break;
21 case 1:
22 func1 ();
23 break;
24 case 2:
25 func2 ();
26 break;
27 case 3:
28 func3 ();
29 break;
30 case 4:
31 func4 ();
32 break;
33 case 5:
34 func5 ();
35 break;
39 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */
40 /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */
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" } } */