[NFC] Add test to show that preprocess an import decl won't require to load it actually
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 10 Feb 2023 08:13:46 +0000 (16:13 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 10 Feb 2023 08:14:37 +0000 (16:14 +0800)
Close https://github.com/llvm/llvm-project/issues/59287

This is addressed in D137526 but I forgot to add a test for it.

clang/test/Modules/preprocess-named-modules.cppm [new file with mode: 0644]

diff --git a/clang/test/Modules/preprocess-named-modules.cppm b/clang/test/Modules/preprocess-named-modules.cppm
new file mode 100644 (file)
index 0000000..67a6cc3
--- /dev/null
@@ -0,0 +1,7 @@
+// Tests tht when we preprocess a source, the compiler won't
+// require to load the named modules after import.
+//
+// RUN: %clang_cc1 -std=c++20 -E %s -o - | FileCheck %s
+import non_exist_modules;
+
+// CHECK: import non_exist_modules;