1 ; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s -check-prefix=INSTR 2 ; RUN: llc < %s -mtriple=arm-apple-darwin -trap-func=_trap | FileCheck %s -check-prefix=FUNC 3 ; RUN: llc < %s -mtriple=arm-apple-darwin -trap-func=_trap -O0 | FileCheck %s -check-prefix=FUNC 4 ; RUN: llc -mtriple=armv7-unknown-nacl -filetype=obj %s -o - \ 5 ; RUN: | llvm-objdump -disassemble -triple armv7-unknown-nacl - \ 6 ; RUN: | FileCheck %s -check-prefix=ENCODING-NACL 7 ; RUN: llc -mtriple=armv7-unknown-nacl -filetype=obj %s -o - \ 8 ; RUN: | llvm-objdump -disassemble -triple armv7 -mattr=+nacl-trap - \ 9 ; RUN: | FileCheck %s -check-prefix=ENCODING-NACL 10 ; RUN: llc -mtriple=armv7 -mattr=+nacl-trap -filetype=obj %s -o - \ 11 ; RUN: | llvm-objdump -disassemble -triple armv7 -mattr=+nacl-trap - \ 12 ; RUN: | FileCheck %s -check-prefix=ENCODING-NACL 13 ; RUN: llc -verify-machineinstrs -fast-isel -mtriple=armv7-unknown-nacl -filetype=obj %s -o - \ 14 ; RUN: | llvm-objdump -disassemble -triple armv7-unknown-nacl - \ 15 ; RUN: | FileCheck %s -check-prefix=ENCODING-NACL 16 ; RUN: llc -mtriple=armv7 -filetype=obj %s -o - \ 17 ; RUN: | llvm-objdump -disassemble -triple armv7 - \ 18 ; RUN: | FileCheck %s -check-prefix=ENCODING-ALL 19 ; RUN: llc -verify-machineinstrs -fast-isel -mtriple=armv7 -filetype=obj %s -o - \ 20 ; RUN: | llvm-objdump -disassemble -triple armv7 - \ 21 ; RUN: | FileCheck %s -check-prefix=ENCODING-ALL 22 ; rdar://7961298 23 ; rdar://9249183 24 25 define void @t() nounwind { 26 entry: 27 ; INSTR-LABEL: t: 28 ; INSTR: trap 29 30 ; FUNC-LABEL: t: 31 ; FUNC: bl __trap 32 33 ; ENCODING-NACL: f0 de fe e7 34 35 ; ENCODING-ALL: fe de ff e7 36 37 call void @llvm.trap() 38 unreachable 39 } 40 41 define void @t2() nounwind { 42 entry: 43 ; INSTR-LABEL: t2: 44 ; INSTR: trap 45 46 ; FUNC-LABEL: t2: 47 ; FUNC: bl __trap 48 49 ; ENCODING-NACL: f0 de fe e7 50 51 ; ENCODING-ALL: fe de ff e7 52 53 call void @llvm.debugtrap() 54 unreachable 55 } 56 57 declare void @llvm.trap() nounwind 58 declare void @llvm.debugtrap() nounwind 59