diff options
| author | Quentin Colombet <qcolombet@apple.com> | 2016-03-05 00:31:04 +0000 |
|---|---|---|
| committer | Quentin Colombet <qcolombet@apple.com> | 2016-03-05 00:31:04 +0000 |
| commit | 2a7676b442bcc24eaea3097930f38626c15c088f (patch) | |
| tree | 1eb4689acd2e684edd12dcc870dbcfe49b12d7cd /llvm/test | |
| parent | 888f2c33d4eacdf1417cc768151e31f6fe7879db (diff) | |
| download | bcm5719-llvm-2a7676b442bcc24eaea3097930f38626c15c088f.tar.gz bcm5719-llvm-2a7676b442bcc24eaea3097930f38626c15c088f.zip | |
[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.
llvm-svn: 262762
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/i386-setjmp-pic.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/i386-setjmp-pic.ll b/llvm/test/CodeGen/X86/i386-setjmp-pic.ll new file mode 100644 index 00000000000..43a8a0ec76c --- /dev/null +++ b/llvm/test/CodeGen/X86/i386-setjmp-pic.ll @@ -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*) |

