31 lines · plain
1## Test that read-only archives cannot be edited2 3# RUN: rm -rf %t && mkdir -p %t4# RUN: touch %t/1.txt5# RUN: touch %t/2.txt6# RUN: touch %t/3.txt7 8# RUN: llvm-ar rc %t/archive.a %t/1.txt %t/2.txt9 10## Make read only:11# RUN: chmod 444 %t/archive.a12 13# RUN: not llvm-ar r %t/archive.a %t/3.txt \14# RUN: FileCheck %s --check-prefix=ERROR -DFILE=%t/archive.a -DMSG=%errc_ENOENT15 16# ERROR: error: [[FILE]]: [[MSG]]17 18# RUN: not llvm-ar q %t/archive.a %t/3.txt \19# RUN: FileCheck %s --check-prefix=ERROR -DFILE=%t/archive.a -DMSG=%errc_ENOENT20 21# RUN: not llvm-ar m %t/archive.a t/1.txt \22# RUN: FileCheck %s --check-prefix=ERROR-2 -DFILE=%t/archive.a23 24# ERROR-2: error: [[FILE]]: permission denied25 26# RUN: llvm-ar t %t/archive.a \27# RUN: | FileCheck %s --check-prefix=ARCHIVE --match-full-lines --implicit-check-not {{.}}28 29# ARCHIVE: 1.txt30# ARCHIVE-NEXT: 2.txt31