R600: Add failing testcases for constant initializers.
[oota-llvm.git] / test / CodeGen / R600 / gv-const-addrspace-fail.ll
1 ; XFAIL: *
2 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
3 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
4
5
6 @a = internal addrspace(2) constant [1 x i8] [ i8 7 ], align 1
7
8 ; FUNC-LABEL: @test_i8
9 ; EG: CF_END
10 ; SI: BUFFER_STORE_BYTE
11 ; SI: S_ENDPGM
12 define void @test_i8( i32 %s, i8 addrspace(1)* %out) #3 {
13   %arrayidx = getelementptr inbounds [1 x i8] addrspace(2)* @a, i32 0, i32 %s
14   %1 = load i8 addrspace(2)* %arrayidx, align 1
15   store i8 %1, i8 addrspace(1)* %out
16   ret void
17 }
18
19 @b = internal addrspace(2) constant [1 x i16] [ i16 7 ], align 2
20
21 ; FUNC-LABEL: @test_i16
22 ; EG: CF_END
23 ; SI: BUFFER_STORE_SHORT
24 ; SI: S_ENDPGM
25 define void @test_i16( i32 %s, i16 addrspace(1)* %out) #3 {
26   %arrayidx = getelementptr inbounds [1 x i16] addrspace(2)* @b, i32 0, i32 %s
27   %1 = load i16 addrspace(2)* %arrayidx, align 2
28   store i16 %1, i16 addrspace(1)* %out
29   ret void
30 }