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