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

Karl-Johan Karlsson via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 5 23:28:22 PDT 2024


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

>From e2c9089537bfa0fad10f7873ca5cb4191eed7fa5 Mon Sep 17 00:00:00 2001
From: Karl-Johan Karlsson <karl-johan.karlsson at ericsson.com>
Date: Mon, 5 Aug 2024 23:43:39 +0200
Subject: [PATCH 1/3] [test] Avoid writing to a potentially write-protected dir

The tests avx10_2_512minmax-error.c and length-errors.hlsl 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 -emit-llvm-only as these testcases
don't care about the outputed llvm IR.
---
 clang/test/CodeGen/X86/avx10_2_512minmax-error.c | 4 ++--
 clang/test/SemaHLSL/BuiltIns/length-errors.hlsl  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/test/CodeGen/X86/avx10_2_512minmax-error.c b/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
index 15ed7a0b35d82..7a5f6b5b2345c 100644
--- a/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
+++ b/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=x86_64 -target-feature +avx10.2-512 \
-// RUN: -Wno-invalid-feature-combination -emit-llvm -verify
+// RUN: -Wno-invalid-feature-combination -emit-llvm-only -verify
 // RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=i386 -target-feature +avx10.2-512 \
-// RUN: -Wno-invalid-feature-combination -emit-llvm -verify
+// RUN: -Wno-invalid-feature-combination -emit-llvm-only -verify
 
 #include <immintrin.h>
 
diff --git a/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl
index fe0046a2ab5a1..8153726367637 100644
--- a/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl
+++ b/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected
 
 void test_too_few_arg()
 {

>From 8fd55443eb910406eeadfd6e9fdcfeb6bfb64cc3 Mon Sep 17 00:00:00 2001
From: Karl-Johan Karlsson <karl-johan.karlsson at ericsson.com>
Date: Tue, 6 Aug 2024 08:27:33 +0200
Subject: [PATCH 2/3] Update clang/test/CodeGen/X86/avx10_2_512minmax-error.c

Co-authored-by: Chris B <cbieneman at microsoft.com>
---
 clang/test/CodeGen/X86/avx10_2_512minmax-error.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/CodeGen/X86/avx10_2_512minmax-error.c b/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
index 7a5f6b5b2345c..29fe33471e2a9 100644
--- a/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
+++ b/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=x86_64 -target-feature +avx10.2-512 \
-// RUN: -Wno-invalid-feature-combination -emit-llvm-only -verify
+// RUN: -Wno-invalid-feature-combination -verify
 // RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=i386 -target-feature +avx10.2-512 \
 // RUN: -Wno-invalid-feature-combination -emit-llvm-only -verify
 

>From 8a236f0a8e4bd35bae2d8257483f92d22de41905 Mon Sep 17 00:00:00 2001
From: Karl-Johan Karlsson <karl-johan.karlsson at ericsson.com>
Date: Tue, 6 Aug 2024 08:28:14 +0200
Subject: [PATCH 3/3] Update clang/test/CodeGen/X86/avx10_2_512minmax-error.c

Co-authored-by: Chris B <cbieneman at microsoft.com>
---
 clang/test/CodeGen/X86/avx10_2_512minmax-error.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/CodeGen/X86/avx10_2_512minmax-error.c b/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
index 29fe33471e2a9..99fa53bd4e7a5 100644
--- a/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
+++ b/clang/test/CodeGen/X86/avx10_2_512minmax-error.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=x86_64 -target-feature +avx10.2-512 \
 // RUN: -Wno-invalid-feature-combination -verify
 // RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=i386 -target-feature +avx10.2-512 \
-// RUN: -Wno-invalid-feature-combination -emit-llvm-only -verify
+// RUN: -Wno-invalid-feature-combination -verify
 
 #include <immintrin.h>
 



More information about the cfe-commits mailing list