summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/Transforms/InstCombine/call_nonnull_arg.ll17
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll b/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
index b10411f622b..58cf3bcb756 100644
--- a/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
+++ b/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
@@ -1,11 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
; InstCombine should mark null-checked argument as nonnull at callsite
declare void @dummy(i32*, i32)
define void @test(i32* %a, i32 %b) {
-; CHECK-LABEL: @test
-; CHECK: call void @dummy(i32* nonnull %a, i32 %b)
+; CHECK-LABEL: @test(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[COND1:%.*]] = icmp eq i32* %a, null
+; CHECK-NEXT: br i1 [[COND1]], label %dead, label %not_null
+; CHECK: not_null:
+; CHECK-NEXT: [[COND2:%.*]] = icmp eq i32 %b, 0
+; CHECK-NEXT: br i1 [[COND2]], label %dead, label %not_zero
+; CHECK: not_zero:
+; CHECK-NEXT: call void @dummy(i32* nonnull %a, i32 %b)
+; CHECK-NEXT: ret void
+; CHECK: dead:
+; CHECK-NEXT: unreachable
+;
entry:
%cond1 = icmp eq i32* %a, null
br i1 %cond1, label %dead, label %not_null
@@ -18,3 +30,4 @@ not_zero:
dead:
unreachable
}
+
OpenPOWER on IntegriCloud