1 ; RUN: llc -march=hexagon -verify-machineinstrs < %s | FileCheck %s
2 ; Check that we don't crash.
4 target triple = "hexagon"
6 %struct.1 = type { i16, i8, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
7 %struct.0 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
9 declare void @foo(ptr, ptr readonly) local_unnamed_addr #0
10 declare zeroext i8 @bar() local_unnamed_addr #0
11 declare i32 @printf(ptr nocapture readonly, ...) local_unnamed_addr #0
13 @.str = private unnamed_addr constant [5 x i8] c"blah\00", align 1
15 define i32 @main(i32 %argc, ptr nocapture readonly %argv) local_unnamed_addr #0 {
17 %t0 = alloca %struct.0, align 4
20 do.body: ; preds = %if.end88.do.body_crit_edge, %entry
21 %cond = icmp eq i32 undef, 0
22 br i1 %cond, label %if.end49, label %if.then124
24 if.end49: ; preds = %do.body
25 br i1 undef, label %if.end55, label %if.then53
27 if.then53: ; preds = %if.end49
28 call void @foo(ptr null, ptr nonnull %t0)
31 if.end55: ; preds = %if.then53, %if.end49
32 %call76 = call zeroext i8 @bar() #0
33 switch i8 %call76, label %sw.epilog79 [
38 sw.bb77: ; preds = %if.end55, %if.end55
41 sw.epilog79: ; preds = %if.end55
42 br i1 undef, label %if.end88, label %if.then81
44 if.then81: ; preds = %sw.epilog79
45 %div87 = fdiv float 0.000000e+00, undef
48 if.end88: ; preds = %if.then81, %sw.epilog79
49 %t1 = phi float [ undef, %sw.epilog79 ], [ %div87, %if.then81 ]
50 %div89 = fdiv float 1.000000e+00, %t1
51 %.sroa.speculated = select i1 undef, float 0.000000e+00, float undef
52 %conv108 = fpext float %.sroa.speculated to double
53 %call113 = call i32 (ptr, ...) @printf(ptr @.str, double undef, double %conv108, i64 undef, i32 undef) #0
54 br i1 undef, label %if.end88.do.body_crit_edge, label %if.then124
56 if.end88.do.body_crit_edge: ; preds = %if.end88
59 if.then124: ; preds = %if.end88, %do.body
60 %t2 = phi float [ undef, %do.body ], [ %t1, %if.end88 ]
64 attributes #0 = { nounwind }