summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/waitpkg.c
diff options
context:
space:
mode:
authorGabor Buella <gabor.buella@intel.com>2018-04-20 18:44:33 +0000
committerGabor Buella <gabor.buella@intel.com>2018-04-20 18:44:33 +0000
commiteba6c42e66c0b438e371df9cfbbc722126509917 (patch)
treeaf9d3019b2760d663f28aefee8b110c9f58c3ed9 /clang/test/CodeGen/waitpkg.c
parent31fa8025ba5143cdb2804e637dd5f3e3cd2e1c26 (diff)
downloadbcm5719-llvm-eba6c42e66c0b438e371df9cfbbc722126509917.tar.gz
bcm5719-llvm-eba6c42e66c0b438e371df9cfbbc722126509917.zip
[X86] WaitPKG intrinsics
Reviewers: craig.topper, zvi Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D45254 llvm-svn: 330463
Diffstat (limited to 'clang/test/CodeGen/waitpkg.c')
-rw-r--r--clang/test/CodeGen/waitpkg.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/CodeGen/waitpkg.c b/clang/test/CodeGen/waitpkg.c
new file mode 100644
index 00000000000..e4ac1cd6636
--- /dev/null
+++ b/clang/test/CodeGen/waitpkg.c
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 %s -ffreestanding -triple x86_64-unknown-unknown -emit-llvm -target-feature +waitpkg -Wall -pedantic -o - | FileCheck %s
+// RUN: %clang_cc1 %s -ffreestanding -triple i386-unknown-unknown -emit-llvm -target-feature +waitpkg -Wall -pedantic -o - | FileCheck %s
+
+#include <x86intrin.h>
+
+#include <stddef.h>
+#include <stdint.h>
+
+void test_umonitor(void *address) {
+ //CHECK-LABEL: @test_umonitor
+ //CHECK: call void @llvm.x86.umonitor(i8* %{{.*}})
+ return _umonitor(address);
+}
+
+uint8_t test_umwait(uint32_t control, uint64_t counter) {
+ //CHECK-LABEL: @test_umwait
+ //CHECK: call i8 @llvm.x86.umwait(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}})
+ return _umwait(control, counter);
+}
+
+uint8_t test_tpause(uint32_t control, uint64_t counter) {
+ //CHECK-LABEL: @test_tpause
+ //CHECK: call i8 @llvm.x86.tpause(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}})
+ return _tpause(control, counter);
+}
OpenPOWER on IntegriCloud