1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; Check that this testcase compiles successfully.
5 target triple = "hexagon"
7 @g0 = external global [1024 x i8], align 8
8 @g1 = external global [1024 x i8], align 8
9 @g2 = external global [1024 x i8], align 8
10 @g3 = external global [1024 x i8], align 8
11 @g4 = external hidden unnamed_addr constant [40 x i8], align 1
13 ; Function Attrs: nounwind
14 define void @fred() local_unnamed_addr #0 {
16 %v1 = alloca i32, align 4
17 %v2 = alloca i32, align 4
18 %v3 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 9), align 1
19 %v4 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 10), align 2
20 store i32 24, ptr %v1, align 4
21 store i8 %v3, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 16), align 8
22 store i8 %v4, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 10), align 2
23 store i32 44, ptr %v2, align 4
24 store i16 0, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 4), align 4
25 %v5 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 11), align 1
26 store i16 %v5, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 18), align 2
27 %v6 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 13), align 1
28 store i32 %v6, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 20), align 4
29 %v7 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 17), align 1
30 store i16 %v7, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 24), align 8
31 %v8 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 23), align 1
32 store i16 %v8, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 32), align 8
33 %v9 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 25), align 1
34 store i32 %v9, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 36), align 4
35 %v10 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 29), align 1
36 store i16 %v10, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 40), align 8
37 %v11 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 31), align 1
38 store i32 %v11, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 44), align 4
39 %v12 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 35), align 1
40 store i16 %v12, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 48), align 8
41 %v13 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 37), align 1
42 store i32 %v13, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 52), align 4
43 %v14 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 41), align 1
44 store i16 %v14, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 56), align 8
45 %v15 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 43), align 1
46 store i32 %v15, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 60), align 4
47 %v16 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 47), align 1
48 store i16 %v16, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 64), align 8
49 %v17 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 49), align 1
50 store i32 %v17, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 68), align 4
51 %v18 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 53), align 1
52 store i16 %v18, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 72), align 8
53 %v19 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 55), align 1
54 store i32 %v19, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 76), align 4
55 %v20 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 61), align 1
56 store i32 %v20, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 84), align 4
57 %v21 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 73), align 1
58 store i32 %v21, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 100), align 4
59 store i32 104, ptr %v1, align 4
60 store i8 %v4, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 10), align 2
61 store i16 %v8, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 23), align 1
62 store i32 %v9, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 25), align 1
63 store i16 %v10, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 29), align 1
64 store i32 %v11, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 31), align 1
65 store i16 %v12, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 35), align 1
66 store i32 %v13, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 37), align 1
67 store i16 %v14, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 41), align 1
68 store i32 %v15, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 43), align 1
69 store i16 %v16, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 47), align 1
70 store i32 %v17, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 49), align 1
71 store i32 %v19, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 55), align 1
72 store i32 %v20, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 61), align 1
73 store i32 %v21, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 73), align 1
74 %v22 = trunc i32 %v6 to i8
75 store i8 %v22, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 20), align 4
76 store i32 24, ptr %v1, align 4
77 store i16 0, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 4), align 4
78 store i8 %v3, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 9), align 1
79 store i16 %v5, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 11), align 1
80 store i8 %v22, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 13), align 1
81 store i32 14, ptr %v2, align 4
82 store i8 %v4, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 17), align 1
83 %v23 = load i64, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 11), align 1
84 store i64 %v23, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 24), align 8
85 %v24 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 19), align 1
86 store i16 %v24, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 32), align 8
87 %v25 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 21), align 1
88 store i32 %v25, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 36), align 4
89 %v26 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 25), align 1
90 store i32 %v26, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 40), align 8
91 %v27 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 29), align 1
92 store i16 %v27, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 44), align 4
93 %v28 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 31), align 1
94 store i16 %v28, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 46), align 2
95 %v29 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 33), align 1
96 store i8 %v29, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 48), align 8
97 %v30 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 34), align 2
98 store i8 %v30, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 56), align 8
99 %v31 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 35), align 1
100 store i32 %v31, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 60), align 4
101 %v32 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 39), align 1
102 store i32 72, ptr %v1, align 4
103 store i32 0, ptr @g2, align 8
104 store i16 0, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 4), align 4
105 store i8 %v3, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 9), align 1
106 store i32 %v25, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 21), align 1
107 store i32 %v26, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 25), align 1
108 store i16 %v27, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 29), align 1
109 store i16 %v28, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 31), align 1
110 store i8 %v29, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 33), align 1
111 store i8 %v30, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 34), align 2
112 store i32 %v31, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 35), align 1
113 store i32 %v32, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 39), align 1
114 store i32 43, ptr %v2, align 4
115 %v33 = load i8, ptr @g1, align 8
116 %v34 = zext i8 %v33 to i32
117 tail call void (ptr, ...) @printf(ptr @g4, i32 %v34, i32 0) #0
118 %v35 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 7), align 1
119 store i8 %v35, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 7), align 1
120 %v36 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 17), align 1
121 store i16 %v36, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 24), align 8
122 %v37 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 19), align 1
123 %v38 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 31), align 1
124 store i32 %v38, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 44), align 4
125 %v39 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 35), align 1
126 %v40 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 37), align 1
127 store i32 %v40, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 52), align 4
128 %v41 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 43), align 1
129 store i32 %v41, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 60), align 4
130 %v42 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 47), align 1
131 store i16 %v42, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 64), align 8
132 %v43 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 49), align 1
133 store i32 %v43, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 68), align 4
134 %v44 = load i16, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 59), align 1
135 store i16 %v44, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 80), align 8
136 %v45 = load i32, ptr getelementptr inbounds ([1024 x i8], ptr @g0, i32 0, i32 67), align 1
137 store i32 %v45, ptr getelementptr inbounds ([1024 x i8], ptr @g3, i32 0, i32 92), align 4
138 store i32 96, ptr %v1, align 4
139 store i8 %v35, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 7), align 1
140 store i16 %v36, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 17), align 1
141 store i32 %v37, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 19), align 1
142 store i32 %v38, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 31), align 1
143 store i16 %v39, ptr getelementptr inbounds ([1024 x i8], ptr @g2, i32 0, i32 35), align 1
144 call void (ptr, ...) @printf(ptr @g4, i32 0, i32 0) #0
145 call void (ptr, ...) @printf(ptr @g4, i32 undef, i32 0) #0
149 declare void @printf(ptr nocapture readonly, ...) local_unnamed_addr #0
151 attributes #0 = { nounwind "target-cpu"="hexagonv5" }