dmikis added a comment. @thakis I've got test working, here's the code:
// RUN: chmod +w %t.dir || true // RUN: rm -rf %t.dir // RUN: mkdir %t.dir // RUN: cp %s %t.dir/read-only.cpp // RUN: chmod -w %t.dir // RUN: clang-format -style=LLVM -i %t.dir/read-only.cpp || test $? == 1 int main() { return 0; } There's a difference in how Linux and Windows behaves. Linux unlinks read-only file without any errors as long as directory files resides in is writable. That's why I run chmod on directory, not the file. I can't check it on Windows. It seems tests aren't designed to run on windows at all because of it's obvious reliance on unix-like environment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90121/new/ https://reviews.llvm.org/D90121 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits