summaryrefslogtreecommitdiff
path: root/test/tools/llvm-objdump
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-06-11 18:16:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-06-11 18:16:27 +0000
commit687a64222b4c87c825258d4dfeb1f0794e8cb300 (patch)
treef15e528223c9e06e4ed874e21ad41c2eb169030b /test/tools/llvm-objdump
parent24eadf6f46cd3637ffe867648ce8eca7314115c6 (diff)
Notes
Diffstat (limited to 'test/tools/llvm-objdump')
-rw-r--r--test/tools/llvm-objdump/AMDGPU/source-lines.ll4
-rw-r--r--test/tools/llvm-objdump/PowerPC/branch-offset.s43
-rw-r--r--test/tools/llvm-objdump/PowerPC/lit.local.cfg2
-rw-r--r--test/tools/llvm-objdump/eh_frame-coff.test4
-rw-r--r--test/tools/llvm-objdump/elf-symbol-visibility.test37
5 files changed, 86 insertions, 4 deletions
diff --git a/test/tools/llvm-objdump/AMDGPU/source-lines.ll b/test/tools/llvm-objdump/AMDGPU/source-lines.ll
index 748f04754e4b3..4a4203d2a52e0 100644
--- a/test/tools/llvm-objdump/AMDGPU/source-lines.ll
+++ b/test/tools/llvm-objdump/AMDGPU/source-lines.ll
@@ -12,7 +12,7 @@
; LINE: v_mov_b32_e32 v{{[0-9]+}}, 0x888
; LINE: ; {{.*}}source-lines.cl:3
; LINE: ; {{.*}}source-lines.cl:4
-; LINE: v_add_u32_e32
+; LINE: v_add_u32_e64
; LINE: ; {{.*}}source-lines.cl:5
; LINE: flat_store_dword
; Epilogue.
@@ -28,7 +28,7 @@
; SOURCE: v_mov_b32_e32 v{{[0-9]+}}, 0x888
; SOURCE: ; int var1 = 0x888;
; SOURCE: ; int var2 = var0 + var1;
-; SOURCE: v_add_u32_e32
+; SOURCE: v_add_u32_e64
; SOURCE: ; *Out = var2;
; SOURCE: flat_store_dword
; Epilogue.
diff --git a/test/tools/llvm-objdump/PowerPC/branch-offset.s b/test/tools/llvm-objdump/PowerPC/branch-offset.s
new file mode 100644
index 0000000000000..b0b3f05f9cdb5
--- /dev/null
+++ b/test/tools/llvm-objdump/PowerPC/branch-offset.s
@@ -0,0 +1,43 @@
+# RUN: llvm-mc -triple=powerpc64le-unknown-linux -filetype=obj %s -o %t.o
+# RUN: llvm-objdump -d %t.o | FileCheck %s
+
+# RUN: llvm-mc -triple=powerpc64-unknown-linux -filetype=obj %s -o %t.o
+# RUN: llvm-objdump -d %t.o | FileCheck %s
+
+# RUN: llvm-mc -triple=powerpc-unknown-linux -filetype=obj %s -o %t.o
+# RUN: llvm-objdump -d %t.o | FileCheck %s
+
+# CHECK: 0000000000000000 callee_back:
+# CHECK: 18: {{.*}} bl .-24
+# CHECK: 20: {{.*}} bl .+16
+# CHECK: 0000000000000030 callee_forward:
+
+ .text
+ .global caller
+ .type caller,@function
+ .type callee_forward,@function
+ .type callee_back,@function
+
+ .p2align 4
+callee_back:
+ li 3, 55
+ blr
+
+ .p2align 4
+caller:
+.Lgep:
+ addis 2, 12, .TOC.-.Lgep@ha
+ addi 2, 2, .TOC.-.Lgep@l
+.Llep:
+ .localentry caller, .Llep-.Lgep
+ bl callee_back
+ mr 31, 3
+ bl callee_forward
+ add 3, 3, 31
+ blr
+
+ .p2align 4
+callee_forward:
+ li 3, 66
+ blr
+
diff --git a/test/tools/llvm-objdump/PowerPC/lit.local.cfg b/test/tools/llvm-objdump/PowerPC/lit.local.cfg
new file mode 100644
index 0000000000000..b77510721e100
--- /dev/null
+++ b/test/tools/llvm-objdump/PowerPC/lit.local.cfg
@@ -0,0 +1,2 @@
+if not 'PowerPC' in config.root.targets:
+ config.unsupported = True
diff --git a/test/tools/llvm-objdump/eh_frame-coff.test b/test/tools/llvm-objdump/eh_frame-coff.test
index 74eceeec4f31a..cb481939dcc83 100644
--- a/test/tools/llvm-objdump/eh_frame-coff.test
+++ b/test/tools/llvm-objdump/eh_frame-coff.test
@@ -8,7 +8,7 @@
# CHECK: Code alignment factor: 1
# CHECK: Data alignment factor: -4
# CHECK: Return address column: 8
-# CHECK: Personality Address: 004025d7
+# CHECK: Personality Address: 00000000004025d7
# CHECK: Augmentation data: 00 D7 25 40 00 00 00
# CHECK: DW_CFA_def_cfa: reg4 +4
@@ -17,7 +17,7 @@
# CHECK: DW_CFA_nop:
# CHECK: 00000020 0000001c 00000024 FDE cie=00000024 pc=00401410...00401488
-# CHECK: LSDA Address: 00406000
+# CHECK: LSDA Address: 0000000000406000
# CHECK: DW_CFA_advance_loc: 1
# CHECK: DW_CFA_def_cfa_offset: +8
# CHECK: DW_CFA_offset: reg5 -8
diff --git a/test/tools/llvm-objdump/elf-symbol-visibility.test b/test/tools/llvm-objdump/elf-symbol-visibility.test
new file mode 100644
index 0000000000000..da7f6d285166a
--- /dev/null
+++ b/test/tools/llvm-objdump/elf-symbol-visibility.test
@@ -0,0 +1,37 @@
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objdump --syms %t | FileCheck %s
+
+# CHECK: SYMBOL TABLE:
+# CHECK-NEXT: .text 00000000 default
+# CHECK-NEXT: .text 00000000 .internal internal
+# CHECK-NEXT: .text 00000000 .hidden hidden
+# CHECK-NEXT: .text 00000000 .protected protected
+# CHECK-NEXT: .text 00000000 0x20 mips_pic
+
+!ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+Symbols:
+ Local:
+ - Name: default
+ Section: .text
+ - Name: internal
+ Visibility: STV_INTERNAL
+ Section: .text
+ - Name: hidden
+ Visibility: STV_HIDDEN
+ Section: .text
+ - Name: protected
+ Visibility: STV_PROTECTED
+ Section: .text
+ - Name: mips_pic
+ Other: [ STO_MIPS_PIC ]
+ Section: .text