1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-fcf-protection" } */
3 /* { dg-final { scan-assembler "endbr32|endbr64" } } */
4 /* { dg-final { scan-assembler-times "\tcall\[ \t]+puts" 2 } } */
5 /* { dg-final { scan-assembler-times "notrack call\[ \t]+" 1 } } */
9 virtual int foo() __attribute__((nocf_check)) { return 42; }
13 int foo() __attribute__((nocf_check)) { return 73; }
19 int (A::*amem) () __attribute__((nocf_check)) = &A::foo; // take address
20 if ((a.*amem)() == 73) // use the address