1 // RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +fsgsbase -emit-llvm -o - | FileCheck %s 2 3 4 #include <immintrin.h> 5 test_readfsbase_u32()6unsigned int test_readfsbase_u32() 7 { 8 // CHECK: @llvm.x86.rdfsbase.32 9 return _readfsbase_u32(); 10 } 11 test_readfsbase_u64()12unsigned long long test_readfsbase_u64() 13 { 14 // CHECK: @llvm.x86.rdfsbase.64 15 return _readfsbase_u64(); 16 } 17 test_readgsbase_u32()18unsigned int test_readgsbase_u32() 19 { 20 // CHECK: @llvm.x86.rdgsbase.32 21 return _readgsbase_u32(); 22 } 23 test_readgsbase_u64()24unsigned long long test_readgsbase_u64() 25 { 26 // CHECK: @llvm.x86.rdgsbase.64 27 return _readgsbase_u64(); 28 } 29 test_writefsbase_u32(unsigned int __X)30void test_writefsbase_u32(unsigned int __X) 31 { 32 // CHECK: @llvm.x86.wrfsbase.32 33 _writefsbase_u32(__X); 34 } 35 test_writefsbase_u64(unsigned long long __X)36void test_writefsbase_u64(unsigned long long __X) 37 { 38 // CHECK: @llvm.x86.wrfsbase.64 39 _writefsbase_u64(__X); 40 } 41 test_writegsbase_u32(unsigned int __X)42void test_writegsbase_u32(unsigned int __X) 43 { 44 // CHECK: @llvm.x86.wrgsbase.32 45 _writegsbase_u32(__X); 46 } 47 test_writegsbase_u64(unsigned long long __X)48void test_writegsbase_u64(unsigned long long __X) 49 { 50 // CHECK: @llvm.x86.wrgsbase.64 51 _writegsbase_u64(__X); 52 } 53