r216796 - Add some missing test coverage for merging 'extern "C"' functions with modules.

Richard Smith richard-llvm at metafoo.co.uk
Fri Aug 29 15:33:39 PDT 2014


Author: rsmith
Date: Fri Aug 29 17:33:38 2014
New Revision: 216796

URL: http://llvm.org/viewvc/llvm-project?rev=216796&view=rev
Log:
Add some missing test coverage for merging 'extern "C"' functions with modules.

Added:
    cfe/trunk/test/Modules/Inputs/cxx-decls-premerged.h
Modified:
    cfe/trunk/test/Modules/Inputs/cxx-decls-imported.h
    cfe/trunk/test/Modules/Inputs/cxx-decls-merged.h
    cfe/trunk/test/Modules/Inputs/module.map
    cfe/trunk/test/Modules/cxx-decls.cpp

Modified: cfe/trunk/test/Modules/Inputs/cxx-decls-imported.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/cxx-decls-imported.h?rev=216796&r1=216795&r2=216796&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/cxx-decls-imported.h (original)
+++ cfe/trunk/test/Modules/Inputs/cxx-decls-imported.h Fri Aug 29 17:33:38 2014
@@ -35,3 +35,4 @@ struct HasVirtualFunctions {
 struct OverridesVirtualFunctions : HasVirtualFunctions {
   void f();
 };
+extern "C" void ExternCFunction();

Modified: cfe/trunk/test/Modules/Inputs/cxx-decls-merged.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/cxx-decls-merged.h?rev=216796&r1=216795&r2=216796&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/cxx-decls-merged.h (original)
+++ cfe/trunk/test/Modules/Inputs/cxx-decls-merged.h Fri Aug 29 17:33:38 2014
@@ -13,3 +13,4 @@ struct OverridesVirtualFunctions : HasVi
   void f();
 };
 extern OverridesVirtualFunctions overrides_virtual_functions;
+extern "C" void ExternCFunction();

Added: cfe/trunk/test/Modules/Inputs/cxx-decls-premerged.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/cxx-decls-premerged.h?rev=216796&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/cxx-decls-premerged.h (added)
+++ cfe/trunk/test/Modules/Inputs/cxx-decls-premerged.h Fri Aug 29 17:33:38 2014
@@ -0,0 +1,3 @@
+extern "C" void ExternCFunction();
+
+#include "cxx-decls-imported.h"

Modified: cfe/trunk/test/Modules/Inputs/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=216796&r1=216795&r2=216796&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/module.map (original)
+++ cfe/trunk/test/Modules/Inputs/module.map Fri Aug 29 17:33:38 2014
@@ -246,6 +246,10 @@ module cxx_decls {
   }
 }
 
+module cxx_decls_premerged {
+  header "cxx-decls-premerged.h"
+}
+
 module cxx_decls_merged {
   header "cxx-decls-merged.h"
 }

Modified: cfe/trunk/test/Modules/cxx-decls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/cxx-decls.cpp?rev=216796&r1=216795&r2=216796&view=diff
==============================================================================
--- cfe/trunk/test/Modules/cxx-decls.cpp (original)
+++ cfe/trunk/test/Modules/cxx-decls.cpp Fri Aug 29 17:33:38 2014
@@ -41,5 +41,11 @@ int name_for_linkage_test = use_name_for
 int overrides_virtual_functions_test =
     use_overrides_virtual_functions(overrides_virtual_functions);
 
+void use_extern_c_function() { ExternCFunction(); }
+
+ at import cxx_decls_premerged;
+
+void use_extern_c_function_2() { ExternCFunction(); }
+
 // CHECK: VarDecl [[mergeUsedFlag:0x[0-9a-f]*]] {{.*}} in cxx_decls.imported used mergeUsedFlag
 // CHECK: VarDecl {{0x[0-9a-f]*}} prev [[mergeUsedFlag]] {{.*}} in cxx_decls_merged used mergeUsedFlag





More information about the cfe-commits mailing list