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
16 ; X86: .LBB0_2: # %entry
17 ; X86-NEXT: # XABORT DEF
20 ; X64-LABEL: test_xbegin:
21 ; X64: # %bb.0: # %entry
22 ; X64-NEXT: xbegin .LBB0_2
23 ; X64-NEXT: # %bb.1: # %entry
24 ; X64-NEXT: movl $-1, %eax
25 ; X64: .LBB0_2: # %entry
26 ; X64-NEXT: # XABORT DEF
29 %0 = tail call i32 @llvm.x86.xbegin() nounwind
33 define void @test_xend() nounwind uwtable {
34 ; X86-LABEL: test_xend:
35 ; X86: # %bb.0: # %entry
39 ; X64-LABEL: test_xend:
40 ; X64: # %bb.0: # %entry
44 tail call void @llvm.x86.xend() nounwind
48 define void @test_xabort() nounwind uwtable {
49 ; X86-LABEL: test_xabort:
50 ; X86: # %bb.0: # %entry
54 ; X64-LABEL: test_xabort:
55 ; X64: # %bb.0: # %entry
59 tail call void @llvm.x86.xabort(i8 2)
63 define void @f2(i32 %x) nounwind uwtable {
65 ; X86: # %bb.0: # %entry
71 ; X64: # %bb.0: # %entry
72 ; X64-NEXT: pushq %rax
73 ; X64-NEXT: .cfi_def_cfa_offset 16
74 ; X64-NEXT: movl %edi, {{[0-9]+}}(%rsp)
78 ; X64-NEXT: .cfi_def_cfa_offset 8
81 %x.addr = alloca i32, align 4
82 store i32 %x, i32* %x.addr, align 4
83 call void @llvm.x86.xabort(i8 1)