43 changes: 43 additions & 0 deletions llvm/test/CodeGen/X86/patchable-prologue.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
; RUN: llc -filetype=obj -o - -mtriple=x86_64-apple-macosx < %s | llvm-objdump -triple x86_64-apple-macosx -disassemble - | FileCheck %s
; RUN: llc -mtriple=x86_64-apple-macosx < %s | FileCheck %s --check-prefix=CHECK-ALIGN

declare void @callee(i64*)

define void @f0() "patchable-function"="prologue-short-redirect" {
; CHECK-LABEL: _f0:
; CHECK-NEXT: 66 90 nop

; CHECK-ALIGN: .p2align 4, 0x90
; CHECK-ALIGN: _f0:

ret void
}

define void @f1() "patchable-function"="prologue-short-redirect" "no-frame-pointer-elim"="true" {
; CHECK-LABEL: _f1
; CHECK-NEXT: ff f5 pushq %rbp

; CHECK-ALIGN: .p2align 4, 0x90
; CHECK-ALIGN: _f1:
ret void
}

define void @f2() "patchable-function"="prologue-short-redirect" {
; CHECK-LABEL: _f2
; CHECK-NEXT: 48 81 ec a8 00 00 00 subq $168, %rsp

; CHECK-ALIGN: .p2align 4, 0x90
; CHECK-ALIGN: _f2:
%ptr = alloca i64, i32 20
call void @callee(i64* %ptr)
ret void
}

define void @f3() "patchable-function"="prologue-short-redirect" optsize {
; CHECK-LABEL: _f3
; CHECK-NEXT: 66 90 nop

; CHECK-ALIGN: .p2align 4, 0x90
; CHECK-ALIGN: _f3:
ret void
}
4 changes: 2 additions & 2 deletions llvm/test/TableGen/trydecode-emission.td
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def InstB : TestInstruction {
// CHECK: /* 0 */ MCD::OPC_ExtractField, 4, 4, // Inst{7-4} ...
// CHECK-NEXT: /* 3 */ MCD::OPC_FilterValue, 0, 14, 0, // Skip to: 21
// CHECK-NEXT: /* 7 */ MCD::OPC_CheckField, 2, 2, 0, 5, 0, // Skip to: 18
// CHECK-NEXT: /* 13 */ MCD::OPC_TryDecode, 26, 0, 0, 0, // Opcode: InstB, skip to: 18
// CHECK-NEXT: /* 18 */ MCD::OPC_Decode, 25, 1, // Opcode: InstA
// CHECK-NEXT: /* 13 */ MCD::OPC_TryDecode, 27, 0, 0, 0, // Opcode: InstB, skip to: 18
// CHECK-NEXT: /* 18 */ MCD::OPC_Decode, 26, 1, // Opcode: InstA
// CHECK-NEXT: /* 21 */ MCD::OPC_Fail,

// CHECK: if (DecodeInstB(MI, insn, Address, Decoder) == MCDisassembler::Fail) { DecodeComplete = false; return MCDisassembler::Fail; }
4 changes: 2 additions & 2 deletions llvm/test/TableGen/trydecode-emission2.td
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def InstB : TestInstruction {
// CHECK-NEXT: /* 7 */ MCD::OPC_ExtractField, 5, 3, // Inst{7-5} ...
// CHECK-NEXT: /* 10 */ MCD::OPC_FilterValue, 0, 22, 0, // Skip to: 36
// CHECK-NEXT: /* 14 */ MCD::OPC_CheckField, 0, 2, 3, 5, 0, // Skip to: 25
// CHECK-NEXT: /* 20 */ MCD::OPC_TryDecode, 26, 0, 0, 0, // Opcode: InstB, skip to: 25
// CHECK-NEXT: /* 20 */ MCD::OPC_TryDecode, 27, 0, 0, 0, // Opcode: InstB, skip to: 25
// CHECK-NEXT: /* 25 */ MCD::OPC_CheckField, 3, 2, 0, 5, 0, // Skip to: 36
// CHECK-NEXT: /* 31 */ MCD::OPC_TryDecode, 25, 1, 0, 0, // Opcode: InstA, skip to: 36
// CHECK-NEXT: /* 31 */ MCD::OPC_TryDecode, 26, 1, 0, 0, // Opcode: InstA, skip to: 36
// CHECK-NEXT: /* 36 */ MCD::OPC_Fail,

// CHECK: if (DecodeInstB(MI, insn, Address, Decoder) == MCDisassembler::Fail) { DecodeComplete = false; return MCDisassembler::Fail; }
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/TableGen/trydecode-emission3.td
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def InstB : TestInstruction {
// CHECK: /* 0 */ MCD::OPC_ExtractField, 4, 4, // Inst{7-4} ...
// CHECK-NEXT: /* 3 */ MCD::OPC_FilterValue, 0, 14, 0, // Skip to: 21
// CHECK-NEXT: /* 7 */ MCD::OPC_CheckField, 2, 2, 0, 5, 0, // Skip to: 18
// CHECK-NEXT: /* 13 */ MCD::OPC_TryDecode, 26, 0, 0, 0, // Opcode: InstB, skip to: 18
// CHECK-NEXT: /* 18 */ MCD::OPC_Decode, 25, 1, // Opcode: InstA
// CHECK-NEXT: /* 13 */ MCD::OPC_TryDecode, 27, 0, 0, 0, // Opcode: InstB, skip to: 18
// CHECK-NEXT: /* 18 */ MCD::OPC_Decode, 26, 1, // Opcode: InstA
// CHECK-NEXT: /* 21 */ MCD::OPC_Fail,

// CHECK: if (DecodeInstBOp(MI, tmp, Address, Decoder) == MCDisassembler::Fail) { DecodeComplete = false; return MCDisassembler::Fail; }