summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/ignored_macros.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Modules/ignored_macros.m')
-rw-r--r--clang/test/Modules/ignored_macros.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/Modules/ignored_macros.m b/clang/test/Modules/ignored_macros.m
new file mode 100644
index 00000000000..1f9c27c2a36
--- /dev/null
+++ b/clang/test/Modules/ignored_macros.m
@@ -0,0 +1,22 @@
+// First trial: pass -DIGNORED=1 to both. It should be ignored in both
+// RUN: rm -rf %t.modules
+// RUN: %clang_cc1 -fmodule-cache-path %t.modules -DIGNORED=1 -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify
+// RUN: %clang_cc1 -fmodule-cache-path %t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch %s -verify
+
+// Second trial: pass -DIGNORED=1 only to the second invocation.
+// RUN: rm -rf %t.modules
+// RUN: %clang_cc1 -fmodule-cache-path %t.modules -fmodules -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify
+// RUN: not %clang_cc1 -fmodule-cache-path %t.modules -DIGNORED=1 -fmodules -I %S/Inputs -include-pch %t.pch %s > %t.err 2>&1
+// RUN: FileCheck -check-prefix=CHECK-CONFLICT %s < %t.err
+// CHECK-CONFLICT: module 'ignored_macros' found in both
+
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+@import ignored_macros;
+#endif
+
+@import ignored_macros;
+
+struct Point p;
OpenPOWER on IntegriCloud