summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/redundant-include.mm
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Modules/redundant-include.mm')
-rw-r--r--clang/test/Modules/redundant-include.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Modules/redundant-include.mm b/clang/test/Modules/redundant-include.mm
new file mode 100644
index 00000000000..d736022699c
--- /dev/null
+++ b/clang/test/Modules/redundant-include.mm
@@ -0,0 +1,12 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I%S/Inputs %s -verify
+// RUN: %clang_cc1 -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs %s -verify
+
+#include "cxx-header.h"
+void includeNotAtTopLevel() { // expected-note {{function 'includeNotAtTopLevel' begins here}}
+ #include "cxx-header.h" // expected-error {{redundant #include of module 'cxx_library' appears within function 'includeNotAtTopLevel'}}
+}
+
+namespace NS { // expected-note {{begins here}}
+ #include "cxx-header.h" // expected-error {{redundant #include of module 'cxx_library' appears within namespace 'NS'}}
+}
OpenPOWER on IntegriCloud