aboutsummaryrefslogtreecommitdiffstats
path: root/test/Other
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-17 14:00:41 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-17 14:00:41 +0000
commitb6a633ca94dbdc9904733e6462b5e214a240a284 (patch)
treec5d44a208e3dcacdcd5d507df083a59f07c53cc5 /test/Other
parentb30614a1dea947246a06f74c8b56d7cda4885aec (diff)
downloadexternal_llvm-b6a633ca94dbdc9904733e6462b5e214a240a284.zip
external_llvm-b6a633ca94dbdc9904733e6462b5e214a240a284.tar.gz
external_llvm-b6a633ca94dbdc9904733e6462b5e214a240a284.tar.bz2
Add a testcase for r184074.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other')
-rwxr-xr-xtest/Other/Inputs/TestProg/TestProg3
-rw-r--r--test/Other/can-execute.txt20
2 files changed, 23 insertions, 0 deletions
diff --git a/test/Other/Inputs/TestProg/TestProg b/test/Other/Inputs/TestProg/TestProg
new file mode 100755
index 0000000..1c4efba
--- /dev/null
+++ b/test/Other/Inputs/TestProg/TestProg
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+false
diff --git a/test/Other/can-execute.txt b/test/Other/can-execute.txt
new file mode 100644
index 0000000..c7d08f6
--- /dev/null
+++ b/test/Other/can-execute.txt
@@ -0,0 +1,20 @@
+REQUIRES: shell
+
+This tests that we abstract two peculiarities of unix in can_execute:
+
+* Directories are executable, but we don't want to try to execute them.
+* For shell scripts, we also need to be able to read them.
+
+The PATH is constructed such that 'not' will first find a directory named
+TestProg, then a file with executable bit but not readable and finally a
+shell script which always returns false, which is what it actually tries to
+execute.
+
+If we want, it is probably OK to change the semantics of can_execute and this
+test, but for now this test serves as a reminder to audit all the callers if
+we do that.
+
+RUN: cp -f %S/Inputs/TestProg/TestProg %T/TestProg
+RUN: chmod 111 %T/TestProg
+RUN: export PATH=%S/Inputs:%T:%S/Inputs/TestProg:$PATH
+RUN: not TestProg