R600: Add failing testcases for constant initializers.

Constant initializers involving illegal types hit an assertion.

Patch by: Jan Vesely <jan.vesely@rutgers.edu>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209330 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault 2014-05-21 22:42:38 +00:00
parent 5fe59a2e10
commit 713096fb68
2 changed files with 47 additions and 13 deletions

View File

@ -0,0 +1,30 @@
; XFAIL: *
; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
@a = internal addrspace(2) constant [1 x i8] [ i8 7 ], align 1
; FUNC-LABEL: @test_i8
; EG: CF_END
; SI: BUFFER_STORE_BYTE
; SI: S_ENDPGM
define void @test_i8( i32 %s, i8 addrspace(1)* %out) #3 {
%arrayidx = getelementptr inbounds [1 x i8] addrspace(2)* @a, i32 0, i32 %s
%1 = load i8 addrspace(2)* %arrayidx, align 1
store i8 %1, i8 addrspace(1)* %out
ret void
}
@b = internal addrspace(2) constant [1 x i16] [ i16 7 ], align 2
; FUNC-LABEL: @test_i16
; EG: CF_END
; SI: BUFFER_STORE_SHORT
; SI: S_ENDPGM
define void @test_i16( i32 %s, i16 addrspace(1)* %out) #3 {
%arrayidx = getelementptr inbounds [1 x i16] addrspace(2)* @b, i32 0, i32 %s
%1 = load i16 addrspace(2)* %arrayidx, align 2
store i16 %1, i16 addrspace(1)* %out
ret void
}

View File

@ -1,4 +1,8 @@
; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=R600 --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
@b = internal addrspace(2) constant [1 x i16] [ i16 7 ], align 2
; XXX: Test on SI once 64-bit adds are supportes.
@ -6,12 +10,12 @@
; FUNC-LABEL: @float
; R600-DAG: MOV {{\** *}}T2.X
; R600-DAG: MOV {{\** *}}T3.X
; R600-DAG: MOV {{\** *}}T4.X
; R600-DAG: MOV {{\** *}}T5.X
; R600-DAG: MOV {{\** *}}T6.X
; R600: MOVA_INT
; EG-DAG: MOV {{\** *}}T2.X
; EG-DAG: MOV {{\** *}}T3.X
; EG-DAG: MOV {{\** *}}T4.X
; EG-DAG: MOV {{\** *}}T5.X
; EG-DAG: MOV {{\** *}}T6.X
; EG: MOVA_INT
define void @float(float addrspace(1)* %out, i32 %index) {
entry:
@ -25,12 +29,12 @@ entry:
; FUNC-LABEL: @i32
; R600-DAG: MOV {{\** *}}T2.X
; R600-DAG: MOV {{\** *}}T3.X
; R600-DAG: MOV {{\** *}}T4.X
; R600-DAG: MOV {{\** *}}T5.X
; R600-DAG: MOV {{\** *}}T6.X
; R600: MOVA_INT
; EG-DAG: MOV {{\** *}}T2.X
; EG-DAG: MOV {{\** *}}T3.X
; EG-DAG: MOV {{\** *}}T4.X
; EG-DAG: MOV {{\** *}}T5.X
; EG-DAG: MOV {{\** *}}T6.X
; EG: MOVA_INT
define void @i32(i32 addrspace(1)* %out, i32 %index) {
entry: