================
@@ -594,6 +594,66 @@ TEST_F(HeaderIncludesTest, CanDeleteAfterCode) {
EXPECT_EQ(Expected, remove(Code, "\"b.h\""));
}
+TEST_F(HeaderIncludesTest, InsertGlobalModuleFragmentDeclInterfaceUnit) {
+ // Ensure the header insertion comes with a global module fragment decl (i.e.
+ // a 'module;' line) when:
+ // - the input file is an module interface unit, and
+ // - no tokens excluding comments and whitespaces exist before the module
+ // declaration.
+ std::string Code = R"cpp(// comments
+
+// more comments
+
+export module foo;
+
+int main() {
----------------
ChuanqiXu9 wrote:
This is actually invalid. We should say `extern "C++" int main`
https://github.com/llvm/llvm-project/pull/173724
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits