summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs/macro-hiding
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/Inputs/macro-hiding
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/Inputs/macro-hiding')
-rw-r--r--clang/test/Modules/Inputs/macro-hiding/a1.h1
-rw-r--r--clang/test/Modules/Inputs/macro-hiding/a2.h0
-rw-r--r--clang/test/Modules/Inputs/macro-hiding/b1.h0
-rw-r--r--clang/test/Modules/Inputs/macro-hiding/b2.h2
-rw-r--r--clang/test/Modules/Inputs/macro-hiding/c1.h2
-rw-r--r--clang/test/Modules/Inputs/macro-hiding/module.modulemap11
6 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/macro-hiding/a1.h b/clang/test/Modules/Inputs/macro-hiding/a1.h
new file mode 100644
index 00000000000..b17c8eeb69a
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-hiding/a1.h
@@ -0,0 +1 @@
+#define assert(x)
diff --git a/clang/test/Modules/Inputs/macro-hiding/a2.h b/clang/test/Modules/Inputs/macro-hiding/a2.h
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-hiding/a2.h
diff --git a/clang/test/Modules/Inputs/macro-hiding/b1.h b/clang/test/Modules/Inputs/macro-hiding/b1.h
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-hiding/b1.h
diff --git a/clang/test/Modules/Inputs/macro-hiding/b2.h b/clang/test/Modules/Inputs/macro-hiding/b2.h
new file mode 100644
index 00000000000..83918489e92
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-hiding/b2.h
@@ -0,0 +1,2 @@
+#include "a2.h"
+#define assert(x)
diff --git a/clang/test/Modules/Inputs/macro-hiding/c1.h b/clang/test/Modules/Inputs/macro-hiding/c1.h
new file mode 100644
index 00000000000..4b78b3c2734
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-hiding/c1.h
@@ -0,0 +1,2 @@
+#include "b1.h"
+#define assert(x)
diff --git a/clang/test/Modules/Inputs/macro-hiding/module.modulemap b/clang/test/Modules/Inputs/macro-hiding/module.modulemap
new file mode 100644
index 00000000000..2657ab1692a
--- /dev/null
+++ b/clang/test/Modules/Inputs/macro-hiding/module.modulemap
@@ -0,0 +1,11 @@
+module a {
+ module a1 { header "a1.h" export * }
+ module a2 { header "a2.h" export * }
+}
+module b {
+ module b1 { header "b1.h" export * }
+ module b2 { header "b2.h" export * }
+}
+module c {
+ module c1 { header "c1.h" export * }
+}
OpenPOWER on IntegriCloud