Author: Chuanqi Xu Date: 2026-01-28T14:05:32+08:00 New Revision: 56ad5241c90567bda0484ccea9cd1fd8030029af
URL: https://github.com/llvm/llvm-project/commit/56ad5241c90567bda0484ccea9cd1fd8030029af DIFF: https://github.com/llvm/llvm-project/commit/56ad5241c90567bda0484ccea9cd1fd8030029af.diff LOG: [NFC] [C++20] [Modules] Make sure we can use named module with module map Added: clang/test/Modules/modulemap-with-named-module.cppm Modified: Removed: ################################################################################ diff --git a/clang/test/Modules/modulemap-with-named-module.cppm b/clang/test/Modules/modulemap-with-named-module.cppm new file mode 100644 index 0000000000000..ae733c1b0a1d9 --- /dev/null +++ b/clang/test/Modules/modulemap-with-named-module.cppm @@ -0,0 +1,25 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t +// +// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm +// RUN: %clang_cc1 -std=c++20 %t/a.cc -fmodule-map-file=%t/a.cppm.modulemap -fmodule-file=a=%t/a.pcm -fsyntax-only -verify + +//--- a.h +#pragma once +static_assert(false); + +//--- a.cppm +export module a; +export struct A {}; + +//--- a.cc +// expected-no-diagnostics +#include "a.h" + +A a; + +//--- a.cppm.modulemap +module a { + header "a.h" +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
