From: Kevin Enderby Date: Mon, 23 Jun 2014 20:27:53 +0000 (+0000) Subject: Change the default input for llvm-nm to be a.out instead of standard input X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fc2edb02393d98b94d1e164586bfe0b9b42b726;p=platform%2Fupstream%2Fllvm.git Change the default input for llvm-nm to be a.out instead of standard input 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. llvm-svn: 211529 --- diff --git a/llvm/test/LTO/no-undefined-puts-when-implemented.ll b/llvm/test/LTO/no-undefined-puts-when-implemented.ll index 18f5d21..29db8a6 100644 --- a/llvm/test/LTO/no-undefined-puts-when-implemented.ll +++ b/llvm/test/LTO/no-undefined-puts-when-implemented.ll @@ -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 diff --git a/llvm/test/MC/COFF/lset0.s b/llvm/test/MC/COFF/lset0.s index f5020c8..7321b01 100755 --- a/llvm/test/MC/COFF/lset0.s +++ b/llvm/test/MC/COFF/lset0.s @@ -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 diff --git a/llvm/test/MC/MachO/eh_symbol.s b/llvm/test/MC/MachO/eh_symbol.s index 1135196..738e2b6 100644 --- a/llvm/test/MC/MachO/eh_symbol.s +++ b/llvm/test/MC/MachO/eh_symbol.s @@ -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 diff --git a/llvm/test/Object/nm-trivial-object.test b/llvm/test/Object/nm-trivial-object.test index c53dc91e..49a7bb1 100644 --- a/llvm/test/Object/nm-trivial-object.test +++ b/llvm/test/Object/nm-trivial-object.test @@ -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 diff --git a/llvm/test/Other/llvm-nm-without-aliases.ll b/llvm/test/Other/llvm-nm-without-aliases.ll index 9d9408c..6ef72c7 100644 --- a/llvm/test/Other/llvm-nm-without-aliases.ll +++ b/llvm/test/Other/llvm-nm-without-aliases.ll @@ -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 diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 5221d4d..f706bcd 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -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: