r316444 - [modules] Add a regression test for merging anon decls in extern C contexts.

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 07:52:35 PDT 2017


Author: vvassilev
Date: Tue Oct 24 07:52:35 2017
New Revision: 316444

URL: http://llvm.org/viewvc/llvm-project?rev=316444&view=rev
Log:
[modules] Add a regression test for merging anon decls in extern C contexts.

Added:
    cfe/trunk/test/Modules/merge-anon-in-extern_c.cpp

Added: cfe/trunk/test/Modules/merge-anon-in-extern_c.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/merge-anon-in-extern_c.cpp?rev=316444&view=auto
==============================================================================
--- cfe/trunk/test/Modules/merge-anon-in-extern_c.cpp (added)
+++ cfe/trunk/test/Modules/merge-anon-in-extern_c.cpp Tue Oct 24 07:52:35 2017
@@ -0,0 +1,19 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -verify %s
+// expected-no-diagnostics
+
+#pragma clang module build sys_types
+module sys_types {}
+#pragma clang module contents
+#pragma clang module begin sys_types
+extern "C" {
+  typedef union { bool b; } pthread_mutex_t;
+}
+#pragma clang module end
+#pragma clang module endbuild
+
+typedef union { bool b; } pthread_mutex_t;
+#pragma clang module import sys_types
+
+const pthread_mutex_t *m;
+




More information about the cfe-commits mailing list