One test for checking the decls in language linkage shouldn't be
discarded and can be mangled correctly.
Another one for checking we can't export again in an export decl.
--- /dev/null
+// RUN: %clang_cc1 -std=c++20 %s -fsyntax-only -verify
+export module M;
+export { // expected-note {{export block begins here}}
+ export int foo() { return 43; } // expected-error {{export declaration appears within another export declaration}}
+}
--- /dev/null
+// Make sure that the declarations inside the language linkage can
+// be generated correctly.
+//
+// RUN: rm -fr %t
+// RUN: mkdir %t
+//
+// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %s -emit-module-interface -o %t/M.pcm
+// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/M.pcm -S -emit-llvm -disable-llvm-passes -o - | FileCheck %s
+export module M;
+
+extern "C++" {
+void foo() {}
+}
+
+extern "C" void bar() {}
+
+// CHECK: define {{.*}}@bar(
+// CHECK: define {{.*}}@_Z3foov(