summaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/NVPTX/weak-global.ll
blob: 06c2cd86ee8df05077cd102210e1e89536db98cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 -mattr=+ptx43 | FileCheck %s --check-prefix PTX43
; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 -mattr=+ptx50 | FileCheck %s --check-prefix PTX50
; RUN: %if ptxas-isa-4.3 %{ llc < %s -mtriple=nvptx64 -mcpu=sm_20 -mattr=+ptx43 | %ptxas-verify %}
; RUN: %if ptxas-isa-5.0 %{ llc < %s -mtriple=nvptx64 -mcpu=sm_20 -mattr=+ptx50 | %ptxas-verify %}

; PTX43: .weak .global .align 4 .u32 g
; PTX50: .common .global .align 4 .u32 g
@g = common addrspace(1) global i32 zeroinitializer

define i32 @func0() {
  %val = load i32, ptr addrspace(1) @g
  ret i32 %val
}