blob: 9a814b579deb27fee9b0b9dc39da0dffa34b580d [file] [log] [blame]
Tom Stellard49f8bfd2015-01-06 18:00:21 +00001; RUN: llc -march=amdgcn -mcpu=SI -o /dev/null %s
Marek Olsak75170772015-01-27 17:27:15 +00002; RUN: llc -march=amdgcn -mcpu=tonga -o /dev/null %s
Matt Arsenaulte682a192014-06-14 04:26:05 +00003; RUN: llc -march=r600 -mcpu=cypress -o /dev/null %s
4
5@extern_const_addrspace = external unnamed_addr addrspace(2) constant [5 x i32], align 4
6
Tom Stellard79243d92014-10-01 17:15:17 +00007; FUNC-LABEL: {{^}}load_extern_const_init:
Matt Arsenaulte682a192014-06-14 04:26:05 +00008define void @load_extern_const_init(i32 addrspace(1)* %out) nounwind {
David Blaikief72d05b2015-03-13 18:20:45 +00009 %val = load i32, i32 addrspace(2)* getelementptr ([5 x i32], [5 x i32] addrspace(2)* @extern_const_addrspace, i64 0, i64 3), align 4
Matt Arsenaulte682a192014-06-14 04:26:05 +000010 store i32 %val, i32 addrspace(1)* %out, align 4
11 ret void
12}
13
14@undef_const_addrspace = unnamed_addr addrspace(2) constant [5 x i32] undef, align 4
15
Tom Stellard79243d92014-10-01 17:15:17 +000016; FUNC-LABEL: {{^}}load_undef_const_init:
Matt Arsenaulte682a192014-06-14 04:26:05 +000017define void @load_undef_const_init(i32 addrspace(1)* %out) nounwind {
David Blaikief72d05b2015-03-13 18:20:45 +000018 %val = load i32, i32 addrspace(2)* getelementptr ([5 x i32], [5 x i32] addrspace(2)* @undef_const_addrspace, i64 0, i64 3), align 4
Matt Arsenaulte682a192014-06-14 04:26:05 +000019 store i32 %val, i32 addrspace(1)* %out, align 4
20 ret void
21}