From 713096fb68aaf51447c6e4fd3c9e4cc60ec7e0ef Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 21 May 2014 22:42:38 +0000 Subject: [PATCH] R600: Add failing testcases for constant initializers. Constant initializers involving illegal types hit an assertion. Patch by: Jan Vesely git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209330 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/R600/gv-const-addrspace-fail.ll | 30 ++++++++++++++++++++ test/CodeGen/R600/gv-const-addrspace.ll | 30 +++++++++++--------- 2 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 test/CodeGen/R600/gv-const-addrspace-fail.ll diff --git a/test/CodeGen/R600/gv-const-addrspace-fail.ll b/test/CodeGen/R600/gv-const-addrspace-fail.ll new file mode 100644 index 00000000000..f217ab5df7f --- /dev/null +++ b/test/CodeGen/R600/gv-const-addrspace-fail.ll @@ -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 +} diff --git a/test/CodeGen/R600/gv-const-addrspace.ll b/test/CodeGen/R600/gv-const-addrspace.ll index cda7ab1fccd..a3504df77b3 100644 --- a/test/CodeGen/R600/gv-const-addrspace.ll +++ b/test/CodeGen/R600/gv-const-addrspace.ll @@ -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: