1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
3 ; RUN: opt -S -passes=simplifycfg < %s | FileCheck %s
5 declare void @foo() convergent
7 define i32 @test_01(i32 %a) {
8 ; CHECK-LABEL: @test_01(
10 ; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[A:%.*]], 0
11 ; CHECK-NEXT: br i1 [[COND]], label [[MERGE:%.*]], label [[IF_FALSE:%.*]]
13 ; CHECK-NEXT: call void @foo()
14 ; CHECK-NEXT: br label [[MERGE]]
16 ; CHECK-NEXT: call void @foo()
17 ; CHECK-NEXT: br i1 [[COND]], label [[EXIT:%.*]], label [[IF_FALSE_2:%.*]]
19 ; CHECK-NEXT: call void @foo()
20 ; CHECK-NEXT: br label [[EXIT]]
22 ; CHECK-NEXT: ret i32 [[A]]
25 %cond = icmp eq i32 %a, 0
26 br i1 %cond, label %merge, label %if.false
34 br i1 %cond, label %exit, label %if.false.2