diff --git a/compiler-rt/test/sanitizer_common/TestCases/onprint.cpp b/compiler-rt/test/sanitizer_common/TestCases/onprint.cpp index 8779efbb237d..29e38fae3ce3 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/onprint.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/onprint.cpp @@ -26,7 +26,7 @@ __sanitizer_on_print(const char *str) { int main(int argc, char *argv[]) { assert(argc >= 2); - f = open(argv[1], O_WRONLY); + f = open(argv[1], O_CREAT | O_WRONLY, 0666); // Use-after-free to trigger ASan/TSan reports. void *ptr = malloc(1);