[llvm] r184080 - Add a testcase for r184074.

Rafael Espindola rafael.espindola at gmail.com
Mon Jun 17 07:00:41 PDT 2013


Author: rafael
Date: Mon Jun 17 09:00:41 2013
New Revision: 184080

URL: http://llvm.org/viewvc/llvm-project?rev=184080&view=rev
Log:
Add a testcase for r184074.

Added:
    llvm/trunk/test/Other/Inputs/TestProg/
    llvm/trunk/test/Other/Inputs/TestProg/TestProg   (with props)
    llvm/trunk/test/Other/can-execute.txt

Added: llvm/trunk/test/Other/Inputs/TestProg/TestProg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/Inputs/TestProg/TestProg?rev=184080&view=auto
==============================================================================
--- llvm/trunk/test/Other/Inputs/TestProg/TestProg (added)
+++ llvm/trunk/test/Other/Inputs/TestProg/TestProg Mon Jun 17 09:00:41 2013
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+false

Propchange: llvm/trunk/test/Other/Inputs/TestProg/TestProg
------------------------------------------------------------------------------
    svn:executable = *

Added: llvm/trunk/test/Other/can-execute.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/can-execute.txt?rev=184080&view=auto
==============================================================================
--- llvm/trunk/test/Other/can-execute.txt (added)
+++ llvm/trunk/test/Other/can-execute.txt Mon Jun 17 09:00:41 2013
@@ -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





More information about the llvm-commits mailing list