The initial change was insufficiently complete for always getting the semantics of __builtin_longjmp correct. The builtin is translated into a `tInt_eh_sjlj_longjmp` DAG node. This node set R7 as clobbered. However, the code would then follow up with a clobber of R11. I had failed to notice the imp-def,kill on R7 in the isel. Unfortunately, it seems that it is not possible to conditionalise the Defs list via an !if. Instead, construct a new parallel WIN node and prefer that when targeting windows. This ensures that we now both correctly model the __builtin_longjmp as well as construct the frame in a more ABI conformant manner. llvm-svn: 263123
18 lines
451 B
LLVM
18 lines
451 B
LLVM
; RUN: llc -mtriple thumbv7--windows-itanium -filetype asm -o - %s | FileCheck %s
|
|
|
|
declare void @llvm.eh.sjlj.longjmp(i8*)
|
|
|
|
define arm_aapcs_vfpcc void @test___builtin_longjump(i8* %b) {
|
|
entry:
|
|
tail call void @llvm.eh.sjlj.longjmp(i8* %b)
|
|
unreachable
|
|
}
|
|
|
|
; CHECK: push.w {r11, lr}
|
|
; CHECK: ldr r[[SP:[0-9]+]], [r0, #8]
|
|
; CHECK: mov sp, r[[SP]]
|
|
; CHECK: ldr r[[PC:[0-9]+]], [r0, #4]
|
|
; CHECK: ldr r11, [r0]
|
|
; CHECK: bx r[[PC]]
|
|
|