forked from llvm-mirror/llvm
-
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.
[llvm-objcopy] Add support for '--' for delimiting options from input…
…/output files This will allow to use llvm-objcopy with file names that begin with dashes. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D102665
- Loading branch information
1 parent
ca2c245
commit f24f140
Showing
3 changed files
with
37 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Create a clean temporary directory and cd to it to use relative paths. | ||
# RUN: rm -rf %t && mkdir %t && cd %t | ||
|
||
## Check that llvm-objcopy correctly treats paths after '--' as file paths, | ||
## even if they start with dashes. | ||
# RUN: yaml2obj %s -o test-obj | ||
# RUN: llvm-objcopy --only-section=.test test-obj -- --only-section | ||
# RUN: llvm-objcopy --only-section=.test test-obj out-obj1 | ||
# RUN: cmp out-obj1 -- --only-section | ||
|
||
## Check the case when '--' is specified with input files but no options. | ||
# RUN: llvm-objcopy -- test-obj --add-section | ||
# RUN: llvm-objcopy test-obj out-obj2 | ||
# RUN: cmp out-obj2 -- --add-section | ||
|
||
## Check the case when '--' is specified with options but no input files. | ||
# RUN: not llvm-objcopy --only-section=.test -- 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-INPUT | ||
|
||
# CHECK-NO-INPUT: error: no input file specified | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL |
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