diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-22 19:43:45 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-22 19:43:45 +0000 |
commit | aa803409c3bd3930126db630c29f63d42f255153 (patch) | |
tree | 042106605c08352895ba4383ef97eae88b6b31aa /test/Modules/macro-redefinition.cpp | |
parent | 1ce08792766261dcaa25d8215f9d1c2f70d7b7e9 (diff) |
Diffstat (limited to 'test/Modules/macro-redefinition.cpp')
-rw-r--r-- | test/Modules/macro-redefinition.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Modules/macro-redefinition.cpp b/test/Modules/macro-redefinition.cpp new file mode 100644 index 000000000000..7b1c7b658624 --- /dev/null +++ b/test/Modules/macro-redefinition.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fmodules -x c++-module-map %s -fmodule-name=__usr_include -verify +// RUN: %clang_cc1 -fmodules -x c++-module-map %s -fmodule-name=__usr_include -verify -DIMPORT + +module __usr_include { + module stddef {} + module stdlib {} +} + +#pragma clang module contents + +// expected-no-diagnostics + +#pragma clang module begin __usr_include.stddef + #define NULL 0 +#pragma clang module end + +#pragma clang module begin __usr_include.stdlib + #ifdef IMPORT + #pragma clang module import __usr_include.stddef + #else + #pragma clang module begin __usr_include.stddef + #define NULL 0 + #pragma clang module end + #endif + + void *f() { return NULL; } // ok, NULL is visible here +#pragma clang module end |