1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt < %s -passes=ipsccp -S | FileCheck %s
5 define internal i32 @testf(i1 %c) {
6 ; CHECK-LABEL: define internal i32 @testf(
7 ; CHECK-SAME: i1 [[C:%.*]]) {
8 ; CHECK-NEXT: [[ENTRY:.*:]]
9 ; CHECK-NEXT: br i1 [[C]], label %[[IF_COND:.*]], label %[[IF_END:.*]]
11 ; CHECK-NEXT: unreachable
13 ; CHECK-NEXT: ret i32 poison
16 br i1 %c, label %if.cond, label %if.end
19 br i1 undef, label %if.then, label %if.end
21 if.then: ; preds = %entry, %if.then
24 if.end: ; preds = %if.then1, %entry
29 define internal i32 @test1(i1 %c) {
30 ; CHECK-LABEL: define internal i32 @test1(
31 ; CHECK-SAME: i1 [[C:%.*]]) {
32 ; CHECK-NEXT: [[ENTRY:.*:]]
33 ; CHECK-NEXT: br label %[[IF_THEN:.*]]
35 ; CHECK-NEXT: [[CALL:%.*]] = call i32 @testf(i1 [[C]])
36 ; CHECK-NEXT: br label %[[RET1:.*]]
38 ; CHECK-NEXT: ret i32 poison
43 if.then: ; preds = %entry, %if.then
44 %call = call i32 @testf(i1 %c)
45 %res = icmp eq i32 %call, 10
46 br i1 %res, label %ret1, label %ret2
48 ret1: ; preds = %if.then, %entry
51 ret2: ; preds = %if.then, %entry
56 define i32 @main(i1 %c) {
57 ; CHECK-LABEL: define i32 @main(
58 ; CHECK-SAME: i1 [[C:%.*]]) {
59 ; CHECK-NEXT: [[RES:%.*]] = call i32 @test1(i1 [[C]])
60 ; CHECK-NEXT: ret i32 99
62 %res = call i32 @test1(i1 %c)