1 ## Create a clean temporary directory and cd to it to use relative paths.
2 # RUN: rm -rf %t && mkdir %t && cd %t
4 ## Check that tools correctly treat paths after '--' as file paths,
5 ## even if they start with dashes.
6 # RUN: yaml2obj %s -o test-obj
7 # RUN: llvm-objcopy --only-section=.test test-obj -- --only-section
8 # RUN: llvm-objcopy --only-section=.test test-obj out-obj1
9 # RUN: cmp -- out-obj1 --only-section
11 # RUN: cp -- test-obj --strip-symbol
12 # RUN: cp -- test-obj strip-obj1
13 # RUN: llvm-strip --remove-section=.test strip-obj1 -- --strip-symbol
14 # RUN: cp -- test-obj no-dash-dash1
15 # RUN: llvm-strip --remove-section=.test no-dash-dash1
16 # RUN: cmp -- no-dash-dash1 strip-obj1
17 # RUN: cmp -- no-dash-dash1 --strip-symbol
19 ## Check the case when '--' is specified with input files but no options.
20 # RUN: llvm-objcopy -- test-obj --add-section
21 # RUN: llvm-objcopy test-obj out-obj2
22 # RUN: cmp -- out-obj2 --add-section
24 # RUN: cp -- test-obj --keep-symbol
25 # RUN: cp -- test-obj strip-obj2
26 # RUN: llvm-strip -- strip-obj2 --keep-symbol
27 # RUN: cp -- test-obj no-dash-dash2
28 # RUN: llvm-strip no-dash-dash2
29 # RUN: cmp -- no-dash-dash2 strip-obj2
30 # RUN: cmp -- no-dash-dash2 --keep-symbol
32 ## Check the case when '--' is specified with options but no input files.
33 # RUN: not llvm-objcopy --only-section=.test -- 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-INPUT
34 # RUN: not llvm-strip --remove-section=.test -- 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-INPUT
36 # CHECK-NO-INPUT: error: no input file specified