Chris Bieneman | 8ff0c11 | 2016-06-27 19:53:53 +0000 | [diff] [blame] | 1 | RUN: yaml2obj %S/Inputs/macho.yaml -o %t-macho.o |
| 2 | RUN: yaml2obj %S/Inputs/coff.yaml -o %t-coff.o |
Saleem Abdulrasool | 92d33bd | 2016-06-25 03:05:56 +0000 | [diff] [blame] | 3 | |
| 4 | RUN: rm -f %t.ar |
| 5 | RUN: llvm-ar crs %t.ar %t-macho.o |
| 6 | RUN: grep -q __.SYMDEF %t.ar |
Martin Storsjo | 1a9593b | 2017-11-03 20:09:10 +0000 | [diff] [blame] | 7 | Test that an option string prefixed by a dash works. |
| 8 | RUN: llvm-ar -crs %t.ar %t-coff.o |
Saleem Abdulrasool | 92d33bd | 2016-06-25 03:05:56 +0000 | [diff] [blame] | 9 | RUN: grep -q __.SYMDEF %t.ar |
| 10 | |
| 11 | RUN: rm -f %t.ar |
| 12 | RUN: llvm-ar crs %t.ar %t-coff.o |
| 13 | RUN: not grep -q __.SYMDEF %t.ar |
| 14 | RUN: llvm-ar crs %t.ar %t-macho.o |
| 15 | RUN: not grep -q __.SYMDEF %t.ar |
| 16 | |
Peter Collingbourne | d579c31 | 2018-03-28 17:21:14 +0000 | [diff] [blame] | 17 | RUN: rm -f %t.ar |
| 18 | Test that multiple dashed options works. |
| 19 | RUN: llvm-ar -c -r -s %t.ar %t-macho.o |
| 20 | RUN: grep -q __.SYMDEF %t.ar |
| 21 | Test with duplicated options. |
| 22 | RUN: llvm-ar -c -r -s -c -s %t.ar %t-coff.o |
| 23 | RUN: grep -q __.SYMDEF %t.ar |
| 24 | |
| 25 | RUN: rm -f %t.ar |
| 26 | Test with the options in a different order. |
| 27 | RUN: llvm-ar rsc %t.ar %t-macho.o |
| 28 | RUN: grep -q __.SYMDEF %t.ar |
| 29 | Test with options everywhere. |
| 30 | RUN: llvm-ar rsc -cs -sc %t.ar %t-coff.o -cs -sc |
| 31 | RUN: grep -q __.SYMDEF %t.ar |
| 32 | |
Saleem Abdulrasool | 92d33bd | 2016-06-25 03:05:56 +0000 | [diff] [blame] | 33 | Ensure that we select the existing format when updating. |
| 34 | |