================
@@ -0,0 +1,62 @@
+/// This tests the expected error case when there is a mismatch between the 
pcm dependencies passed in 
+/// the command line with `fmodule-file` and whats encoded in the pcm. 
+
+/// The steps are: 
+/// 1. Build module (A-1) with no dependencies.
+/// 2. Build the same module with files that resolve from different search 
paths. (A-2).
+/// 3. Build module (B) that depends on the earlier module (A-1).
+/// 4. Build client that depends on both modules (A & B) but depends on a 
different version (A-2).
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+
+// RUN: %clang_cc1 -emit-module -x c -fmodules -fno-implicit-modules -isysroot 
%t/Sysroot \
+// RUN:     -I%t/Sysroot/usr/include \
+// RUN:     -fmodule-name=A %t/Sysroot/usr/include/A/module.modulemap -o 
%t/A-1.pcm
+
+// RUN: %clang_cc1 -emit-module -x c -fmodules -fno-implicit-modules -isysroot 
%t/Sysroot \
+// RUN:     -I%t/BuildDir \
+// RUN:     -fmodule-name=A %t/BuildDir/A/module.modulemap -o %t/A-2.pcm
+
+// RUN: %clang_cc1 -emit-module -x c -fmodules -fno-implicit-modules -isysroot 
%t/Sysroot \
+// RUN:     -I%t/Sysroot/usr/include \
+// RUN:     -fmodule-map-file=%t/Sysroot/usr/include/A/module.modulemap \
+// RUN:     -fmodule-file=A=%t/A-1.pcm \
+// RUN:     -fmodule-name=B %t/Sysroot/usr/include/B/module.modulemap -o 
%t/B-1.pcm
+
+// RUN: %clang_cc1 -x c -fmodules -fno-implicit-modules -isysroot %t/Sysroot \
+// RUN:     -I%t/BuildDir -I%t/Sysroot/usr/include \
+// RUN:     -fmodule-map-file=%t/BuildDir/A/module.modulemap \
+// RUN:     -fmodule-map-file=%t/Sysroot/usr/include/B/module.modulemap \
+// RUN:     -fmodule-file=A=%t/A-2.pcm -fmodule-file=B=%t/B-1.pcm \
+// RUN:     -verify %s  
+
+
+#include <A/A.h>
+#include <B/B.h> // expected-error {{out of date and needs to be rebuilt}} \
+                 // expected-note {{imported by module 'B'}} \
+                 // expected-note-re {{alternate module file {{.*}}A-1.pcm' 
was imported from 'B'}}
----------------
vsapsai wrote:

Can you please provide the emitted error message with the notes? This is just 
for the review, so can see how the end user would experience the diagnostics.

https://github.com/llvm/llvm-project/pull/136612
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to