annotate clang/test/Headers/sgxintrin.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 %s -ffreestanding -triple x86_64-unknown-unknown -target-feature +sgx -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-64
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 %s -ffreestanding -triple i386 -target-feature +sgx -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-32
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 #include <immintrin.h>
anatofuz
parents:
diff changeset
5 #include <stdint.h>
anatofuz
parents:
diff changeset
6 #include <stddef.h>
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 uint32_t test_encls(uint32_t leaf, size_t data[3]) {
anatofuz
parents:
diff changeset
9 // CHECK-64: call { i32, i64, i64, i64 } asm "encls", "={ax},={bx},={cx},={dx},{ax},{bx},{cx},{dx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
anatofuz
parents:
diff changeset
10 // CHECK-32: call { i32, i32, i32, i32 } asm "encls", "={ax},={bx},={cx},={dx},{ax},{bx},{cx},{dx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}})
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 return _encls_u32(leaf, data);
anatofuz
parents:
diff changeset
13 }
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 uint32_t test_enclu(uint32_t leaf, size_t data[3]) {
anatofuz
parents:
diff changeset
16 // CHECK-64: call { i32, i64, i64, i64 } asm "enclu", "={ax},={bx},={cx},={dx},{ax},{bx},{cx},{dx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
anatofuz
parents:
diff changeset
17 // CHECK-32: call { i32, i32, i32, i32 } asm "enclu", "={ax},={bx},={cx},={dx},{ax},{bx},{cx},{dx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}})
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 return _enclu_u32(leaf, data);
anatofuz
parents:
diff changeset
20 }
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 uint32_t test_enclv(uint32_t leaf, size_t data[3]) {
anatofuz
parents:
diff changeset
23 // CHECK-64: call { i32, i64, i64, i64 } asm "enclv", "={ax},={bx},={cx},={dx},{ax},{bx},{cx},{dx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}}, i64 %{{.*}}, i64 %{{.*}}, i64 %{{.*}})
anatofuz
parents:
diff changeset
24 // CHECK-32: call { i32, i32, i32, i32 } asm "enclv", "={ax},={bx},={cx},={dx},{ax},{bx},{cx},{dx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}})
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 return _enclv_u32(leaf, data);
anatofuz
parents:
diff changeset
27 }