[AMDGPU][test] Define local symbols used in amdgpu-relocs.s

Differential Revision: https://reviews.llvm.org/D61594

llvm-svn: 360046
This commit is contained in:
Fangrui Song 2019-05-06 14:17:59 +00:00
parent 9ce8b7e95f
commit 12fb52007b
1 changed files with 19 additions and 7 deletions

View File

@ -2,7 +2,8 @@
# RUN: llvm-mc -filetype=obj -triple=amdgcn--amdhsa -mcpu=fiji %s -o %t.o
# RUN: ld.lld --hash-style=sysv -shared %t.o -o %t.so
# RUN: llvm-readobj -r %t.so | FileCheck %s
# RUN: llvm-objdump -s %t.so | FileCheck %s --check-prefix=OBJDUMP
# RUN: llvm-nm %t.so | FileCheck %s --check-prefix=NM
# RUN: llvm-readelf -x .rodata -x nonalloc %t.so | FileCheck %s --check-prefix=HEX
.text
@ -48,6 +49,9 @@ kernel0:
.local local_var0
.local local_var1
.local local_var2
local_var0:
local_var1:
local_var2:
# R_AMDGPU_ABS32:
.section nonalloc, "w", @progbits
@ -68,6 +72,7 @@ ptr:
.type temp2, @object
.local temp2
.size temp2, 4
temp2:
.type ptr2, @object
.globl ptr2
@ -89,7 +94,7 @@ foo:
# linker.
# CHECK: Relocations [
# CHECK: .rela.dyn {
# CHECK-NEXT: R_AMDGPU_RELATIVE64 - 0x0
# CHECK-NEXT: R_AMDGPU_RELATIVE64 - 0x3008
# CHECK-NEXT: R_AMDGPU_ABS64 common_var0 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 common_var1 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 common_var2 0x0
@ -109,9 +114,16 @@ foo:
# CHECK-NEXT: }
# CHECK-NEXT: ]
# OBJDUMP: Contents of section .rodata:
# OBJDUMP: 98f8ffff ffffffff
# NM: 0000000000003010 B common_var0
# NM: 0000000000003410 B common_var1
# NM: 0000000000003810 B common_var2
# NM: 0000000000003008 d temp2
# OBJDUMP: Contents of section nonalloc:
# OBJDUMP-NEXT: 0000 00000000 14380000 00000000 18340000
# OBJDUMP-NEXT: 00000000 1c300000
# temp2 - foo = 0x3008-0x768 = 0x28a0
# HEX: section '.rodata':
# HEX-NEXT: 0x00000768 a0280000 00000000
# common_var2+4, common_var1+8, and common_var0+12.
# HEX: section 'nonalloc':
# HEX-NEXT: 0x00000000 00000000 14380000 00000000 18340000
# HEX-NEXT: 0x00000010 00000000 1c300000