mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
3f38e31261
The BKPT instruction is specified to cause a software breakpoint, and at least on Linux results in a SIGTRAP. This makes it more suitable for implementing debugtrap than TRAP (aka UDF #254), which is specified to cause an undefined instruction exception and results in a SIGILL on Linux. Moreover, BKPT is not marked as a terminator, which is not only consistent with the IR instruction but allows the analyzeBlock function to correctly analyze a basic block containing the instruction, which fixes an assertion failure in the machine block placement pass previously triggered by the included test case. Because BKPT is only supported starting with ARMv5T, we continue to use UDF #254 when targeting v4T. Differential Revision: https://reviews.llvm.org/D53614 llvm-svn: 345171
88 lines
2.4 KiB
LLVM
88 lines
2.4 KiB
LLVM
; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s -check-prefix=DARWIN
|
|
; RUN: llc < %s -mtriple=arm-apple-darwin -trap-func=_trap | FileCheck %s -check-prefix=FUNC
|
|
; RUN: llc < %s -mtriple=arm-apple-darwin -trap-func=_trap -O0 | FileCheck %s -check-prefix=FUNC
|
|
; RUN: llc < %s -mtriple=armv7 -mattr=+nacl-trap | FileCheck %s -check-prefix=NACL
|
|
; RUN: llc < %s -mtriple=armv7 | FileCheck %s -check-prefix=ARM
|
|
; RUN: llc < %s -mtriple=thumbv7 | FileCheck %s -check-prefix=THUMB
|
|
|
|
; RUN: llc -mtriple=armv7 -mattr=+nacl-trap -filetype=obj %s -o - \
|
|
; RUN: | llvm-objdump -disassemble -triple armv7 -mattr=+nacl-trap - \
|
|
; RUN: | FileCheck %s -check-prefix=ENCODING-NACL
|
|
; RUN: llc -verify-machineinstrs -fast-isel -mtriple=armv7 -mattr=+nacl-trap -filetype=obj %s -o - \
|
|
; RUN: | llvm-objdump -disassemble -triple armv7 -mattr=+nacl-trap - \
|
|
; RUN: | FileCheck %s -check-prefix=ENCODING-NACL
|
|
|
|
; RUN: llc -mtriple=armv7 -filetype=obj %s -o - \
|
|
; RUN: | llvm-objdump -disassemble -triple armv7 - \
|
|
; RUN: | FileCheck %s -check-prefix=ENCODING-ARM
|
|
; RUN: llc -verify-machineinstrs -fast-isel -mtriple=armv7 -filetype=obj %s -o - \
|
|
; RUN: | llvm-objdump -disassemble -triple armv7 - \
|
|
; RUN: | FileCheck %s -check-prefix=ENCODING-ARM
|
|
|
|
; RUN: llc -mtriple=thumbv7 -filetype=obj %s -o - \
|
|
; RUN: | llvm-objdump -disassemble -triple thumbv7 - \
|
|
; RUN: | FileCheck %s -check-prefix=ENCODING-THUMB
|
|
; RUN: llc -verify-machineinstrs -fast-isel -mtriple=thumbv7 -filetype=obj %s -o - \
|
|
; RUN: | llvm-objdump -disassemble -triple thumbv7 - \
|
|
; RUN: | FileCheck %s -check-prefix=ENCODING-THUMB
|
|
|
|
; rdar://7961298
|
|
; rdar://9249183
|
|
|
|
define void @t() nounwind {
|
|
entry:
|
|
; DARWIN-LABEL: t:
|
|
; DARWIN: trap
|
|
|
|
; FUNC-LABEL: t:
|
|
; FUNC: bl __trap
|
|
|
|
; NACL-LABEL: t:
|
|
; NACL: .inst 0xe7fedef0
|
|
|
|
; ARM-LABEL: t:
|
|
; ARM: .inst 0xe7ffdefe
|
|
|
|
; THUMB-LABEL: t:
|
|
; THUMB: .inst.n 0xdefe
|
|
|
|
; ENCODING-NACL: f0 de fe e7 trap
|
|
|
|
; ENCODING-ARM: fe de ff e7 trap
|
|
|
|
; ENCODING-THUMB: fe de trap
|
|
|
|
call void @llvm.trap()
|
|
unreachable
|
|
}
|
|
|
|
define void @t2() nounwind {
|
|
entry:
|
|
; DARWIN-LABEL: t2:
|
|
; DARWIN: udf #254
|
|
|
|
; FUNC-LABEL: t2:
|
|
; FUNC: bl __trap
|
|
|
|
; NACL-LABEL: t2:
|
|
; NACL: bkpt #0
|
|
|
|
; ARM-LABEL: t2:
|
|
; ARM: bkpt #0
|
|
|
|
; THUMB-LABEL: t2:
|
|
; THUMB: bkpt #0
|
|
|
|
; ENCODING-NACL: 70 00 20 e1 bkpt #0
|
|
|
|
; ENCODING-ARM: 70 00 20 e1 bkpt #0
|
|
|
|
; ENCODING-THUMB: 00 be bkpt #0
|
|
|
|
call void @llvm.debugtrap()
|
|
unreachable
|
|
}
|
|
|
|
declare void @llvm.trap() nounwind
|
|
declare void @llvm.debugtrap() nounwind
|