1; REQUIRES: asserts 2; RUN: opt -passes='simple-loop-unswitch<nontrivial>' -disable-output -S < %s 3; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>)' -disable-output -S < %s 4 5; This loop shouldn't trigger asserts in SimpleLoopUnswitch. 6define void @test_redundant_switch(ptr %ptr, i32 %cond) { 7entry: 8 br label %loop_begin 9 10loop_begin: 11 switch i32 %cond, label %loop_body [ 12 i32 0, label %loop_body 13 ] 14 15loop_body: 16 br label %loop_latch 17 18loop_latch: 19 %v = load i1, ptr %ptr 20 br i1 %v, label %loop_begin, label %loop_exit 21 22loop_exit: 23 ret void 24} 25