1 // RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +lwp -emit-llvm -o - -Wall -Werror | FileCheck %s
2
3 #include <x86intrin.h>
4
test_llwpcb(void * ptr)5 void test_llwpcb(void *ptr) {
6 // CHECK-LABEL: @test_llwpcb
7 // CHECK: call void @llvm.x86.llwpcb(i8* %{{.*}})
8 __llwpcb(ptr);
9 }
10
test_slwpcb()11 void* test_slwpcb() {
12 // CHECK-LABEL: @test_slwpcb
13 // CHECK: call i8* @llvm.x86.slwpcb()
14 return __slwpcb();
15 }
16
test_lwpins32(unsigned val2,unsigned val1)17 unsigned char test_lwpins32(unsigned val2, unsigned val1) {
18 // CHECK-LABEL: @test_lwpins32
19 // CHECK: call i8 @llvm.x86.lwpins32(i32
20 return __lwpins32(val2, val1, 0x01234);
21 }
22
test_lwpins64(unsigned long long val2,unsigned val1)23 unsigned char test_lwpins64(unsigned long long val2, unsigned val1) {
24 // CHECK-LABEL: @test_lwpins64
25 // CHECK: call i8 @llvm.x86.lwpins64(i64
26 return __lwpins64(val2, val1, 0x56789);
27 }
28
test_lwpval32(unsigned val2,unsigned val1)29 void test_lwpval32(unsigned val2, unsigned val1) {
30 // CHECK-LABEL: @test_lwpval32
31 // CHECK: call void @llvm.x86.lwpval32(i32
32 __lwpval32(val2, val1, 0x01234);
33 }
34
test_lwpval64(unsigned long long val2,unsigned val1)35 void test_lwpval64(unsigned long long val2, unsigned val1) {
36 // CHECK-LABEL: @test_lwpval64
37 // CHECK: call void @llvm.x86.lwpval64(i64
38 __lwpval64(val2, val1, 0xABCDEF);
39 }
40