summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/macro-hiding.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-18 04:53:37 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-18 04:53:37 +0000
commit3965412f088ccdab52b897f89f29b937269e26fd (patch)
tree2b3d9c4d94583597d02fa77fb0dc40df68013ec1 /clang/test/Modules/macro-hiding.cpp
parentc4158e862f078508a5d54e92b6a6f3081488f559 (diff)
downloadbcm5719-llvm-3965412f088ccdab52b897f89f29b937269e26fd.tar.gz
bcm5719-llvm-3965412f088ccdab52b897f89f29b937269e26fd.zip
[modules] Fix macro hiding bug exposed if:
* A submodule of module A is imported into module B * Another submodule of module A that is not imported into B exports a macro * Some submodule of module B also exports a definition of the macro, and happens to be the first submodule of B that imports module A. In this case, we would incorrectly determine that A's macro redefines B's macro, and so we don't need to re-export B's macro at all. This happens with the 'assert' macro in an LLVM self-host. =( llvm-svn: 213348
Diffstat (limited to 'clang/test/Modules/macro-hiding.cpp')
-rw-r--r--clang/test/Modules/macro-hiding.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Modules/macro-hiding.cpp b/clang/test/Modules/macro-hiding.cpp
new file mode 100644
index 00000000000..a7a6064e64d
--- /dev/null
+++ b/clang/test/Modules/macro-hiding.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/macro-hiding %s
+#include "c1.h"
+#include "b2.h"
+
+void h() { assert(true); }
OpenPOWER on IntegriCloud