1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=i686-unknown-unknown -mattr=+rtm | FileCheck %s --check-prefix=X86
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=x86_64-unknown-unknown -mattr=+rtm | FileCheck %s --check-prefix=X64
5 declare i32 @llvm.x86.xbegin() nounwind
6 declare void @llvm.x86.xend() nounwind
7 declare void @llvm.x86.xabort(i8) nounwind
10 define i32 @test_xbegin() nounwind uwtable {
11 ; X86-LABEL: test_xbegin:
12 ; X86: # %bb.0: # %entry
13 ; X86-NEXT: xbegin .LBB0_2
14 ; X86-NEXT: # %bb.1: # %entry
15 ; X86-NEXT: movl $-1, %eax
17 ; X86-NEXT: .LBB0_2: # %entry
18 ; X86-NEXT: # XABORT DEF
21 ; X64-LABEL: test_xbegin:
22 ; X64: # %bb.0: # %entry
23 ; X64-NEXT: xbegin .LBB0_2
24 ; X64-NEXT: # %bb.1: # %entry
25 ; X64-NEXT: movl $-1, %eax
27 ; X64-NEXT: .LBB0_2: # %entry
28 ; X64-NEXT: # XABORT DEF
31 %0 = tail call i32 @llvm.x86.xbegin() nounwind
35 define void @test_xend() nounwind uwtable {
36 ; X86-LABEL: test_xend:
37 ; X86: # %bb.0: # %entry
41 ; X64-LABEL: test_xend:
42 ; X64: # %bb.0: # %entry
46 tail call void @llvm.x86.xend() nounwind
50 define void @test_xabort() nounwind uwtable {
51 ; X86-LABEL: test_xabort:
52 ; X86: # %bb.0: # %entry
56 ; X64-LABEL: test_xabort:
57 ; X64: # %bb.0: # %entry
61 tail call void @llvm.x86.xabort(i8 2)
65 define void @f2(i32 %x) nounwind uwtable {
67 ; X86: # %bb.0: # %entry
69 ; X86-NEXT: calll f1@PLT
73 ; X64: # %bb.0: # %entry
74 ; X64-NEXT: pushq %rax
75 ; X64-NEXT: .cfi_def_cfa_offset 16
76 ; X64-NEXT: movl %edi, {{[0-9]+}}(%rsp)
78 ; X64-NEXT: callq f1@PLT
80 ; X64-NEXT: .cfi_def_cfa_offset 8
83 %x.addr = alloca i32, align 4
84 store i32 %x, ptr %x.addr, align 4
85 call void @llvm.x86.xabort(i8 1)