[lld] r360046 - [AMDGPU][test] Define local symbols used in amdgpu-relocs.s
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 07:18:00 PDT 2019
Author: maskray
Date: Mon May 6 07:17:59 2019
New Revision: 360046
URL: http://llvm.org/viewvc/llvm-project?rev=360046&view=rev
Log:
[AMDGPU][test] Define local symbols used in amdgpu-relocs.s
Differential Revision: https://reviews.llvm.org/D61594
Modified:
lld/trunk/test/ELF/amdgpu-relocs.s
Modified: lld/trunk/test/ELF/amdgpu-relocs.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/amdgpu-relocs.s?rev=360046&r1=360045&r2=360046&view=diff
==============================================================================
--- lld/trunk/test/ELF/amdgpu-relocs.s (original)
+++ lld/trunk/test/ELF/amdgpu-relocs.s Mon May 6 07:17:59 2019
@@ -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
-
-# OBJDUMP: Contents of section nonalloc:
-# OBJDUMP-NEXT: 0000 00000000 14380000 00000000 18340000
-# OBJDUMP-NEXT: 00000000 1c300000
+# NM: 0000000000003010 B common_var0
+# NM: 0000000000003410 B common_var1
+# NM: 0000000000003810 B common_var2
+# NM: 0000000000003008 d temp2
+
+# 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
More information about the llvm-commits
mailing list