[llvm] 4a72459 - Revert "[clang][test] Disallow using the default module cache path in lit tests"

Ben Langmuir via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 13:11:10 PDT 2022


Author: Ben Langmuir
Date: 2022-09-12T13:10:22-07:00
New Revision: 4a72459ed639e3eb7188565c758181c43d3192aa

URL: https://github.com/llvm/llvm-project/commit/4a72459ed639e3eb7188565c758181c43d3192aa
DIFF: https://github.com/llvm/llvm-project/commit/4a72459ed639e3eb7188565c758181c43d3192aa.diff

LOG: Revert "[clang][test] Disallow using the default module cache path in lit tests"

This reverts commit d96f526196ac4cebfdd318473816f6d4b9d76707.

Some systems do not support `env -u`.

Added: 
    

Modified: 
    clang/test/Driver/modules-cache-path.m
    clang/test/Modules/driver.c
    llvm/utils/lit/lit/llvm/config.py

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/modules-cache-path.m b/clang/test/Driver/modules-cache-path.m
index f700a9738742f..1da27d2143631 100644
--- a/clang/test/Driver/modules-cache-path.m
+++ b/clang/test/Driver/modules-cache-path.m
@@ -1,4 +1,4 @@
-// RUN: env -u CLANG_MODULE_CACHE_PATH %clang -fmodules -### %s 2>&1 | FileCheck %s -check-prefix=CHECK-DEFAULT
+// RUN: %clang -fmodules -### %s 2>&1 | FileCheck %s -check-prefix=CHECK-DEFAULT
 // CHECK-DEFAULT: -fmodules-cache-path={{.*}}clang{{[/\\]+}}ModuleCache
 
 // RUN: env CLANG_MODULE_CACHE_PATH=/dev/null \

diff  --git a/clang/test/Modules/driver.c b/clang/test/Modules/driver.c
index 8ffa23ba4e71c..34fc163a5ccd4 100644
--- a/clang/test/Modules/driver.c
+++ b/clang/test/Modules/driver.c
@@ -1,4 +1,4 @@
-// RUN: env -u CLANG_MODULE_CACHE_PATH %clang -fmodules -fimplicit-module-maps %s -### 2>&1 | FileCheck -check-prefix CHECK-NO_MODULE_CACHE %s
+// RUN: %clang -fmodules -fimplicit-module-maps %s -### 2>&1 | FileCheck -check-prefix CHECK-NO_MODULE_CACHE %s
 // RUN: %clang -fmodules -fimplicit-module-maps -fmodules-cache-path=blarg %s -### 2>&1 | FileCheck -check-prefix CHECK-WITH_MODULE_CACHE %s
 
 // CHECK-NO_MODULE_CACHE: {{clang.*"-fmodules-cache-path=.*ModuleCache"}}

diff  --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index 6149f4db7e0ca..591b9938f211f 100644
--- a/llvm/utils/lit/lit/llvm/config.py
+++ b/llvm/utils/lit/lit/llvm/config.py
@@ -495,10 +495,6 @@ def use_clang(self, additional_tool_dirs=[], additional_flags=[],
 
         self.clear_environment(possibly_dangerous_env_vars)
 
-        # Make the default module cache path invalid so that tests are forced to
-        # provide a cache path if they use implicit modules.
-        self.with_environment('CLANG_MODULE_CACHE_PATH', '/dev/null')
-
         # Tweak the PATH to include the tools dir and the scripts dir.
         # Put Clang first to avoid LLVM from overriding out-of-tree clang
         # builds.


        


More information about the llvm-commits mailing list