2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / cet-notrack-5b.c
blob42d9d07b19d0b804f35af8bd82f101229ede9884
1 /* Check the attribute do not proparate through assignment. */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fcf-protection -mcet" } */
4 /* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
5 /* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
6 /* { dg-final { scan-assembler-times "\tcall\[ \t]+" 1 } } */
7 /* { dg-final { scan-assembler-times "notrack call\[ \t]+" 1 } } */
9 int (*fptr) (int) __attribute__ ((nocf_check));
10 int (*fptr1) (int);
12 int
13 foo (int arg)
15 int a;
16 a = (*fptr) (arg); /* non-checked call. */
17 arg += a;
18 fptr1 = fptr; /* { dg-warning "incompatible pointer type" } */
19 a = (*fptr1) (arg); /* checked call. */
20 return arg+a;