llvm-project/llvm/test/CodeGen/NVPTX/globals_lowering.ll
Jake Egan 56049b7129 Fix tests defaulting to incorrect triples on AIX
The tests only specify -march, so when the tests are run on AIX the target OS defaults to AIX, which causes the tests to misbehave.

This patch constrains the tests by specifying -mtriple instead of -march.

Reviewed By: daltenty, jsji, MaskRay

Differential Revision: https://reviews.llvm.org/D110186
2021-09-27 11:30:45 -04:00

16 lines
697 B
LLVM

; RUN: llc < %s -mtriple=nvptx -mcpu=sm_20 -relocation-model=static | FileCheck %s --check-prefix CHK
%MyStruct = type { i32, i32, float }
@Gbl = internal addrspace(3) global [1024 x %MyStruct] zeroinitializer
; CHK-LABEL: foo
define void @foo(float %f) {
entry:
; CHK: ld.shared.f32 %{{[a-zA-Z0-9]+}}, [Gbl+8];
%0 = load float, float addrspace(3)* getelementptr inbounds ([1024 x %MyStruct], [1024 x %MyStruct] addrspace(3)* @Gbl, i32 0, i32 0, i32 2)
%add = fadd float %0, %f
; CHK: st.shared.f32 [Gbl+8], %{{[a-zA-Z0-9]+}};
store float %add, float addrspace(3)* getelementptr inbounds ([1024 x %MyStruct], [1024 x %MyStruct] addrspace(3)* @Gbl, i32 0, i32 0, i32 2)
ret void
}