Debian Codegraph @

gcc/testsuite/gcc.target/i386/cet-intrin-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O -fcf-protection -mshstk" } */
3 /* { dg-final { scan-assembler-times "endbr32" 2 { target ia32 } } } */
4 /* { dg-final { scan-assembler-times "endbr64" 4 { target { ! ia32 } } } } */
5 /* { dg-final { scan-assembler "rdsspd|incsspd\[ \t]+(%|)eax" { target ia32 } } } */
6 /* { dg-final { scan-assembler "rdssp\[dq]\[ \t]+(%|)\[re]ax" { target { ! ia32 } } } } */
7 /* { dg-final { scan-assembler "incssp\[dq]\[ \t]+(%|)\[re]di" { target { ! ia32 } } } } */
8
9 #include <immintrin.h>
10
11 unsigned int f1 ()
12 {
13 return _get_ssp ();
14 }
15
16 void f3 (unsigned int _a)
17 {
18 _inc_ssp (_a);
19 }
20
21 #ifdef __x86_64__
22 unsigned long long f2 ()
23 {
24 return _get_ssp ();
25 }
26
27 void f4 (unsigned int _a)
28 {
29 _inc_ssp (_a);
30 }
31 #endif