diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-11-18 02:50:39 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-11-18 02:50:39 +0000 |
| commit | 8447ff6357b27725ad04abc042dcedc521630831 (patch) | |
| tree | 0afd8e7de69e06d2ccd6c83608d679121d097d3a /llvm/test/Transforms | |
| parent | fbb1c3a70b9cd81840f591611c2ef65f588f9097 (diff) | |
| download | bcm5719-llvm-8447ff6357b27725ad04abc042dcedc521630831.tar.gz bcm5719-llvm-8447ff6357b27725ad04abc042dcedc521630831.zip | |
Add a test for r253323
Forgot to do this simultaneously with committing the fix.
llvm-svn: 253430
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/GVN/funclet.ll | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GVN/funclet.ll b/llvm/test/Transforms/GVN/funclet.ll new file mode 100644 index 00000000000..c9faf8ee4c8 --- /dev/null +++ b/llvm/test/Transforms/GVN/funclet.ll @@ -0,0 +1,47 @@ +; RUN: opt -basicaa -gvn -S < %s | FileCheck %s +target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" +target triple = "i686-pc-windows-msvc" + +%eh.ThrowInfo = type { i32, i8*, i8*, i8* } +%struct.A = type { i32* } + +@"_TI1?AUA@@" = external constant %eh.ThrowInfo + +define i8 @f() personality i32 (...)* @__CxxFrameHandler3 { +entry: + %b = alloca i8 + %c = alloca i8 + store i8 42, i8* %b + store i8 13, i8* %c + invoke void @_CxxThrowException(i8* %b, %eh.ThrowInfo* nonnull @"_TI1?AUA@@") + to label %unreachable unwind label %catch.dispatch + +catch.dispatch: ; preds = %entry + %catchpad = catchpad [i8* null, i32 64, i8* null] + to label %catch unwind label %catchendblock + +catch: ; preds = %catch.dispatch + store i8 5, i8* %b + catchret %catchpad to label %try.cont + +try.cont: ; preds = %catch + %load_b = load i8, i8* %b + %load_c = load i8, i8* %c + %add = add i8 %load_b, %load_c + ret i8 %add + +catchendblock: ; preds = %catch.dispatch + catchendpad unwind to caller + +unreachable: ; preds = %entry + unreachable +} +; CHECK-LABEL: define i8 @f( +; CHECK: %[[load_b:.*]] = load i8, i8* %b +; CHECK-NEXT: %[[load_c:.*]] = load i8, i8* %c +; CHECK-NEXT: %[[add:.*]] = add i8 %[[load_b]], %[[load_c]] +; CHECK-NEXT: ret i8 %[[add]] + +declare i32 @__CxxFrameHandler3(...) + +declare x86_stdcallcc void @_CxxThrowException(i8*, %eh.ThrowInfo*) |

