brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 88b69a4 Raw
89 lines · plain
1;; Check encodings of trap instructions and that their properties are set2;; correctly so that they are not placed after the stack frame is destroyed.3 4; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s -check-prefix=DARWIN5; RUN: llc < %s -mtriple=arm-apple-darwin -trap-func=_trap | FileCheck %s -check-prefix=FUNC6; RUN: llc < %s -mtriple=arm-apple-darwin -trap-func=_trap -O0 | FileCheck %s -check-prefix=FUNC7; RUN: llc < %s -mtriple=armv7 | FileCheck %s -check-prefix=ARM8; RUN: llc < %s -mtriple=thumbv7 | FileCheck %s -check-prefix=THUMB9 10; RUN: llc -mtriple=armv7 -filetype=obj %s -o - \11; RUN:  | llvm-objdump -d --triple=armv7 - \12; RUN:  | FileCheck %s -check-prefix=ENCODING-ARM13; RUN: llc -verify-machineinstrs -fast-isel -mtriple=armv7 -filetype=obj %s -o - \14; RUN:  | llvm-objdump -d --triple=armv7 - \15; RUN:  | FileCheck %s -check-prefix=ENCODING-ARM16 17; RUN: llc -mtriple=thumbv7 -filetype=obj %s -o - \18; RUN:  | llvm-objdump -d --triple=thumbv7 - \19; RUN:  | FileCheck %s -check-prefix=ENCODING-THUMB20; RUN: llc -verify-machineinstrs -fast-isel -mtriple=thumbv7 -filetype=obj %s -o - \21; RUN:  | llvm-objdump -d --triple=thumbv7 - \22; RUN:  | FileCheck %s -check-prefix=ENCODING-THUMB23 24; rdar://796129825; rdar://924918326 27define void @t() noinline optnone {28entry:29  ;; So that we have a stack frame.30  %1 = alloca i32, align 431  store volatile i32 0, ptr %1, align 432 33; DARWIN-LABEL: t:34; DARWIN:      trap35; DARWIN-NEXT: add sp, sp, #436 37; FUNC-LABEL: t:38; FUNC:      bl __trap39; FUNC-NEXT: add sp, sp, #440 41; ARM-LABEL: t:42; ARM:      .inst 0xe7ffdefe43; ARM-NEXT: add sp, sp, #444 45; THUMB-LABEL: t:46; THUMB:      .inst.n 0xdefe47; THUMB-NEXT: add sp, #448 49; ENCODING-ARM: e7ffdefe    trap50 51; ENCODING-THUMB: defe  trap52 53  call void @llvm.trap()54  ret void55}56 57define void @t2() {58entry:59  ;; So that we have a stack frame.60  %1 = alloca i32, align 461  store volatile i32 0, ptr %1, align 462 63; DARWIN-LABEL: t2:64; DARWIN:      udf #25465; DARWIN-NEXT: add sp, sp, #466 67; FUNC-LABEL: t2:68; FUNC:      bl __trap69; FUNC-NEXT: add sp, sp, #470 71; ARM-LABEL: t2:72; ARM:      bkpt #073; ARM-NEXT: add sp, sp, #474 75; THUMB-LABEL: t2:76; THUMB:      bkpt #077; THUMB-NEXT: add sp, #478 79; ENCODING-ARM: e1200070    bkpt #080 81; ENCODING-THUMB: be00  bkpt #082 83  call void @llvm.debugtrap()84  ret void85}86 87declare void @llvm.trap() nounwind88declare void @llvm.debugtrap() nounwind89