diff --git a/llvm/test/tools/llvm-ar/print.test b/llvm/test/tools/llvm-ar/print.test --- a/llvm/test/tools/llvm-ar/print.test +++ b/llvm/test/tools/llvm-ar/print.test @@ -68,7 +68,7 @@ ## No archive: # RUN: not llvm-ar p 2>&1 \ # RUN: | FileCheck %s --check-prefix=NO-ARCHIVE -# +# # NO-ARCHIVE: error: an archive name must be specified ## Archive does not exist: @@ -77,6 +77,21 @@ # MISSING-ARCHIVE: error: error loading '[[ARCHIVE]]': {{[nN]}}o such file or directory +## No Permission: +# RUN: llvm-ar -rc %t/permission.b %t/1.txt +# RUN: chmod 100 %t/permission.b +# RUN: not llvm-ar p %t/permission.b 2>&1 \ +# RUN: | FileCheck %s --check-prefix=NO-PERMISSION -DARCHIVE=%t/permission.b + +# NO-PERMISSION: error: error opening '[[ARCHIVE]]': Permission denied + +## Passing in a directory: +# RUN: mkdir -p %t/tmpDir +# RUN: not llvm-ar p %t/tmpDir 2>&1 \ +# RUN: | FileCheck %s --check-prefix=IS-DIR -DARCHIVE=%t/tmpDir + +# IS-DIR: error: error opening '[[ARCHIVE]]': Is a directory + ## Member does not exist: # RUN: not llvm-ar p %t/archive.a %t-missing.txt 2>&1 \ # RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t-missing.txt