blob: 532edf07c301001ca41ea0fe6e75ca34b796fa63 [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 {
9 %val = load i32 addrspace(2)* getelementptr ([5 x i32] addrspace(2)* @extern_const_addrspace, i64 0, i64 3), align 4
10 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 {
18 %val = load i32 addrspace(2)* getelementptr ([5 x i32] addrspace(2)* @undef_const_addrspace, i64 0, i64 3), align 4
19 store i32 %val, i32 addrspace(1)* %out, align 4
20 ret void
21}