diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Modules/Inputs/macros_bottom.h | 3 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/macros_right_undef.h | 1 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/macros_top.h | 1 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/module.map | 4 | ||||
| -rw-r--r-- | clang/test/Modules/macros.c | 6 |
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. |

