summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-06-21 16:28:10 +0000
committerDouglas Gregor <dgregor@apple.com>2013-06-21 16:28:10 +0000
commit963c5535649dc049547853ebd3ad33ea17d2ae04 (patch)
tree6683284f7683184e0486aff7371494fdfd73d51a /clang/test
parentdd08c5931715d38ca2e5233c252507bf92adee06 (diff)
downloadbcm5719-llvm-963c5535649dc049547853ebd3ad33ea17d2ae04.tar.gz
bcm5719-llvm-963c5535649dc049547853ebd3ad33ea17d2ae04.zip
[Modules] If a module map resides in a system header directory, treat it as a system module.
This prevents -pedantic from causing warnings in the system headers used to create modules. Fixes <rdar://problem/14201171>. llvm-svn: 184560
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/module.map4
-rw-r--r--clang/test/Modules/Inputs/warning.h1
-rw-r--r--clang/test/Modules/system_headers.m8
3 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index 5a95ce9edc0..65c75fdc1c6 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -217,3 +217,7 @@ module linkage_merge {
module incomplete_mod {
header "incomplete_mod.h"
}
+
+module warning {
+ header "warning.h"
+}
diff --git a/clang/test/Modules/Inputs/warning.h b/clang/test/Modules/Inputs/warning.h
new file mode 100644
index 00000000000..a90c6288674
--- /dev/null
+++ b/clang/test/Modules/Inputs/warning.h
@@ -0,0 +1 @@
+enum { bigger_than_int = 0x80000000 };
diff --git a/clang/test/Modules/system_headers.m b/clang/test/Modules/system_headers.m
new file mode 100644
index 00000000000..39b13ca5fc4
--- /dev/null
+++ b/clang/test/Modules/system_headers.m
@@ -0,0 +1,8 @@
+// Test that system-headerness works for building modules.
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -isystem %S/Inputs -pedantic -Werror %s -verify
+// expected-no-diagnostics
+
+@import warning;
+int i = bigger_than_int;
OpenPOWER on IntegriCloud