AMDGPU/SI: Use flat for global load/store when targeting HSA
[oota-llvm.git] / test / CodeGen / AMDGPU / ci-use-flat-for-global.ll
1 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck -check-prefix=HSA-DEFAULT %s
2 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-flat-for-global | FileCheck -check-prefix=HSA-NODEFAULT %s
3 ; RUN: llc < %s -mtriple=amdgcn -mcpu=kaveri | FileCheck -check-prefix=NOHSA-DEFAULT %s
4 ; RUN: llc < %s -mtriple=amdgcn -mcpu=kaveri -mattr=+flat-for-global | FileCheck -check-prefix=NOHSA-NODEFAULT %s
5
6
7 ; HSA-DEFAULT: flat_store_dword
8 ; HSA-NODEFAULT: buffer_store_dword
9 ; NOHSA-DEFAULT: buffer_store_dword
10 ; NOHSA-NODEFAULT: flat_store_dword
11 define void @test(i32 addrspace(1)* %out) {
12 entry:
13   store i32 0, i32 addrspace(1)* %out
14   ret void
15 }