aboutsummaryrefslogtreecommitdiff
path: root/test/Modules
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-27 17:17:23 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-27 17:17:23 +0000
commitea744ab5f39b8f45f802301841b77398166bce8f (patch)
tree004f5e38073de0398ec75a1512a106b86ba63dbd /test/Modules
parent94b748ff16172f0da2b842fe0d5bae438f07034f (diff)
[modules] Make sure enabled diagnostic pragmas inside the module don't affect the translation unit that
imports the module. Getting diagnostic sections from modules properly working is a fixme. rdar://13516663 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules')
-rw-r--r--test/Modules/Inputs/diag_pragma.h3
-rw-r--r--test/Modules/Inputs/module.map4
-rw-r--r--test/Modules/diag-pragma.c13
3 files changed, 20 insertions, 0 deletions
diff --git a/test/Modules/Inputs/diag_pragma.h b/test/Modules/Inputs/diag_pragma.h
new file mode 100644
index 0000000000..a8f958994c
--- /dev/null
+++ b/test/Modules/Inputs/diag_pragma.h
@@ -0,0 +1,3 @@
+#define DIAG_PRAGMA_MACRO 1
+
+#pragma clang diagnostic ignored "-Wparentheses"
diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map
index 479bfcfa7f..93ba4935ff 100644
--- a/test/Modules/Inputs/module.map
+++ b/test/Modules/Inputs/module.map
@@ -188,3 +188,7 @@ module config {
header "config.h"
config_macros [exhaustive] WANT_FOO, WANT_BAR
}
+
+module diag_pragma {
+ header "diag_pragma.h"
+}
diff --git a/test/Modules/diag-pragma.c b/test/Modules/diag-pragma.c
new file mode 100644
index 0000000000..7ec3400bba
--- /dev/null
+++ b/test/Modules/diag-pragma.c
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=diag_pragma %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -verify -fmodules-cache-path=%t %s
+// FIXME: When we have a syntax for modules in C, use that.
+
+@import diag_pragma;
+
+int foo(int x) {
+ if (x = DIAG_PRAGMA_MACRO) // expected-warning {{using the result of an assignment as a condition without parentheses}} \
+ // expected-note {{place parentheses}} expected-note {{use '=='}}
+ return 0;
+ return 1;
+}