| ; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s |
| define zeroext i1 @test1(i32 %x) nounwind readnone ssp noredzone { |
| switch i32 %x, label %lor.rhs [ |
| %0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ], [ true, %entry ] |
| ; CHECK: %x.off = add i32 %x, -1 |
| ; CHECK: %switch = icmp ult i32 %x.off, 3 |
| define zeroext i1 @test2(i32 %x) nounwind readnone ssp noredzone { |
| switch i32 %x, label %lor.rhs [ |
| %0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ] |
| ; CHECK: %switch = icmp ult i32 %x, 2 |
| define i32 @test3(i1 %flag) { |
| switch i1 %flag, label %bad [ |