forked from rust-lang/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tools] [llvm-nm] Default to reading from stdin not a.out
Summary: This moves away from defaulting to a.out and uses stdin only if stdin has a file redirected to it. This has been discussed on the llvm-dev mailing list [[ https://lists.llvm.org/pipermail/llvm-dev/2019-July/133642.html | here ]]. Reviewers: jhenderson, rupprecht, MaskRay, chrisjackson Reviewed By: jhenderson, MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64290 llvm-svn: 365889
- Loading branch information
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## Test llvm-nm when using stdin both explicitly (using '-' as a filename) | ||
## and implicitly (not specifying any filename). | ||
|
||
# RUN: yaml2obj %s -o %t.o | ||
|
||
## Pass an explicit filename to produce a baseline output. llvm-nm should | ||
## have the same behavior when opening a file itself and when reading that | ||
## file from its standard input stream. | ||
# RUN: llvm-nm %t.o > %t.base 2> %t.err | ||
|
||
## Make sure there is no warning message about no file redirected to stdin. | ||
# RUN: FileCheck %s --input-file=%t.err --allow-empty --implicit-check-not={{.}} | ||
|
||
# RUN: llvm-nm - < %t.o > %t.explicit 2> %t.err | ||
# RUN: FileCheck %s --input-file=%t.err --allow-empty --implicit-check-not={{.}} | ||
# RUN: cmp %t.base %t.explicit | ||
|
||
# RUN: llvm-nm < %t.o > %t.implicit 2> %t.err | ||
# RUN: FileCheck %s --input-file=%t.err --allow-empty --implicit-check-not={{.}} | ||
# RUN: cmp %t.base %t.implicit | ||
|
||
!ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Symbols: | ||
- Name: symbol_a | ||
Section: .text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters