[llvm] 2f60eda - [llvm-readobj][test] - Refactor mips-st-other.test
Georgii Rymar via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 00:29:28 PST 2019
Author: Georgii Rymar
Date: 2019-12-19T11:23:39+03:00
New Revision: 2f60edaa747615571a3cbea9bc1d47953a5c11cd
URL: https://github.com/llvm/llvm-project/commit/2f60edaa747615571a3cbea9bc1d47953a5c11cd
DIFF: https://github.com/llvm/llvm-project/commit/2f60edaa747615571a3cbea9bc1d47953a5c11cd.diff
LOG: [llvm-readobj][test] - Refactor mips-st-other.test
This removes 2 precompiled binaries, adds testing
for STO_* flags missing, refines and renames the test.
Differential revision: https://reviews.llvm.org/D71651
Added:
llvm/test/tools/llvm-readobj/ELF/mips-symbols-stother.test
Modified:
Removed:
llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips
llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips16
llvm/test/tools/llvm-readobj/ELF/mips-st-other.test
################################################################################
diff --git a/llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips b/llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips
deleted file mode 100644
index 80cefc192d4d..000000000000
Binary files a/llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips and /dev/null
diff er
diff --git a/llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips16 b/llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips16
deleted file mode 100644
index 5f0a0e3de8ea..000000000000
Binary files a/llvm/test/tools/llvm-readobj/ELF/Inputs/st-other.obj.elf-mips16 and /dev/null
diff er
diff --git a/llvm/test/tools/llvm-readobj/ELF/mips-st-other.test b/llvm/test/tools/llvm-readobj/ELF/mips-st-other.test
deleted file mode 100644
index c164004c1412..000000000000
--- a/llvm/test/tools/llvm-readobj/ELF/mips-st-other.test
+++ /dev/null
@@ -1,25 +0,0 @@
-RUN: llvm-readobj --symbols %p/Inputs/st-other.obj.elf-mips \
-RUN: | FileCheck -check-prefix=MREG %s
-RUN: llvm-readobj --symbols %p/Inputs/st-other.obj.elf-mips16 \
-RUN: | FileCheck -check-prefix=M16 %s
-
-MREG: Name: foo
-MREG-NEXT: Value: 0x0
-MREG-NEXT: Size: 0
-MREG-NEXT: Binding: Global
-MREG-NEXT: Type: None
-MREG-NEXT: Other [ (0x29)
-MREG-NEXT: STO_MIPS_PIC (0x20)
-MREG-NEXT: STO_MIPS_PLT (0x8)
-MREG-NEXT: STV_INTERNAL (0x1)
-MREG-NEXT: ]
-
-M16: Name: foo
-M16-NEXT: Value: 0x0
-M16-NEXT: Size: 0
-M16-NEXT: Binding: Global
-M16-NEXT: Type: None
-M16-NEXT: Other [ (0xF1)
-M16-NEXT: STO_MIPS_MIPS16 (0xF0)
-M16-NEXT: STV_INTERNAL (0x1)
-M16-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/ELF/mips-symbols-stother.test b/llvm/test/tools/llvm-readobj/ELF/mips-symbols-stother.test
new file mode 100644
index 000000000000..37415faea8ab
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/mips-symbols-stother.test
@@ -0,0 +1,39 @@
+## Check that we are able to dump MIPS STO_* flags correctly when dumping symbols.
+
+# RUN: yaml2obj %s -o %t.o
+# RUN: llvm-readobj --symbols %t.o | FileCheck %s --strict-whitespace --check-prefix=MIPS-LLVM
+# RUN: llvm-readelf --symbols %t.o | FileCheck %s --strict-whitespace --check-prefix=MIPS-GNU
+
+# MIPS-LLVM:Name: foo
+# MIPS-LLVM:Other [
+# MIPS-LLVM-NEXT: STO_MIPS_MICROMIPS (0x80)
+# MIPS-LLVM-NEXT: STO_MIPS_OPTIONAL (0x4)
+# MIPS-LLVM-NEXT: STO_MIPS_PIC (0x20)
+# MIPS-LLVM-NEXT: STO_MIPS_PLT (0x8)
+# MIPS-LLVM-NEXT:]
+
+# MIPS-LLVM:Name: bar
+# MIPS-LLVM:Other [
+# MIPS-LLVM-NEXT: STO_MIPS_MIPS16 (0xF0)
+# MIPS-LLVM-NEXT:]
+
+# MIPS-GNU:Symbol table '.symtab' contains 3 entries:
+# MIPS-GNU-NEXT: Num: Value Size Type Bind Vis Ndx Name
+# MIPS-GNU-NEXT: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+# MIPS-GNU-NEXT: 1: 00000000 0 NOTYPE LOCAL DEFAULT [<other: 0xac>] UND foo
+# MIPS-GNU-NEXT: 2: 00000000 0 NOTYPE LOCAL DEFAULT [<other: 0xf0>] UND bar
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+Symbols:
+ - Name: foo
+ Other: [ STO_MIPS_MICROMIPS, STO_MIPS_PIC,
+ STO_MIPS_PLT, STO_MIPS_OPTIONAL]
+## Use a
diff erent symbol for STO_MIPS_MIPS16 (0xf0) as it interferes
+## with STO_MIPS_PIC (0x20) and STO_MIPS_MICROMIPS (0x80).
+ - Name: bar
+ Other: [ STO_MIPS_MIPS16 ]
More information about the llvm-commits
mailing list