[clang] 288f688 - [NFC] Add test to show that preprocess an import decl won't require to load it actually

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 10 00:17:03 PST 2023


Author: Chuanqi Xu
Date: 2023-02-10T16:14:37+08:00
New Revision: 288f688e294a0d2ee162f99f745c06d1e95d3620

URL: https://github.com/llvm/llvm-project/commit/288f688e294a0d2ee162f99f745c06d1e95d3620
DIFF: https://github.com/llvm/llvm-project/commit/288f688e294a0d2ee162f99f745c06d1e95d3620.diff

LOG: [NFC] Add test to show that preprocess an import decl won't require to load it actually

Close https://github.com/llvm/llvm-project/issues/59287

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

Added: 
    clang/test/Modules/preprocess-named-modules.cppm

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/Modules/preprocess-named-modules.cppm b/clang/test/Modules/preprocess-named-modules.cppm
new file mode 100644
index 0000000000000..67a6cc384a1c7
--- /dev/null
+++ b/clang/test/Modules/preprocess-named-modules.cppm
@@ -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;


        


More information about the cfe-commits mailing list