forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] Fix the lowering of setjmp intrinsic on i386.
When the lowering of the setjmp intrinsic requires a global base pointer to be set, make sure such pointer gets defined by the CGBR pass. This fixes PR26742. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262762 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Quentin Colombet
committed
Mar 5, 2016
1 parent
c9f13a8
commit cb15f70
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llc -verify-machineinstrs -relocation-model=pic %s -o - | FileCheck %s | ||
target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128" | ||
target triple = "i386-apple-macosx" | ||
|
||
; Check that the register used as base pointer for setjmp | ||
; is properly initialized. | ||
; The test used to fail with the machine verifier complaining | ||
; that the global base pointer is not initialized. | ||
; PR26742. | ||
; | ||
; CHECK: test: | ||
; CHECK: calll [[BP_SETUP_LABEL:L[$0-9a-zA-Z_-]+]] | ||
; CHECK: [[BP_SETUP_LABEL]]: | ||
; CHECK-NEXT: popl [[BP:%[a-z]+]] | ||
; | ||
; CHECK: leal [[BLOCK_ADDR:LBB[$0-9a-zA-Z_-]+]]-[[BP_SETUP_LABEL]]([[BP]]), | ||
define i32 @test(i8* %tmp) { | ||
entry: | ||
%tmp9 = call i32 @llvm.eh.sjlj.setjmp(i8* %tmp) | ||
ret i32 %tmp9 | ||
} | ||
|
||
declare i32 @llvm.eh.sjlj.setjmp(i8*) |