1 /* { dg-do compile { target { ! x32 } } } */
2 /* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx" } */
3 /* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */
4 
5 void (*dispatch) (char *);
6 char buf[10];
7 
8 void
foo(void)9 foo (void)
10 {
11   dispatch (buf);
12 }
13 
14 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */
15 /* { dg-final { scan-assembler "bnd jmp\[ \t\]*_?__x86_indirect_thunk_bnd_rax" { target lp64 } } } */
16 /* { dg-final { scan-assembler "bnd call\[ \t\]*_?__x86_indirect_thunk_bnd_eax" { target ia32 } } } */
17 /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
18 /* { dg-final { scan-assembler "bnd call\[ \t\]*\.LIND" } } */
19 /* { dg-final { scan-assembler "bnd ret" } } */
20 /* { dg-final { scan-assembler {\tpause} } } */
21 /* { dg-final { scan-assembler {\tlfence} } } */
22