1; RUN: opt -simplifycfg -S %s | FileCheck %s 2; rdar://15268442 3 4target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" 5target triple = "x86_64-apple-darwin12.0.0" 6 7; CHECK-LABEL: define i3 @coveredswitch_test( 8; CHECK: entry: 9; CHECK-NEXT: sub i3 %input, -4 10; CHECK-NEXT: zext i3 %switch.tableidx to i24 11; CHECK-NEXT: mul i24 %switch.cast, 3 12; CHECK-NEXT: lshr i24 7507338, %switch.shiftamt 13; CHECK-NEXT: trunc i24 %switch.downshift to i3 14; CHECK-NEXT: ret i3 %switch.masked 15 16define i3 @coveredswitch_test(i3 %input) { 17entry: 18 switch i3 %input, label %bb8 [ 19 i3 0, label %bb7 20 i3 1, label %bb 21 i3 2, label %bb3 22 i3 3, label %bb4 23 i3 4, label %bb5 24 i3 5, label %bb6 25 ] 26 27bb: ; preds = %entry 28 br label %bb8 29 30bb3: ; preds = %entry 31 br label %bb8 32 33bb4: ; preds = %entry 34 br label %bb8 35 36bb5: ; preds = %entry 37 br label %bb8 38 39bb6: ; preds = %entry 40 br label %bb8 41 42bb7: ; preds = %entry 43 br label %bb8 44 45bb8: ; preds = %bb7, %bb6, %bb5, %bb4, %bb3, %bb, %entry 46 %result = phi i3 [ 0, %bb7 ], [ 1, %bb6 ], [ 2, %bb5 ], [ 3, %bb4 ], [ 4, %bb3 ], [ 5, %bb ], [ 6, %entry ] 47 ret i3 %result 48} 49