https://github.com/pranavk created 
https://github.com/llvm/llvm-project/pull/135242

We execute tests in read only environment which leads to test failure when 
tests try to write to the current directory. Either they should write to a 
temporary directory or not write if output is not needed.

Fallback from #134717

>From df9b0c4966674f17550c515bae22dbbcfe41a95c Mon Sep 17 00:00:00 2001
From: Pranav Kant <p...@google.com>
Date: Thu, 10 Apr 2025 19:36:52 +0000
Subject: [PATCH] [clang] Make tests write to /dev/null if output is not needed

We execute tests in read only environment which leads to test failure
when tests try to write to the current directory. Either they should
write to a temporary directory or not write if output is not needed.
---
 clang/test/Driver/openacc-no-cir.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/test/Driver/openacc-no-cir.c 
b/clang/test/Driver/openacc-no-cir.c
index 7b67df2b6b886..891f175a001bb 100644
--- a/clang/test/Driver/openacc-no-cir.c
+++ b/clang/test/Driver/openacc-no-cir.c
@@ -1,6 +1,6 @@
-// RUN: %clang -fopenacc -S %s 2>&1 | FileCheck %s -check-prefix=ERROR
-// RUN: %clang -fclangir -fopenacc -S %s 2>&1 | FileCheck %s --allow-empty 
-check-prefix=NOERROR
-// RUN: %clang -fopenacc -fclangir -S %s 2>&1 | FileCheck %s --allow-empty 
-check-prefix=NOERROR
+// RUN: %clang -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s 
-check-prefix=ERROR
+// RUN: %clang -fclangir -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s 
--allow-empty -check-prefix=NOERROR
+// RUN: %clang -fopenacc -fclangir -S %s -o /dev/null 2>&1 | FileCheck %s 
--allow-empty -check-prefix=NOERROR
 
 // ERROR: OpenACC directives will result in no runtime behavior; use -fclangir 
to enable runtime effect
 // NOERROR-NOT: OpenACC directives

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to