[clang] [Driver] Fix the sysroot.c test properly (PR #94276)

Paul T Robinson via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 3 12:56:17 PDT 2024


https://github.com/pogo59 created https://github.com/llvm/llvm-project/pull/94276

A DEFAULT_SYSROOT interfered with the test, apparently. See #95055.

>From c89183017ef9719c92077c1be6fd282e22a98e4e Mon Sep 17 00:00:00 2001
From: Paul Robinson <paul.robinson at sony.com>
Date: Mon, 3 Jun 2024 12:43:59 -0700
Subject: [PATCH] [Driver] Fix the sysroot.c test properly

A DEFAULT_SYSROOT interfered with the test, apparently.
See #95055.
---
 clang/test/Driver/sysroot.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/clang/test/Driver/sysroot.c b/clang/test/Driver/sysroot.c
index 2215d6fa8fe73..85da2499090af 100644
--- a/clang/test/Driver/sysroot.c
+++ b/clang/test/Driver/sysroot.c
@@ -1,15 +1,13 @@
-// Fails on ARM/AArch64-hosted Windows, can't tell why.
-// UNSUPPORTED: system-windows
-
 // Check that --sysroot= also applies to header search paths.
 // RUN: %clang -target i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1
 // RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s
 // CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "{{[^"]*}}/FOO"
 
 // Apple Darwin uses -isysroot as the syslib root, too.
+// We pass --sysroot="" to defeat any -DDEFAULT_SYSROOT parameter.
 // RUN: touch %t2.o
 // RUN: %clang -target i386-apple-darwin10 \
-// RUN:   -isysroot /FOO -### %t2.o 2> %t2
+// RUN:   -isysroot /FOO --sysroot="" -### %t2.o 2> %t2
 // RUN: FileCheck --check-prefix=CHECK-APPLE-ISYSROOT < %t2 %s
 // CHECK-APPLE-ISYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "{{[^"]*}}/FOO"
 



More information about the cfe-commits mailing list