+
+declare void @test10_helper(i8* %arg1, i8* %arg2, i32 %non-pointer-arg)
+define void @test10(i8* %arg1, i8* %arg2, i32 %non-pointer-arg) {
+; CHECK-LABEL: @test10
+entry:
+ %is_null = icmp eq i8* %arg1, null
+ br i1 %is_null, label %null, label %non_null
+
+non_null:
+ call void @test10_helper(i8* %arg1, i8* %arg2, i32 %non-pointer-arg)
+ ; CHECK: call void @test10_helper(i8* nonnull %arg1, i8* %arg2, i32 %non-pointer-arg)
+ br label %null
+
+null:
+ call void @test10_helper(i8* %arg1, i8* %arg2, i32 %non-pointer-arg)
+ ; CHECK: call void @test10_helper(i8* %arg1, i8* %arg2, i32 %non-pointer-arg)
+ ret void
+}
+
+declare void @test11_helper(i8* %arg)
+define void @test11(i8* %arg1, i8** %arg2) {
+; CHECK-LABEL: @test11
+entry:
+ %is_null = icmp eq i8* %arg1, null
+ br i1 %is_null, label %null, label %non_null
+
+non_null:
+ br label %merge
+
+null:
+ %another_arg = alloca i8
+ br label %merge
+
+merge:
+ %merged_arg = phi i8* [%another_arg, %null], [%arg1, %non_null]
+ call void @test11_helper(i8* %merged_arg)
+ ; CHECK: call void @test11_helper(i8* nonnull %merged_arg)
+ ret void
+}