diff --git a/llvm/test/tools/llvm-ar/error-opening-archive.test b/llvm/test/tools/llvm-ar/error-opening-archive.test new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-ar/error-opening-archive.test @@ -0,0 +1,19 @@ +# RUN: rm -rf %t && mkdir -p %t +# RUN: echo file1 > %t/1.txt +# RUN: echo file2 > %t/2.txt +# RUN: echo file3 > %t/3.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]]': 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]]': {{[iI]}}s a directory 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: