================
@@ -0,0 +1,76 @@
+// This test checks that module cache populated using different spellings of
the
+// same underlying directory works consistently (specifically the IMPORT
records.)
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: mkdir %t/tmp
+
+// Module cache path absolute.
+// RUN: cd %t/tmp && %clang_cc1 -fmodules -fimplicit-module-maps -fsyntax-only
-I %t %t/tu1.c -Rmodule-build -Rmodule-import -verify
-fmodules-cache-path=%t/cache
+//--- tu1.c
+#include "b.h" // expected-remark{{building module 'b'}} \
+ // expected-remark{{finished building module 'b'}} \
+ // expected-remark{{importing module 'b'}} \
+ // expected-remark{{importing module 'a' into 'b'}}
+
+// Module cache path relative to CWD.
+// RUN: cd %t && %clang_cc1 -fmodules -fimplicit-module-maps -fsyntax-only -I
%t %t/tu2.c -Rmodule-build -Rmodule-import -verify -fmodules-cache-path=cache
+//--- tu2.c
+#include "c.h" // expected-remark{{building module 'c'}} \
+ // expected-remark{{finished building module 'c'}} \
+ // expected-remark{{importing module 'c'}} \
+ // expected-remark{{importing module 'b' into 'c'}} \
+ // expected-remark{{importing module 'a' into 'b'}}
+
+// Module cache path relative to -working-directory.
+// RUN: cd %t/tmp && %clang_cc1 -fmodules -fimplicit-module-maps -fsyntax-only
-I %t %t/tu3.c -Rmodule-build -Rmodule-import -verify
-fmodules-cache-path=cache -working-directory %t
+//--- tu3.c
+#include "d.h" // expected-remark{{building module 'd'}} \
+ // expected-remark{{finished building module 'd'}} \
+ // expected-remark{{importing module 'd'}} \
+ // expected-remark{{importing module 'c' into 'd'}} \
+ // expected-remark{{importing module 'b' into 'c'}} \
+ // expected-remark{{importing module 'a' into 'b'}}
+
+// Module cache via symlink.
+// RUN: ln -s %t/cache %t/cache-symlink
----------------
Bigcheese wrote:
Actually this command succeeds, but I'm not sure if it ends up creating a
hardlink.
https://github.com/llvm/llvm-project/pull/185765
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits