[PATCH] D120463: [clang][modules] NFC: Simplify and clarify test

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 01:47:59 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG242b24c18491: [clang][modules] NFC: Simplify and clarify test (authored by jansvoboda11).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120463/new/

https://reviews.llvm.org/D120463

Files:
  clang/test/Modules/Inputs/AddRemoveIrrelevantModuleMap/a.modulemap
  clang/test/Modules/Inputs/AddRemoveIrrelevantModuleMap/b.modulemap
  clang/test/Modules/add-remove-irrelevant-module-map.m


Index: clang/test/Modules/add-remove-irrelevant-module-map.m
===================================================================
--- clang/test/Modules/add-remove-irrelevant-module-map.m
+++ clang/test/Modules/add-remove-irrelevant-module-map.m
@@ -1,16 +1,30 @@
-// RUN: rm -rf %t
-// RUN: rm -rf %t.mcp
-// RUN: mkdir -p %t
+// RUN: rm -rf %t && mkdir %t
+// RUN: split-file %s %t
 
-// Build without b.modulemap
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -fmodule-map-file=%S/Inputs/AddRemoveIrrelevantModuleMap/a.modulemap %s -verify
-// RUN: cp %t.mcp/a.pcm %t/a.pcm
+//--- a.modulemap
+module a {}
 
-// Build with b.modulemap
-// RUN: rm -rf %t.mcp
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -fmodule-map-file=%S/Inputs/AddRemoveIrrelevantModuleMap/a.modulemap -fmodule-map-file=%S/Inputs/AddRemoveIrrelevantModuleMap/b.modulemap %s -verify
-// RUN: not diff %t.mcp/a.pcm %t/a.pcm
+//--- b.modulemap
+module b {}
 
+//--- test-simple.m
 // expected-no-diagnostics
-
 @import a;
+
+// Build without b.modulemap:
+//
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -fdisable-module-hash \
+// RUN:   -fmodule-map-file=%t/a.modulemap %t/test-simple.m -verify
+// RUN: mv %t/cache %t/cache-without-b
+
+// Build with b.modulemap:
+//
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -fdisable-module-hash \
+// RUN:   -fmodule-map-file=%t/a.modulemap -fmodule-map-file=%t/b.modulemap %t/test-simple.m -verify
+// RUN: mv %t/cache %t/cache-with-b
+
+// Neither PCM file considers 'b.modulemap' an input:
+//
+// RUN: %clang_cc1 -module-file-info %t/cache-without-b/a.pcm | FileCheck %s
+// RUN: %clang_cc1 -module-file-info %t/cache-with-b/a.pcm | FileCheck %s
+// CHECK-NOT: Input file: {{.*}}/b.modulemap
Index: clang/test/Modules/Inputs/AddRemoveIrrelevantModuleMap/b.modulemap
===================================================================
--- clang/test/Modules/Inputs/AddRemoveIrrelevantModuleMap/b.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module b { }
Index: clang/test/Modules/Inputs/AddRemoveIrrelevantModuleMap/a.modulemap
===================================================================
--- clang/test/Modules/Inputs/AddRemoveIrrelevantModuleMap/a.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module a { }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120463.413378.patch
Type: text/x-patch
Size: 2408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220307/2334d393/attachment.bin>


More information about the cfe-commits mailing list