diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2017-02-27 22:12:06 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2017-02-27 22:12:06 +0000 |
commit | b2605f31ed27aceefbb135c3fb3178687f07741c (patch) | |
tree | 8c60fc26c37efccbdc0d6ba004f1a274b672ae9e /llvm/test | |
parent | 120faca41bddd3a5922bdefbeb7c68908fda9ab9 (diff) | |
download | bcm5719-llvm-b2605f31ed27aceefbb135c3fb3178687f07741c.tar.gz bcm5719-llvm-b2605f31ed27aceefbb135c3fb3178687f07741c.zip |
ISel: We need to notify FastIS of the IMPLICIT_DEF we created in createSwiftErrorEntriesInEntryBlock
Otherwise, it will insert instructions before it.
rdar://30536186
llvm-svn: 296395
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/X86/swifterror.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/swifterror.ll b/llvm/test/CodeGen/X86/swifterror.ll index 86e0221c201..5704d191998 100644 --- a/llvm/test/CodeGen/X86/swifterror.ll +++ b/llvm/test/CodeGen/X86/swifterror.ll @@ -685,3 +685,30 @@ entry: tail call void @acallee(i8* null) ret void } + +; Make sure we don't crash on this function during -O0. +; We used to crash because we would insert an IMPLICIT_DEF for the swifterror at +; beginning of the machine basic block but did not inform FastISel of the +; inserted instruction. When computing the InsertPoint in the entry block +; FastISel would choose an insertion point before the IMPLICIT_DEF causing a +; crash later on. +declare hidden swiftcc i8* @testFunA() + +%TSb = type <{ i1 }> + +define swiftcc void @dontCrash() { +entry: + %swifterror = alloca swifterror %swift_error*, align 8 + store %swift_error* null, %swift_error** %swifterror, align 8 + %a = call i8* @testFunA() + %b = bitcast i8* %a to %TSb* + %._value = getelementptr inbounds %TSb, %TSb* %b, i32 0, i32 0 + %c = load i1, i1* %._value, align 1 + br i1 %c, label %trueBB, label %falseBB + +trueBB: + ret void + +falseBB: + ret void +} |