summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-07-24 23:31:52 +0000
committerKevin Enderby <enderby@apple.com>2014-07-24 23:31:52 +0000
commit08e1bbd6457541ee2983eacbb588b74acd62a897 (patch)
treee2ff48b0267a07a108e5fe78730e15c29cd8a00c /llvm/test
parentab131e86ce4180ca0906a4c556d618a61100afe7 (diff)
downloadbcm5719-llvm-08e1bbd6457541ee2983eacbb588b74acd62a897.tar.gz
bcm5719-llvm-08e1bbd6457541ee2983eacbb588b74acd62a897.zip
Add an implementation for llvm-nm’s -print-file-name option (aka -o and -A).
The -print-file-name option in llvm-nm is to precede each symbol with the object file it came from. While code for the parsing of this option and its aliases existed there was no code to implement it. llvm-svn: 213906
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Object/nm-archive.test9
-rw-r--r--llvm/test/Object/nm-trivial-object.test15
-rw-r--r--llvm/test/Object/nm-universal-binary.test10
3 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/Object/nm-archive.test b/llvm/test/Object/nm-archive.test
index 7dbc22a1e8c..b2a196ef44f 100644
--- a/llvm/test/Object/nm-archive.test
+++ b/llvm/test/Object/nm-archive.test
@@ -9,6 +9,15 @@ COFF-NEXT: U _SomeOtherFunction
COFF-NEXT: 00000000 T _main
COFF-NEXT: U _puts
+RUN: llvm-nm -o %p/Inputs/archive-test.a-coff-i386 \
+RUN: | FileCheck %s -check-prefix COFF-o
+
+COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d .data
+COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 t .text
+COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d L_.str
+COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: U _SomeOtherFunction
+COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 T _main
+COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: U _puts
RUN: llvm-as %p/Inputs/trivial.ll -o=%t1
RUN: rm -f %t2
diff --git a/llvm/test/Object/nm-trivial-object.test b/llvm/test/Object/nm-trivial-object.test
index 49c7683c80d..a7bb7caad1d 100644
--- a/llvm/test/Object/nm-trivial-object.test
+++ b/llvm/test/Object/nm-trivial-object.test
@@ -4,6 +4,8 @@ RUN: yaml2obj %p/Inputs/COFF/x86-64.yaml | llvm-nm - \
RUN: | FileCheck %s -check-prefix COFF
RUN: llvm-nm %p/Inputs/trivial-object-test.elf-i386 \
RUN: | FileCheck %s -check-prefix ELF
+RUN: llvm-nm -o %p/Inputs/trivial-object-test.elf-i386 \
+RUN: | FileCheck %s -check-prefix ELF-o
RUN: llvm-nm %p/Inputs/trivial-object-test.elf-x86-64 \
RUN: | FileCheck %s -check-prefix ELF64
RUN: llvm-nm %p/Inputs/weak.elf-x86-64 \
@@ -26,6 +28,8 @@ RUN: llvm-nm %p/Inputs/macho-text-data-bss.macho-x86_64 -s __DATA __data \
RUN: | FileCheck %s -check-prefix macho-s
RUN: llvm-nm -x %p/Inputs/macho-text-data-bss.macho-x86_64 \
RUN: | FileCheck %s -check-prefix macho-x
+RUN: llvm-nm -o %p/Inputs/macho-text-data-bss.macho-x86_64 \
+RUN: | FileCheck %s -check-prefix macho-o
RUN: llvm-nm -p -a %p/Inputs/macho-hello-g.macho-x86_64 \
RUN: | FileCheck %s -check-prefix macho-pa
RUN: llvm-nm %p/Inputs/common.coff-i386 \
@@ -62,6 +66,10 @@ ELF: U SomeOtherFunction
ELF: 00000000 T main
ELF: U puts
+ELF-o: {{.*}}/trivial-object-test.elf-i386: U SomeOtherFunction
+ELF-o: {{.*}}/trivial-object-test.elf-i386: 00000000 T main
+ELF-o: {{.*}}/trivial-object-test.elf-i386: U puts
+
ELF64: U SomeOtherFunction
ELF64: 0000000000000000 T main
ELF64: U puts
@@ -117,6 +125,13 @@ macho-x: 000000000000000c 0f 02 0000 00000004 _d
macho-x: 0000000000000000 0f 01 0000 00000001 _t
macho-x: 0000000000000048 0f 05 0000 00000007 _t.eh
+
+macho-o: {{.*}}/macho-text-data-bss.macho-x86_64: 0000000000000030 s EH_frame0
+macho-o: {{.*}}/macho-text-data-bss.macho-x86_64: 0000000000000070 b _b
+macho-o: {{.*}}/macho-text-data-bss.macho-x86_64: 000000000000000c D _d
+macho-o: {{.*}}/macho-text-data-bss.macho-x86_64: 0000000000000000 T _t
+macho-o: {{.*}}/macho-text-data-bss.macho-x86_64: 0000000000000048 S _t.eh
+
macho-pa: 0000000000000000 - 00 0000 SO /Volumes/SandBox/
macho-pa: 0000000000000000 - 00 0000 SO hello.c
macho-pa: 0000000053c8408d - 03 0001 OSO /Volumes/SandBox/hello.o
diff --git a/llvm/test/Object/nm-universal-binary.test b/llvm/test/Object/nm-universal-binary.test
index 889377b5b35..732445e778b 100644
--- a/llvm/test/Object/nm-universal-binary.test
+++ b/llvm/test/Object/nm-universal-binary.test
@@ -6,6 +6,8 @@ RUN: llvm-nm -arch all %p/Inputs/macho-universal-archive.x86_64.i386 \
RUN: | FileCheck %s -check-prefix CHECK-AR
RUN: llvm-nm -arch i386 %p/Inputs/macho-universal-archive.x86_64.i386 \
RUN: | FileCheck %s -check-prefix CHECK-AR-i386
+RUN: llvm-nm -o -arch all %p/Inputs/macho-universal-archive.x86_64.i386 \
+RUN: | FileCheck %s -check-prefix CHECK-AR-o
CHECK-OBJ: macho-universal.x86_64.i386 (for architecture x86_64):
CHECK-OBJ: 0000000100000f60 T _main
@@ -29,3 +31,11 @@ CHECK-AR: 00000000 T _foo
CHECK-AR-i386: macho-universal-archive.x86_64.i386(foo.o):
CHECK-AR-i386: 00000008 D _bar
CHECK-AR-i386: 00000000 T _foo
+
+CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 0000000000000068 s EH_frame0
+CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 000000000000003b s L_.str
+CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 0000000000000000 T _main
+CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 0000000000000080 S _main.eh
+CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: U _printf
+CHECK-AR-o: (for architecture i386):{{.*}}/macho-universal-archive.x86_64.i386:foo.o: 00000008 D _bar
+CHECK-AR-o: (for architecture i386):{{.*}}/macho-universal-archive.x86_64.i386:foo.o: 00000000 T _foo
OpenPOWER on IntegriCloud