1 ; RUN: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s
2 ; Check that we generate store instructions with global + offset
4 %struct.struc = type { i8, i8, i16, i32 }
6 @foo = common global %struct.struc zeroinitializer, align 4
8 define void @storeByte(i32 %val1, i32 %val2, i8 zeroext %ival) nounwind {
9 ; CHECK: memb(##foo{{ *}}+{{ *}}1){{ *}}={{ *}}r{{[0-9]+}}
11 %cmp = icmp sgt i32 %val1, %val2
12 br i1 %cmp, label %if.then, label %if.end
14 if.then: ; preds = %entry
15 store i8 %ival, i8* getelementptr inbounds (%struct.struc* @foo, i32 0, i32 1), align 1
18 if.end: ; preds = %if.then, %entry
22 define void @storeHW(i32 %val1, i32 %val2, i16 signext %ival) nounwind {
23 ; CHECK: memh(##foo{{ *}}+{{ *}}2){{ *}}={{ *}}r{{[0-9]+}}
25 %cmp = icmp sgt i32 %val1, %val2
26 br i1 %cmp, label %if.then, label %if.end
28 if.then: ; preds = %entry
29 store i16 %ival, i16* getelementptr inbounds (%struct.struc* @foo, i32 0, i32 2), align 2
32 if.end: ; preds = %if.then, %entry