[PATCH] D80838: [llvm-ar] Add more tests for errors in opening archives
Sameer Arora via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 1 08:00:37 PDT 2020
sameerarora101 updated this revision to Diff 267612.
sameerarora101 added a comment.
fix old commit.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80838/new/
https://reviews.llvm.org/D80838
Files:
llvm/test/tools/llvm-ar/print.test
Index: llvm/test/tools/llvm-ar/print.test
===================================================================
--- llvm/test/tools/llvm-ar/print.test
+++ 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]]': {{[iI]}}s 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80838.267612.patch
Type: text/x-patch
Size: 1200 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200601/51367b15/attachment.bin>
More information about the llvm-commits
mailing list