1 ; RUN: llc -verify-machineinstrs -filetype=obj -o - -mtriple=x86_64-apple-macosx < %s | llvm-objdump -triple x86_64-apple-macosx -disassemble - | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mtriple=x86_64-apple-macosx < %s | FileCheck %s --check-prefix=CHECK-ALIGN
4 declare void @callee(i64*)
6 define void @f0() "patchable-function"="prologue-short-redirect" {
8 ; CHECK-NEXT: 66 90 nop
10 ; CHECK-ALIGN: .p2align 4, 0x90
16 define void @f1() "patchable-function"="prologue-short-redirect" "no-frame-pointer-elim"="true" {
18 ; CHECK-NEXT: ff f5 pushq %rbp
20 ; CHECK-ALIGN: .p2align 4, 0x90
25 define void @f2() "patchable-function"="prologue-short-redirect" {
27 ; CHECK-NEXT: 48 81 ec a8 00 00 00 subq $168, %rsp
29 ; CHECK-ALIGN: .p2align 4, 0x90
31 %ptr = alloca i64, i32 20
32 call void @callee(i64* %ptr)
36 define void @f3() "patchable-function"="prologue-short-redirect" optsize {
38 ; CHECK-NEXT: 66 90 nop
40 ; CHECK-ALIGN: .p2align 4, 0x90
45 ; This testcase happens to produce a KILL instruction at the beginning of the
46 ; first basic block. In this case the 2nd instruction should be turned into a
49 ; CHECK-NEXT: 8b 0c 37 movl (%rdi,%rsi), %ecx
50 define i32 @f4(i8* %arg1, i64 %arg2, i32 %arg3) "patchable-function"="prologue-short-redirect" {
52 %tmp10 = getelementptr i8, i8* %arg1, i64 %arg2
53 %tmp11 = bitcast i8* %tmp10 to i32*
54 %tmp12 = load i32, i32* %tmp11, align 4
56 %tmp13 = add i32 %tmp12, %arg3
57 %tmp14 = cmpxchg i32* %tmp11, i32 %tmp12, i32 %tmp13 seq_cst monotonic
58 %tmp15 = extractvalue { i32, i1 } %tmp14, 1
59 br i1 %tmp15, label %bb21, label %bb16
65 %tmp22 = phi i32 [ %tmp12, %bb ], [ %arg3, %bb16 ]