aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/rtm-builtins.c
blob: 5660d8e241430107145e0e02a42c871184afbee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +rtm -emit-llvm -o - | FileCheck %s

// Don't include mm_malloc.h, it's system specific.
#define __MM_MALLOC_H

#include <immintrin.h>

unsigned int test_xbegin(void) {
  // CHECK: i32 @llvm.x86.xbegin()
  return _xbegin();
}

void
test_xend(void) {
  // CHECK: void @llvm.x86.xend()
  _xend();
}

void
test_xabort(void) {
  // CHECK: void @llvm.x86.xabort(i8 2)
  _xabort(2);
}

unsigned int test_xtest(void) {
  // CHECK: i32 @llvm.x86.xtest()
  return _xtest();
}