aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2024-04-10 10:46:53 -0500
committerGitHub <noreply@github.com>2024-04-10 10:46:53 -0500
commit52aaa8a87960a7d342c5e6b7d5af82c76c8cc45d (patch)
tree84b2945e9bce6d84f0adc5a826ad38573010ac9d
parent7d60232b38b66138dae1b31027d73ee5b9df5c58 (diff)
downloadllvm-52aaa8a87960a7d342c5e6b7d5af82c76c8cc45d.zip
llvm-52aaa8a87960a7d342c5e6b7d5af82c76c8cc45d.tar.gz
llvm-52aaa8a87960a7d342c5e6b7d5af82c76c8cc45d.tar.bz2
[clang][test] Avoid writing to a potentially write-protected dir (#88258)
This test just checks for the stdout/stderr of clang, but it incidentally tries to write to `a.out` in the current directory, which may be write protected. Typically one would write `clang -o %t.o` for a writeable dir, but since we only care about stdout/stderr, throw away the object file and just write to /dev/null instead.
-rw-r--r--clang/test/Driver/lld-repro.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/Driver/lld-repro.c b/clang/test/Driver/lld-repro.c
index 9457dd3..61904c0 100644
--- a/clang/test/Driver/lld-repro.c
+++ b/clang/test/Driver/lld-repro.c
@@ -4,12 +4,12 @@
// RUN: echo "-nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error -fcrash-diagnostics-dir=%t" \
// RUN: | sed -e 's/\\/\\\\/g' > %t.rsp
-// RUN: not %clang %s @%t.rsp -fcrash-diagnostics=all 2>&1 \
+// RUN: not %clang %s @%t.rsp -fcrash-diagnostics=all -o /dev/null 2>&1 \
// RUN: | FileCheck %s
// Test that the reproducer can still be created even when the input source cannot be preprocessed
// again, like when reading from stdin.
-// RUN: not %clang -x c - @%t.rsp -fcrash-diagnostics=all 2>&1 < %s \
+// RUN: not %clang -x c - @%t.rsp -fcrash-diagnostics=all -o /dev/null 2>&1 < %s \
// RUN: | FileCheck %s
// check that we still get lld's output
@@ -20,9 +20,9 @@
// CHECK-NEXT: note: diagnostic msg:
// CHECK: ********************
-// RUN: not %clang %s @%t.rsp -fcrash-diagnostics=compiler 2>&1 \
+// RUN: not %clang %s @%t.rsp -fcrash-diagnostics=compiler -o /dev/null 2>&1 \
// RUN: | FileCheck %s --check-prefix=NO-LINKER
-// RUN: not %clang %s @%t.rsp 2>&1 \
+// RUN: not %clang %s @%t.rsp -o /dev/null 2>&1 \
// RUN: | FileCheck %s --check-prefix=NO-LINKER
// NO-LINKER-NOT: Preprocessed source(s) and associated run script(s) are located at: