diff --git a/llvm/test/tools/llvm-ar/error-opening-directory.test b/llvm/test/tools/llvm-ar/error-opening-directory.test new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-ar/error-opening-directory.test @@ -0,0 +1,8 @@ +# RUN: rm -rf %t && mkdir -p %t + +## 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]]': {{[iI]}}s a directory diff --git a/llvm/test/tools/llvm-ar/error-opening-permission.test b/llvm/test/tools/llvm-ar/error-opening-permission.test new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-ar/error-opening-permission.test @@ -0,0 +1,14 @@ +## Unsupported on windows as marking files "unreadable" +## is non-trivial with chmod on windows. +# UNSUPPORTED: system-windows + +# RUN: rm -rf %t && mkdir -p %t +# RUN: echo file1 > %t/1.txt + +## 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]]': {{[pP]}}ermission denied 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: