1 ; RUN: opt < %s -simplifycfg -S | \ 2 ; RUN: not grep " switch" 3 ; PR10131 4 5 ; ModuleID = '<stdin>' 6 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" 7 target triple = "i386-pc-linux-gnu" 8 9 define i32 @t(i32 %m) nounwind readnone { 10 entry: 11 switch i32 %m, label %sw.bb4 [ 12 i32 0, label %sw.bb0 13 i32 1, label %sw.bb1 14 i32 2, label %sw.bb2 15 i32 3, label %sw.bb3 16 ] 17 18 sw.bb0: ; preds = %entry 19 br label %return 20 21 sw.bb1: ; preds = %entry 22 br label %return 23 24 sw.bb2: ; preds = %entry 25 br label %return 26 27 sw.bb3: ; preds = %entry 28 br label %return 29 30 sw.bb4: ; preds = %entry 31 br label %return 32 33 return: ; preds = %entry, %sw.bb4, %sw.bb3, %sw.bb2, %sw.bb1 34 %retval.0 = phi i32 [ 4, %sw.bb4 ], [ 3, %sw.bb3 ], [ 2, %sw.bb2 ], [ 1, %sw.bb1 ], [ 0, %sw.bb0 ] 35 ret i32 %retval.0 36 } 37