1 ## Show that llvm-objcopy and llvm-strip emit errors when attempting to modify
2 ## archives containing unrecognized files, and do not modify anything. We use
3 ## --strip-debug so that the section should be removed, and a difference
4 ## detectable, if the file were modified.
6 # RUN: yaml2obj %s -o %t.o
8 # RUN: llvm-ar rc %t.a %t.o %s
12 # RUN: not llvm-objcopy --strip-debug %t1.a 2>&1 | FileCheck %s -DARCHIVE=%t1.a
13 # RUN: not llvm-strip --strip-debug %t2.a 2>&1 | FileCheck %s -DARCHIVE=%t2.a
14 ## Verify that the archive was not modified, if any member couldn't be recognized.
18 # CHECK: error: '[[ARCHIVE]](archive-unknown-members.test)': The file was not recognized as a valid object file
20 # RUN: rm -f %t.thin1.a %t.thin2.a
23 # RUN: llvm-ar rcT %t.thin1.a %t1.o %s
24 # RUN: llvm-ar rcT %t.thin2.a %t2.o %s
26 # RUN: not llvm-objcopy --strip-debug %/t.thin1.a 2>&1 \
27 # RUN: | FileCheck %s --check-prefix=THIN -DARCHIVE=%/t.thin1.a -DMEMBER=%/s
28 # RUN: not llvm-strip --strip-debug %/t.thin2.a 2>&1 \
29 # RUN: | FileCheck %s --check-prefix=THIN -DARCHIVE=%/t.thin2.a -DMEMBER=%/s
30 ## Verify that the first member was not modified, if a later member could not
35 # THIN: error: '[[ARCHIVE]]([[MEMBER]])': The file was not recognized as a valid object file