Change the default input for llvm-nm to be a.out instead of standard input
authorKevin Enderby <enderby@apple.com>
Mon, 23 Jun 2014 20:27:53 +0000 (20:27 +0000)
committerKevin Enderby <enderby@apple.com>
Mon, 23 Jun 2014 20:27:53 +0000 (20:27 +0000)
to match llvm-size and other UNIX systems for their nm(1).

Tweak test cases that used llvm-nm with standard input to add a "-" to
indicate that and add a test case to check the default of a.out for llvm-nm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211529 91177308-0d34-0410-b5e6-96231b3b80d8

test/LTO/no-undefined-puts-when-implemented.ll
test/MC/COFF/lset0.s
test/MC/MachO/eh_symbol.s
test/Object/nm-trivial-object.test
test/Other/llvm-nm-without-aliases.ll
tools/llvm-nm/llvm-nm.cpp

index 18f5d214812716f3438c29e300b47a426b1b07b7..29db8a63d1dd773b7de9abf87b7e8b7b8850a712 100644 (file)
@@ -1,6 +1,6 @@
 ; RUN: llvm-as <%s >%t1
 ; RUN: llvm-lto -exported-symbol=_uses_puts -exported-symbol=_uses_printf -o - %t1 | \
-; RUN: llvm-nm | \
+; RUN: llvm-nm | \
 ; RUN: FileCheck %s
 ; rdar://problem/16165191
 ; runtime library implementations should not be renamed
index f5020c83ef60c3df1720d1c5cbff2d220e4f50a9..7321b0117b17fc11c65e1606889592f89a74f606 100755 (executable)
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - | llvm-nm | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - | llvm-nm | FileCheck %s
 
 not_global = 123
 global = 456
index 11351964f5aaf58c2152fa8a77a61bde1bd994f9..738e2b67d0defae2ed40c26e10ce0242fba990e8 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-nm | FileCheck %s
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-nm | FileCheck %s
 
 // test that we don't produce foo.eh symbols in a debug_frame section.
 // CHECK-NOT: _f.eh
index c53dc91ecd4c6a47c3673ed1f7e2c9deba0e0309..49a7bb14740f1234bed0b3957dcd7ba40402cab8 100644 (file)
@@ -1,6 +1,6 @@
-RUN: yaml2obj %p/Inputs/COFF/i386.yaml | llvm-nm \
+RUN: yaml2obj %p/Inputs/COFF/i386.yaml | llvm-nm \
 RUN:         | FileCheck %s -check-prefix COFF
-RUN: yaml2obj %p/Inputs/COFF/x86-64.yaml | llvm-nm \
+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
@@ -22,6 +22,10 @@ RUN: llvm-nm %p/Inputs/relocatable-with-section-address.elf-x86-64 \
 RUN:         | FileCheck %s -check-prefix ELF-SEC-ADDR64
 RUN: llvm-nm %p/Inputs/thumb-symbols.elf.arm \
 RUN:         | FileCheck %s -check-prefix ELF-THUMB
+RUN: mkdir -p %t
+RUN: cd %t
+RUN: cp %p/Inputs/trivial-object-test.macho-i386 a.out
+RUN: llvm-nm | FileCheck %s -check-prefix A-OUT
 
 
 COFF: 00000000 d .data
@@ -83,3 +87,7 @@ ELF-SEC-ADDR64-NEXT: 0000000000000060 D p
 Test that we drop the thumb bit only from function addresses.
 ELF-THUMB: 00000000 t f
 ELF-THUMB: 00000003 t g
+
+A-OUT:          U _SomeOtherFunction
+A-OUT: 00000000 T _main
+A-OUT:          U _puts
index 9d9408c13b6dfcdc386c224cebb0c1f0e8e0f80d..6ef72c7423288ba3ac23fc87bce105ff93f81bb5 100644 (file)
@@ -1,6 +1,6 @@
 ; RUN: llvm-as < %s > %t
-; RUN: llvm-nm -without-aliases < %t | FileCheck %s
-; RUN: llvm-nm < %t | FileCheck --check-prefix=WITH %s
+; RUN: llvm-nm -without-aliases < %t | FileCheck %s
+; RUN: llvm-nm < %t | FileCheck --check-prefix=WITH %s
 
 ; CHECK-NOT: T a0bar
 ; CHECK-NOT: T a0foo
index 5221d4d18d9af83ed51c19e62024c35284209bb6..f706bcdc2b3eb90584d88196eb93af04ed9b9582 100644 (file)
@@ -845,7 +845,7 @@ int main(int argc, char **argv) {
 
   switch (InputFilenames.size()) {
   case 0:
-    InputFilenames.push_back("-");
+    InputFilenames.push_back("a.out");
   case 1:
     break;
   default: