1 | // RUN: %clang_cc1 %s -ffreestanding -triple x86_64-unknown-unknown -emit-llvm -target-feature +waitpkg -Wall -pedantic -o - | FileCheck %s |
2 | // RUN: %clang_cc1 %s -ffreestanding -triple i386-unknown-unknown -emit-llvm -target-feature +waitpkg -Wall -pedantic -o - | FileCheck %s |
3 | |
4 | #include <immintrin.h> |
5 | |
6 | #include <stddef.h> |
7 | #include <stdint.h> |
8 | |
9 | void test_umonitor(void *address) { |
10 | //CHECK-LABEL: @test_umonitor |
11 | //CHECK: call void @llvm.x86.umonitor(i8* %{{.*}}) |
12 | return _umonitor(address); |
13 | } |
14 | |
15 | uint8_t test_umwait(uint32_t control, uint64_t counter) { |
16 | //CHECK-LABEL: @test_umwait |
17 | //CHECK: call i8 @llvm.x86.umwait(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) |
18 | return _umwait(control, counter); |
19 | } |
20 | |
21 | uint8_t test_tpause(uint32_t control, uint64_t counter) { |
22 | //CHECK-LABEL: @test_tpause |
23 | //CHECK: call i8 @llvm.x86.tpause(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}) |
24 | return _tpause(control, counter); |
25 | } |
26 | |