summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-08-10 15:16:24 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-08-10 15:16:24 +0000
commitfca5abc9d23354a98562b55f4ee80347c7ae2c6a (patch)
tree20f2c6fbe3bcb86307939aaf13202678f57ee762 /clang/test
parent926e2d39bf3862200586fbb061afb3121391dfc2 (diff)
downloadbcm5719-llvm-fca5abc9d23354a98562b55f4ee80347c7ae2c6a.tar.gz
bcm5719-llvm-fca5abc9d23354a98562b55f4ee80347c7ae2c6a.zip
[Modules] Prevent #import to reenter header if not building a module.
When non-modular headers are imported while not building a module but in -fmodules mode, be conservative and preserve the default #import semantic: do not reenter headers. rdar://problem/33745031 llvm-svn: 310605
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/import-textual/x.h6
-rw-r--r--clang/test/Modules/import-textual-nomodules.m8
2 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/import-textual/x.h b/clang/test/Modules/Inputs/import-textual/x.h
new file mode 100644
index 00000000000..9b41ccd0bdc
--- /dev/null
+++ b/clang/test/Modules/Inputs/import-textual/x.h
@@ -0,0 +1,6 @@
+#ifndef RANDOM_DEP
+
+@interface X
+@end
+
+#endif // RANDOM_DEP
diff --git a/clang/test/Modules/import-textual-nomodules.m b/clang/test/Modules/import-textual-nomodules.m
new file mode 100644
index 00000000000..7cf8c1e186d
--- /dev/null
+++ b/clang/test/Modules/import-textual-nomodules.m
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -I%S/Inputs/import-textual -fmodules-cache-path=%t %s -verify
+
+// expected-no-diagnostics
+
+#import "x.h"
+#import "x.h"
+
OpenPOWER on IntegriCloud