[llvm-dev] Usage of chmod 400 in lld lit tests causes failures when run by root user

Tom Stellard via llvm-dev llvm-dev at lists.llvm.org
Tue Jul 16 10:23:19 PDT 2019


Hi,

There are 3 lld tests[1] that run the command `chmod 400` or `chmod u-w`
and then check that lld generates a permission denied error when trying to
write to the files. These tests fail when run as root,
because `chmod 400` is not enough to prevent root from writing to files.
Is there some other way we can tests this, or should we just not support
running tests as root?

A related question I have is how do these tests work on Windows since it doesn't
have chmod?

Thanks,
Tom

[1] 

ELF/lto/thinlto-emit-imports.ll
ELF/lto/thinlto-cant-write-index.ll
COFF/thinlto-emit-imports.ll


More information about the llvm-dev mailing list