]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.target/i386/cet-notrack-icf-3.c
Wrap option names in gcc internal messages with %< and %>.
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / cet-notrack-icf-3.c
CommitLineData
9091ccd2 1/* Verify nocf_check function calls are not ICF optimized. */
2/* { dg-do compile } */
b1384095 3/* { dg-options "-O2 -fcf-protection=none" } */
9091ccd2 4/* { dg-final { scan-assembler-not "endbr" } } */
5/* { dg-final { scan-assembler-not "fn2:" } } */
6/* { dg-final { scan-assembler "set\[ \t]+fn2,fn1" } } */
7/* { dg-final { scan-assembler "set\[ \t]+fn3,fn1" } } */
8
9int (*foo)(int);
10
2f6d557f 11typedef int (*type1_t) (int) __attribute__ ((nocf_check)); /* { dg-warning "'nocf_check' attribute ignored. Use '-fcf-protection' option to enable it" } */
9091ccd2 12typedef int (*type2_t) (int);
13
14static __attribute__((noinline)) int
15fn1 (int x)
16{
17 return ((type2_t)foo)(x + 12);
18}
19
20static __attribute__((noinline)) int
21fn2 (int x)
22{
23 return ((type1_t)foo)(x + 12);
24}
25
26static __attribute__((noinline)) int
27fn3 (int x)
28{
29 return ((type2_t)foo)(x + 12);
30}
31
32int
33fn4 (int x)
34{
35 return fn1 (x) + fn2 (x) + fn3 (x);
36}