https://github.com/aviralg updated 
https://github.com/llvm/llvm-project/pull/186169

>From 45b81d9fb71114dfc0edca8fbb0a7f0aa3d2c7b7 Mon Sep 17 00:00:00 2001
From: Aviral Goel <[email protected]>
Date: Thu, 12 Mar 2026 09:14:51 -0700
Subject: [PATCH 1/3] Disable tests on root

---
 .../Scalable/ssaf-linker/validation-errors-permissions.test      | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/clang/test/Analysis/Scalable/ssaf-linker/validation-errors-permissions.test 
b/clang/test/Analysis/Scalable/ssaf-linker/validation-errors-permissions.test
index ad1e2708cf96c..9a92c5170bcdb 100644
--- 
a/clang/test/Analysis/Scalable/ssaf-linker/validation-errors-permissions.test
+++ 
b/clang/test/Analysis/Scalable/ssaf-linker/validation-errors-permissions.test
@@ -1,5 +1,6 @@
 // Tests for clang-ssaf-linker input validation requiring file permission 
support.
 // UNSUPPORTED: system-windows
+// REQUIRES: non-root-user
 
 // RUN: rm -rf %t
 // RUN: mkdir -p %t

>From bab6615e59d892c3ec01b0dba083d7eec93f5ada Mon Sep 17 00:00:00 2001
From: Aviral Goel <[email protected]>
Date: Thu, 12 Mar 2026 10:00:15 -0700
Subject: [PATCH 2/3] Huh.

---
 clang/test/lit.cfg.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 49735d0682a74..3fa903995a398 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -429,6 +429,22 @@ def calculate_arch_features(arch_string):
 if config.clang_enable_cir:
     config.available_features.add("cir-enabled")
 
+# Tests that rely on chmod to restrict file permissions (e.g. write-permission
+# checks) are unreliable when run as root, since root bypasses file 
permissions.
+def user_is_root():
+    # os.getuid() is not available on all platforms
+    try:
+        if os.getuid() == 0:
+            return True
+    except:
+        pass
+
+    return False
+
+
+if not user_is_root():
+    config.available_features.add("non-root-user")
+
 # Some tests perform deep recursion, which requires a larger pthread stack size
 # than the relatively low default of 192 KiB for 64-bit processes on AIX. The
 # `AIXTHREAD_STK` environment variable provides a non-intrusive way to request

>From 4a7720274b0075b4635a2ef18e064218a674b422 Mon Sep 17 00:00:00 2001
From: Aviral Goel <[email protected]>
Date: Thu, 12 Mar 2026 10:33:06 -0700
Subject: [PATCH 3/3] Woah!

---
 clang/test/lit.cfg.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 3fa903995a398..e9ede820c5756 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -429,6 +429,7 @@ def calculate_arch_features(arch_string):
 if config.clang_enable_cir:
     config.available_features.add("cir-enabled")
 
+
 # Tests that rely on chmod to restrict file permissions (e.g. write-permission
 # checks) are unreliable when run as root, since root bypasses file 
permissions.
 def user_is_root():

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to