[clang] [test][OpenMP] Avoid writing to a potentially write-protected dir (PR #94931)

Karl-Johan Karlsson via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 9 23:52:22 PDT 2024


https://github.com/karka228 updated https://github.com/llvm/llvm-project/pull/94931

>From c5b2765d9f4bd2a8412c0722a052148673411f94 Mon Sep 17 00:00:00 2001
From: Karl-Johan Karlsson <karl-johan.karlsson at ericsson.com>
Date: Mon, 10 Jun 2024 07:45:48 +0200
Subject: [PATCH 1/2] [test][OpenMP] Avoid writing to a potentially
 write-protected dir

The test clang/test/OpenMP/error_unsupport_feature.c don't check the output
written to the current directory. The current directory may be write protected
e.g. in a sandboxed environment.

This patch replace the -emit-llvm option with -fsyntax-only as it don't care
about the outputed llvm IR.
---
 clang/test/OpenMP/error_unsupport_feature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/OpenMP/error_unsupport_feature.c b/clang/test/OpenMP/error_unsupport_feature.c
index 611a8b4639c44..2dc485e20dbb7 100644
--- a/clang/test/OpenMP/error_unsupport_feature.c
+++ b/clang/test/OpenMP/error_unsupport_feature.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -verify -fopenmp %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s
 
 int main () {
   int r = 0;

>From 306ada79b6202d838736ac7aca9922d4a8b7624b Mon Sep 17 00:00:00 2001
From: Karl-Johan Karlsson <karl-johan.karlsson at ericsson.com>
Date: Mon, 10 Jun 2024 08:46:17 +0200
Subject: [PATCH 2/2] [test][OpenMP] Avoid writing to a potentially
 write-protected dir

Changed -fsyntax-only to -emit-llvm-only
---
 clang/test/OpenMP/error_unsupport_feature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/OpenMP/error_unsupport_feature.c b/clang/test/OpenMP/error_unsupport_feature.c
index 2dc485e20dbb7..eb381b3bea1e1 100644
--- a/clang/test/OpenMP/error_unsupport_feature.c
+++ b/clang/test/OpenMP/error_unsupport_feature.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s
+// RUN: %clang_cc1 -emit-llvm-only -verify -fopenmp %s
 
 int main () {
   int r = 0;



More information about the cfe-commits mailing list