summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-03-21 00:33:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-03-21 00:33:59 +0000
commit56be75426286b324b209a0932967b2e79ef6cee4 (patch)
tree8790f9cdee5fa9d1d8b4b65a6186467e168e2906 /clang/test
parent2544330a292edfa02a69eae51e2ae096d659dca0 (diff)
downloadbcm5719-llvm-56be75426286b324b209a0932967b2e79ef6cee4.tar.gz
bcm5719-llvm-56be75426286b324b209a0932967b2e79ef6cee4.zip
PR19215: When writing/reading a PCH that imported a module, store the location
at which that PCH imported each visible submodule of the module. Such locations are needed when synthesizing macro directives resulting from the import. llvm-svn: 204417
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/macro-undef-through-pch/A.h2
-rw-r--r--clang/test/Modules/Inputs/macro-undef-through-pch/foo.h1
-rw-r--r--clang/test/Modules/Inputs/macro-undef-through-pch/module.map3
-rw-r--r--clang/test/Modules/macro-undef-through-pch.m8
4 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/macro-undef-through-pch/A.h b/clang/test/Modules/Inputs/macro-undef-through-pch/A.h
new file mode 100644
index 00000000000..6a2cc5cf6c2
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-undef-through-pch/A.h
@@ -0,0 +1,2 @@
+#define AB
+#undef AB
diff --git a/clang/test/Modules/Inputs/macro-undef-through-pch/foo.h b/clang/test/Modules/Inputs/macro-undef-through-pch/foo.h
new file mode 100644
index 00000000000..9d0256bdff2
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-undef-through-pch/foo.h
@@ -0,0 +1 @@
+@import A;
diff --git a/clang/test/Modules/Inputs/macro-undef-through-pch/module.map b/clang/test/Modules/Inputs/macro-undef-through-pch/module.map
new file mode 100644
index 00000000000..63f68ca5033
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-undef-through-pch/module.map
@@ -0,0 +1,3 @@
+module A {
+ header "A.h"
+}
diff --git a/clang/test/Modules/macro-undef-through-pch.m b/clang/test/Modules/macro-undef-through-pch.m
new file mode 100644
index 00000000000..ff0736ca998
--- /dev/null
+++ b/clang/test/Modules/macro-undef-through-pch.m
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c-header -fmodules -fmodules-cache-path=%t \
+// RUN: -I%S/Inputs/macro-undef-through-pch -emit-pch \
+// RUN: %S/Inputs/macro-undef-through-pch/foo.h -o %t.pch
+// RUN: %clang_cc1 -x objective-c -fmodules -fmodules-cache-path=%t -include-pch %t.pch %s
+
+// PR19215
+#undef AB
OpenPOWER on IntegriCloud