1; RUN: opt < %s -ipsccp -S | FileCheck %s
2
3; CHECK-LABEL: @testf(
4; CHECK:         ret i32 undef
5;
6define internal i32 @testf(i1 %c) {
7entry:
8  br i1 %c, label %if.cond, label %if.end
9
10if.cond:
11  br i1 undef, label %if.then, label %if.end
12
13if.then:                                          ; preds = %entry, %if.then
14  ret i32 11
15
16if.end:                                          ; preds = %if.then1, %entry
17  ret i32 10
18}
19
20; CHECK-LABEL: @test1(
21; CHECK:         ret i32 undef
22;
23define internal i32 @test1(i1 %c) {
24entry:
25  br label %if.then
26
27if.then:                                          ; preds = %entry, %if.then
28  %call = call i32 @testf(i1 %c)
29  %res = icmp eq i32 %call, 10
30  br i1 %res, label %ret1, label %ret2
31
32ret1:                                           ; preds = %if.then, %entry
33  ret i32 99
34
35ret2:                                           ; preds = %if.then, %entry
36  ret i32 0
37}
38
39; CHECK-LABEL: @main(
40; CHECK-NEXT:    %res = call i32 @test1(
41; CHECK-NEXT:    ret i32 99
42;
43define i32 @main(i1 %c) {
44  %res = call i32 @test1(i1 %c)
45  ret i32 %res
46}
47