diff options
Diffstat (limited to 'test/Transforms/TailCallElim')
-rw-r--r-- | test/Transforms/TailCallElim/basic.ll | 12 | ||||
-rw-r--r-- | test/Transforms/TailCallElim/notail.ll | 24 |
2 files changed, 35 insertions, 1 deletions
diff --git a/test/Transforms/TailCallElim/basic.ll b/test/Transforms/TailCallElim/basic.ll index 2488b552d8f3..b303fa743ca9 100644 --- a/test/Transforms/TailCallElim/basic.ll +++ b/test/Transforms/TailCallElim/basic.ll @@ -156,7 +156,7 @@ define void @test9(i32* byval %a) { declare void @ctor(%struct.X*) define void @test10(%struct.X* noalias sret %agg.result, i1 zeroext %b) { -; CHECK-LABEL @test10 +; CHECK-LABEL: @test10 entry: %x = alloca %struct.X, align 8 br i1 %b, label %if.then, label %if.end @@ -188,3 +188,13 @@ define void @test11() { ; CHECK: call void @test11_helper2 ret void } + +; PR25928 +define void @test12() { +entry: +; CHECK-LABEL: @test12 +; CHECK: {{^ *}} call void undef(i8* undef) [ "foo"(i8* %e) ] + %e = alloca i8 + call void undef(i8* undef) [ "foo"(i8* %e) ] + unreachable +} diff --git a/test/Transforms/TailCallElim/notail.ll b/test/Transforms/TailCallElim/notail.ll new file mode 100644 index 000000000000..e6fdbd1ec77d --- /dev/null +++ b/test/Transforms/TailCallElim/notail.ll @@ -0,0 +1,24 @@ +; RUN: opt < %s -tailcallelim -S | FileCheck %s + +; CHECK: tail call void @callee0() +; CHECK: notail call void @callee1() + +define void @foo1(i32 %a) { +entry: + %tobool = icmp eq i32 %a, 0 + br i1 %tobool, label %if.else, label %if.then + +if.then: + call void @callee0() + br label %if.end + +if.else: + notail call void @callee1() + br label %if.end + +if.end: + ret void +} + +declare void @callee0() +declare void @callee1() |