blob: 6b181cabe4752770735d06e43ada3aa8010cafaa [file] [log] [blame]
Jyotsna Vermad9225242013-02-13 21:38:46 +00001; RUN: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s
2; Check that we generate store instructions with global + offset
3
4%struct.struc = type { i8, i8, i16, i32 }
5
6@foo = common global %struct.struc zeroinitializer, align 4
7
8define void @storeByte(i32 %val1, i32 %val2, i8 zeroext %ival) nounwind {
9; CHECK: memb(##foo{{ *}}+{{ *}}1){{ *}}={{ *}}r{{[0-9]+}}
10entry:
11 %cmp = icmp sgt i32 %val1, %val2
12 br i1 %cmp, label %if.then, label %if.end
13
14if.then: ; preds = %entry
David Blaikief72d05b2015-03-13 18:20:45 +000015 store i8 %ival, i8* getelementptr inbounds (%struct.struc, %struct.struc* @foo, i32 0, i32 1), align 1
Jyotsna Vermad9225242013-02-13 21:38:46 +000016 br label %if.end
17
18if.end: ; preds = %if.then, %entry
19 ret void
20}
21
22define void @storeHW(i32 %val1, i32 %val2, i16 signext %ival) nounwind {
23; CHECK: memh(##foo{{ *}}+{{ *}}2){{ *}}={{ *}}r{{[0-9]+}}
24entry:
25 %cmp = icmp sgt i32 %val1, %val2
26 br i1 %cmp, label %if.then, label %if.end
27
28if.then: ; preds = %entry
David Blaikief72d05b2015-03-13 18:20:45 +000029 store i16 %ival, i16* getelementptr inbounds (%struct.struc, %struct.struc* @foo, i32 0, i32 2), align 2
Jyotsna Vermad9225242013-02-13 21:38:46 +000030 br label %if.end
31
32if.end: ; preds = %if.then, %entry
33 ret void
34}
35