diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-07-01 16:45:47 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-07-01 16:45:47 +0000 |
| commit | f80636682ce2b1588ba3e04fa4ebfd00adac969a (patch) | |
| tree | dbd3df25100d09a3911a1b4fd84bc51e36d6035e /llvm/test/CodeGen/X86 | |
| parent | 286d466097d445b66be8453596fd3e128e37dc9a (diff) | |
| download | bcm5719-llvm-f80636682ce2b1588ba3e04fa4ebfd00adac969a.tar.gz bcm5719-llvm-f80636682ce2b1588ba3e04fa4ebfd00adac969a.zip | |
[SEH] Don't assert if the parent function lacks a personality
The EH code might have been deleted as unreachable and the personality
pruned while the filter is still present. Currently I'm hitting this at
-O0 due to the clang bug PR24009.
llvm-svn: 241170
Diffstat (limited to 'llvm/test/CodeGen/X86')
| -rw-r--r-- | llvm/test/CodeGen/X86/seh-filter-no-personality.ll | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/seh-filter-no-personality.ll b/llvm/test/CodeGen/X86/seh-filter-no-personality.ll new file mode 100644 index 00000000000..87bc9c93f40 --- /dev/null +++ b/llvm/test/CodeGen/X86/seh-filter-no-personality.ll @@ -0,0 +1,33 @@ +; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s + +; Mostly make sure that llvm.x86.seh.recoverfp doesn't crash if the parent +; function lacks a personality. + +declare i8* @llvm.frameaddress(i32) +declare i8* @llvm.x86.seh.recoverfp(i8*, i8*) + +define i32 @main() { +entry: + ret i32 0 +} + +define internal i32 @"filt$main"() { +entry: + %ebp = tail call i8* @llvm.frameaddress(i32 1) + %parentfp = tail call i8* @llvm.x86.seh.recoverfp(i8* bitcast (i32 ()* @main to i8*), i8* %ebp) + %info.addr = getelementptr inbounds i8, i8* %ebp, i32 -20 + %0 = bitcast i8* %info.addr to i32*** + %1 = load i32**, i32*** %0, align 4 + %2 = load i32*, i32** %1, align 4 + %3 = load i32, i32* %2, align 4 + %matches = icmp eq i32 %3, u0xC0000005 + %r = zext i1 %matches to i32 + ret i32 %r +} + +; CHECK: _main: +; CHECK: xorl %eax, %eax +; CHECK: retl + +; CHECK: _filt$main: +; CHECK: retl |

