* gcc.target/i386/pr70021.c: Add -mtune=skylake.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sgx.c
blob42ad1fc8e66eb7a9b33974673ed08982880e9017
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -msgx" } */
3 /* { dg-final { scan-assembler-times "enclu" 2 } } */
4 /* { dg-final { scan-assembler-times "encls" 2 } } */
6 #include <x86intrin.h>
8 extern int leaf;
10 #define SGX_EENTER 0x02
11 #define SGX_EBLOCK 0x09
13 int foo ()
15 size_t test[3];
16 test[0] = 4;
17 test[1] = 5;
18 test[2] = 6;
19 int res1 = _encls_u32 (leaf, test);
20 int res2 = _enclu_u32 (leaf, test);
21 int res3 = _encls_u32 (SGX_EBLOCK, test);
22 int res4 = _enclu_u32 (SGX_EENTER, test);
23 return 0;