1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fjump-tables" } */
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 void
bar(int i)14 bar (int i)
15 {
16   switch (i)
17     {
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;
36     }
37 }
38 
39 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */
40 /* { dg-final { scan-assembler {leaq[ \t]*L[0-9]+\(%rip\)} { target { lp64 && *-*-darwin* } } } } */
41 /* { dg-final { scan-assembler {addl[ \t]*L[0-9]+-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
42 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
43 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
44 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
45 /* { dg-final { scan-assembler {\tpause} } } */
46 /* { dg-final { scan-assembler {\tlfence} } } */
47