[Modules][ObjC] Warn on the use of '@import' in framework headers
Using @import in framework headers inhibit the use of such headers
when not using modules, this is specially bad for headers that end
up in the SDK (or any other system framework). Add a warning to give
users some indication that this is discouraged.
rdar://problem/39192894
llvm-svn: 335780
diff --git a/clang/test/Modules/at-import-in-framework-header.m b/clang/test/Modules/at-import-in-framework-header.m
new file mode 100644
index 0000000..fe36638
--- /dev/null
+++ b/clang/test/Modules/at-import-in-framework-header.m
@@ -0,0 +1,17 @@
+// REQUIRES: shell
+
+// RUN: rm -rf %t
+// RUN: mkdir %t
+
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache \
+// RUN: -F%S/Inputs/at-import-in-framework-header -I%S/Inputs/at-import-in-framework-header \
+// RUN: -Watimport-in-framework-header -fsyntax-only %s \
+// RUN: 2>%t/stderr
+// RUN: FileCheck --input-file=%t/stderr %s
+
+// CHECK: use of '@import' in framework header is discouraged
+
+#import <A/A.h>
+
+int bar() { return foo(); }
+