1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +rtm -emit-llvm -o - | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc // Don't include mm_malloc.h, it's system specific. 4*f4a2713aSLionel Sambuc #define __MM_MALLOC_H 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc #include <immintrin.h> 7*f4a2713aSLionel Sambuc test_xbegin(void)8*f4a2713aSLionel Sambucunsigned int test_xbegin(void) { 9*f4a2713aSLionel Sambuc // CHECK: i32 @llvm.x86.xbegin() 10*f4a2713aSLionel Sambuc return _xbegin(); 11*f4a2713aSLionel Sambuc } 12*f4a2713aSLionel Sambuc 13*f4a2713aSLionel Sambuc void test_xend(void)14*f4a2713aSLionel Sambuctest_xend(void) { 15*f4a2713aSLionel Sambuc // CHECK: void @llvm.x86.xend() 16*f4a2713aSLionel Sambuc _xend(); 17*f4a2713aSLionel Sambuc } 18*f4a2713aSLionel Sambuc 19*f4a2713aSLionel Sambuc void test_xabort(void)20*f4a2713aSLionel Sambuctest_xabort(void) { 21*f4a2713aSLionel Sambuc // CHECK: void @llvm.x86.xabort(i8 2) 22*f4a2713aSLionel Sambuc _xabort(2); 23*f4a2713aSLionel Sambuc } 24*f4a2713aSLionel Sambuc test_xtest(void)25*f4a2713aSLionel Sambucunsigned int test_xtest(void) { 26*f4a2713aSLionel Sambuc // CHECK: i32 @llvm.x86.xtest() 27*f4a2713aSLionel Sambuc return _xtest(); 28*f4a2713aSLionel Sambuc } 29