[cfe-commits] r154582 - in /cfe/trunk/test/Modules: Inputs/module.map Inputs/redecl_namespaces_left.h Inputs/redecl_namespaces_right.h redecl-namespaces.mm
Nick Lewycky
nicholas at mxc.ca
Thu Apr 12 00:56:21 PDT 2012
Author: nicholas
Date: Thu Apr 12 02:56:21 2012
New Revision: 154582
URL: http://llvm.org/viewvc/llvm-project?rev=154582&view=rev
Log:
There's some code in the PCH reader that looks like it's needlessly complex, but
turns out that it's actually needed for C++ modules support. Since simplifying
it didn't cause any test failures, I'll add a test for it.
Added:
cfe/trunk/test/Modules/Inputs/redecl_namespaces_left.h
cfe/trunk/test/Modules/Inputs/redecl_namespaces_right.h
cfe/trunk/test/Modules/redecl-namespaces.mm
Modified:
cfe/trunk/test/Modules/Inputs/module.map
Modified: cfe/trunk/test/Modules/Inputs/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=154582&r1=154581&r2=154582&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/module.map (original)
+++ cfe/trunk/test/Modules/Inputs/module.map Thu Apr 12 02:56:21 2012
@@ -36,6 +36,8 @@
module category_other { header "category_other.h" }
module redeclarations_left { header "redeclarations_left.h" }
module redeclarations_right { header "redeclarations_right.h" }
+module redecl_namespaces_left { header "redecl_namespaces_left.h" }
+module redecl_namespaces_right { header "redecl_namespaces_right.h" }
module load_failure { header "load_failure.h" }
module decldef {
Added: cfe/trunk/test/Modules/Inputs/redecl_namespaces_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redecl_namespaces_left.h?rev=154582&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redecl_namespaces_left.h (added)
+++ cfe/trunk/test/Modules/Inputs/redecl_namespaces_left.h Thu Apr 12 02:56:21 2012
@@ -0,0 +1,3 @@
+namespace A {
+ int i;
+}
Added: cfe/trunk/test/Modules/Inputs/redecl_namespaces_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redecl_namespaces_right.h?rev=154582&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redecl_namespaces_right.h (added)
+++ cfe/trunk/test/Modules/Inputs/redecl_namespaces_right.h Thu Apr 12 02:56:21 2012
@@ -0,0 +1,3 @@
+namespace A {
+ int j;
+}
Added: cfe/trunk/test/Modules/redecl-namespaces.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/redecl-namespaces.mm?rev=154582&view=auto
==============================================================================
--- cfe/trunk/test/Modules/redecl-namespaces.mm (added)
+++ cfe/trunk/test/Modules/redecl-namespaces.mm Thu Apr 12 02:56:21 2012
@@ -0,0 +1,13 @@
+ at __experimental_modules_import redecl_namespaces_left;
+ at __experimental_modules_import redecl_namespaces_right;
+
+void test() {
+ A::i;
+ A::j;
+ A::k; // expected-error {{no member named 'k' in namespace 'A'}}
+}
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t -emit-module -fmodule-name=redecl_namespaces_left %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t -emit-module -fmodule-name=redecl_namespaces_right %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -w %s -verify
More information about the cfe-commits
mailing list