summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-08-09 01:24:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-08-09 01:24:07 +0000
commit49faf9f4cded2cf9c09f5befaa7df1b86d1e8cc8 (patch)
tree4404599e4b7d158be2e7192246a57013a6d1aa70 /clang/test/Modules
parent4629ed75e4e6f2321701b3aa06e92e2dee7e98dc (diff)
downloadbcm5719-llvm-49faf9f4cded2cf9c09f5befaa7df1b86d1e8cc8.tar.gz
bcm5719-llvm-49faf9f4cded2cf9c09f5befaa7df1b86d1e8cc8.zip
[modules] Weaken an out-of-date assertion: an #undef can have no location if we
imported it from a module when performing finalization before writing out an AST file. llvm-svn: 215272
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/macros_bottom.h3
-rw-r--r--clang/test/Modules/Inputs/macros_right_undef.h1
-rw-r--r--clang/test/Modules/Inputs/macros_top.h1
-rw-r--r--clang/test/Modules/Inputs/module.map4
-rw-r--r--clang/test/Modules/macros.c6
5 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/macros_bottom.h b/clang/test/Modules/Inputs/macros_bottom.h
new file mode 100644
index 00000000000..fc0a78e4620
--- /dev/null
+++ b/clang/test/Modules/Inputs/macros_bottom.h
@@ -0,0 +1,3 @@
+@import macros_right;
+
+extern TOP_DEF_RIGHT_UNDEF *TDRUp;
diff --git a/clang/test/Modules/Inputs/macros_right_undef.h b/clang/test/Modules/Inputs/macros_right_undef.h
index 15a83666a13..5084561e108 100644
--- a/clang/test/Modules/Inputs/macros_right_undef.h
+++ b/clang/test/Modules/Inputs/macros_right_undef.h
@@ -2,3 +2,4 @@
@import macros_top;
#undef TOP_OTHER_DEF_RIGHT_UNDEF
+#undef TOP_DEF_RIGHT_UNDEF
diff --git a/clang/test/Modules/Inputs/macros_top.h b/clang/test/Modules/Inputs/macros_top.h
index 10935043e2a..e063133a172 100644
--- a/clang/test/Modules/Inputs/macros_top.h
+++ b/clang/test/Modules/Inputs/macros_top.h
@@ -22,3 +22,4 @@
#define TOP_OTHER_DEF_RIGHT_UNDEF void
#define TOP_REDEF_IN_SUBMODULES 0
+#define TOP_DEF_RIGHT_UNDEF void
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index fea12015233..0081c1ca000 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -40,6 +40,10 @@ module macros_right {
header "macros_right_undef.h"
}
}
+module macros_bottom {
+ header "macros_bottom.h"
+ export *
+}
module macros { header "macros.h" }
module macros_other { header "macros_other.h" }
module category_top { header "category_top.h" }
diff --git a/clang/test/Modules/macros.c b/clang/test/Modules/macros.c
index 7a7e570ca25..92ea88a4802 100644
--- a/clang/test/Modules/macros.c
+++ b/clang/test/Modules/macros.c
@@ -130,8 +130,14 @@ void test3() {
# error TOP_RIGHT_UNDEF should still be defined
#endif
+@import macros_bottom;
+
+TOP_DEF_RIGHT_UNDEF *TDRUf() { return TDRUp; }
+
@import macros_right.undef;
+int TOP_DEF_RIGHT_UNDEF; // ok, no longer defined
+
// FIXME: When macros_right.undef is built, macros_top is visible because
// the state from building macros_right leaks through, so macros_right.undef
// undefines macros_top's macro.
OpenPOWER on IntegriCloud