1; RUN: llc -march=hexagon -verify-machineinstrs -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s
2; REQUIRES: asserts
3
4; Check for some output other than crashing.
5; CHECK: bitsset
6
7target triple = "hexagon"
8
9; Function Attrs: nounwind
10define void @fred() local_unnamed_addr #0 {
11b0:
12  %v1 = load i32, i32* undef, align 4
13  %v2 = and i32 %v1, 603979776
14  %v3 = trunc i32 %v2 to i30
15  switch i30 %v3, label %b23 [
16    i30 -536870912, label %b4
17    i30 -469762048, label %b5
18  ]
19
20b4:                                               ; preds = %b0
21  unreachable
22
23b5:                                               ; preds = %b0
24  %v6 = load i32, i32* undef, align 4
25  br i1 undef, label %b7, label %b8
26
27b7:                                               ; preds = %b5
28  br label %b9
29
30b8:                                               ; preds = %b5
31  br label %b9
32
33b9:                                               ; preds = %b8, %b7
34  %v10 = load i32, i32* undef, align 4
35  %v11 = load i32, i32* undef, align 4
36  %v12 = mul nsw i32 %v11, %v10
37  %v13 = ashr i32 %v12, 13
38  %v14 = mul nsw i32 %v13, %v13
39  %v15 = zext i32 %v14 to i64
40  %v16 = mul nsw i32 %v6, %v6
41  %v17 = zext i32 %v16 to i64
42  %v18 = lshr i64 %v17, 5
43  %v19 = select i1 undef, i64 %v18, i64 %v17
44  %v20 = mul nuw nsw i64 %v19, %v15
45  %v21 = trunc i64 %v20 to i32
46  %v22 = and i32 %v21, 2147483647
47  store i32 %v22, i32* undef, align 4
48  unreachable
49
50b23:                                              ; preds = %b0
51  ret void
52}
53
54attributes #0 = { nounwind "target-cpu"="hexagonv5" "target-features"="-hvx,-long-calls" }
55