1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt < %s -newgvn -S | FileCheck %s 3 4 5;; Block 6 is reachable, but edge 6->4 is not 6;; This means the phi value is undef, not 0 7; Function Attrs: ssp uwtable 8define i16 @hoge() local_unnamed_addr #0 align 2 { 9; CHECK-LABEL: @hoge( 10; CHECK-NEXT: bb: 11; CHECK-NEXT: switch i8 undef, label [[BB7:%.*]] [ 12; CHECK-NEXT: i8 0, label [[BB1:%.*]] 13; CHECK-NEXT: i8 12, label [[BB2:%.*]] 14; CHECK-NEXT: ] 15; CHECK: bb1: 16; CHECK-NEXT: br label [[BB6:%.*]] 17; CHECK: bb2: 18; CHECK-NEXT: br label [[BB4:%.*]] 19; CHECK: bb3: 20; CHECK-NEXT: unreachable 21; CHECK: bb4: 22; CHECK-NEXT: ret i16 undef 23; CHECK: bb6: 24; CHECK-NEXT: br i1 true, label [[BB3:%.*]], label [[BB4]], !llvm.loop !1 25; CHECK: bb7: 26; CHECK-NEXT: unreachable 27; 28bb: 29 switch i8 undef, label %bb7 [ 30 i8 0, label %bb1 31 i8 12, label %bb2 32 ] 33 34bb1: ; preds = %bb 35 br label %bb6 36 37bb2: ; preds = %bb 38 br label %bb4 39 40bb3: ; preds = %bb6 41 unreachable 42 43bb4: ; preds = %bb6, %bb2 44 %tmp = phi i16 [ 0, %bb6 ], [ undef, %bb2 ] 45 ret i16 %tmp 46 47bb6: ; preds = %bb4 48 br i1 true, label %bb3, label %bb4, !llvm.loop !1 49 50bb7: ; preds = %bb 51 unreachable 52} 53 54attributes #0 = { ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 55 56!llvm.ident = !{!0} 57 58!0 = !{!"clang version 5.0.0 (http://llvm.org/git/clang.git a8b933d4d1d133594fdaed35ee5814514b738f6d) (/Users/dannyb/sources/llvm-clean fc630a9b5613f544c07a8f16abcc173793df62cf)"} 59!1 = distinct !{!1, !2} 60!2 = !{!"llvm.loop.unroll.disable"} 61