[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / macro-redefinition.cpp
blob7b1c7b65862429d9ca8b0a014b7df2b2f874d4be
1 // RUN: %clang_cc1 -fmodules -x c++-module-map %s -fmodule-name=__usr_include -verify
2 // RUN: %clang_cc1 -fmodules -x c++-module-map %s -fmodule-name=__usr_include -verify -DIMPORT
4 module __usr_include {
5 module stddef {}
6 module stdlib {}
9 #pragma clang module contents
11 // expected-no-diagnostics
13 #pragma clang module begin __usr_include.stddef
14 #define NULL 0
15 #pragma clang module end
17 #pragma clang module begin __usr_include.stdlib
18 #ifdef IMPORT
19 #pragma clang module import __usr_include.stddef
20 #else
21 #pragma clang module begin __usr_include.stddef
22 #define NULL 0
23 #pragma clang module end
24 #endif
26 void *f() { return NULL; } // ok, NULL is visible here
27 #pragma clang module end