[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / merge-decl-context.cpp
blob5dbf3d1bd95f604986083fedcd930ce25f2c7088
1 // RUN: rm -rf %t
3 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=b -o %t/b.pcm \
4 // RUN: -emit-module %S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
5 // RUN: -I %S/Inputs/merge-decl-context
6 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=c -o %t/c.pcm \
7 // RUN: -fmodule-file=%t/b.pcm -fno-implicit-modules \
8 // RUN: -emit-module %S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
9 // RUN: -I %S/Inputs/merge-decl-context
10 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=d -o %t/d.pcm \
11 // RUN: -fmodule-file=%t/b.pcm -fno-implicit-modules \
12 // RUN: -emit-module %S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
13 // RUN: -I %S/Inputs/merge-decl-context
15 // Use the two modules in a single compile.
16 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-file=%t/c.pcm -fmodule-file=%t/b.pcm \
17 // RUN: -fmodule-file=%t/d.pcm -fno-implicit-modules \
18 // RUN: -fmodule-map-file=%S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
19 // RUN: -emit-llvm -o %t/test.o %s
21 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fmodules-cache-path=%t \
22 // RUN: -fmodule-map-file=%S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
23 // RUN: -emit-llvm -o %t/test.o -DNO_TEXTUAL_INCLUSION %s
25 #ifndef NO_TEXTUAL_INCLUSION
26 #include "Inputs/merge-decl-context/a.h"
27 #endif
28 #include "Inputs/merge-decl-context/b.h"
29 #include "Inputs/merge-decl-context/c.h"
30 #include "Inputs/merge-decl-context/d.h"
32 void t() {
33 ff(42);
36 static_assert(Aggregate{.member = 1}.member == 1, "");