mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
Add a testcase for r184074.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
3
test/Other/Inputs/TestProg/TestProg
Executable file
3
test/Other/Inputs/TestProg/TestProg
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
false
|
20
test/Other/can-execute.txt
Normal file
20
test/Other/can-execute.txt
Normal file
@@ -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
|
Reference in New Issue
Block a user