xref: /aosp_15_r20/external/llvm/test/Other/can-execute.txt (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerREQUIRES: can-execute
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard WorkerThis tests that we abstract two peculiarities of unix in can_execute:
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker* Directories are executable, but we don't want to try to execute them.
6*9880d681SAndroid Build Coastguard Worker* For shell scripts, we also need to be able to read them.
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard WorkerThe PATH is constructed such that 'not' will first find a directory named
9*9880d681SAndroid Build Coastguard WorkerTestProg, then a file with executable bit but not readable and finally a
10*9880d681SAndroid Build Coastguard Workershell script which always returns false, which is what it actually tries to
11*9880d681SAndroid Build Coastguard Workerexecute.
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard WorkerIf we want, it is probably OK to change the semantics of can_execute and this
14*9880d681SAndroid Build Coastguard Workertest, but for now this test serves as a reminder to audit all the callers if
15*9880d681SAndroid Build Coastguard Workerwe do that.
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard WorkerRUN: cp -f %S/Inputs/TestProg/TestProg %T/TestProg
18*9880d681SAndroid Build Coastguard WorkerRUN: chmod 111 %T/TestProg
19*9880d681SAndroid Build Coastguard WorkerRUN: export PATH=%S/Inputs:%T:%S/Inputs/TestProg:$PATH
20*9880d681SAndroid Build Coastguard WorkerRUN: not TestProg
21