[PATCH] D133617: [Clang][ScanDeps] Change multiple-commands.c test to use -fmodules-cache-path on implicit builds

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 9 15:25:37 PDT 2022


bruno created this revision.
bruno added reviewers: benlangmuir, jansvoboda11, arphaman.
Herald added subscribers: hoy, modimo, wenlei.
Herald added a project: All.
bruno requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The module cache escapes the test output dirs in this test. Since its default location maybe
composed of system and user related path this can cause problems in some builders (e.g. not
accessible paths inherited in a chroot environment).

Clean the test a bit by passing `-fmodules-cache-path` inside the test output dirs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133617

Files:
  clang/test/ClangScanDeps/multiple-commands.c


Index: clang/test/ClangScanDeps/multiple-commands.c
===================================================================
--- clang/test/ClangScanDeps/multiple-commands.c
+++ clang/test/ClangScanDeps/multiple-commands.c
@@ -6,9 +6,9 @@
 // the driver. Platforms without an integrated assembler have different commands
 // REQUIRES: x86-registered-target
 
-// RUN: rm -rf %t
+// RUN: rm -rf %t %t.modcache
 // RUN: split-file %s %t
-// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json
+// RUN: sed -e "s|DIR|%/t|g" -e "s|CACHE_PATH|%t.modcache|g" %t/cdb.json.in > %t/cdb.json
 
 // RUN: clang-scan-deps -compilation-database %t/cdb.json -module-files-dir %t/modules \
 // RUN:   -j 1 -format experimental-full -mode preprocess-dependency-directives \
@@ -150,7 +150,7 @@
   },
   {
     "directory": "DIR"
-    "command": "clang_tool -target x86_64-apple-darwin -c DIR/tu_save_temps_module.c -save-temps=obj -o DIR/tu_save_temps_module.o -fmodules -fimplicit-modules -fimplicit-module-maps"
+    "command": "clang_tool -target x86_64-apple-darwin -c DIR/tu_save_temps_module.c -save-temps=obj -o DIR/tu_save_temps_module.o -fmodules -fimplicit-modules -fimplicit-module-maps -fmodules-cache-path=CACHE_PATH"
     "file": "DIR/tu_save_temps_module.c"
   }
 ]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133617.459212.patch
Type: text/x-patch
Size: 1262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220909/77b74819/attachment.bin>


More information about the cfe-commits mailing list