[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / cxx20-partition-redeclarations.cpp
blob03658ba92534d322ed848a23ae82565e3fb42c9e
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: cd %t
5 // RUN: %clang_cc1 -std=c++20 A-intf-part.cpp -emit-module-interface \
6 // RUN: -o A-PubPart.pcm
7 // RUN: %clang_cc1 -std=c++20 A-interface.cpp -emit-module-interface \
8 // RUN: -fmodule-file=A-PubPart.pcm -o A.pcm
10 // RUN: %clang_cc1 -std=c++20 A-impl-top.cpp -fsyntax-only -fprebuilt-module-path=%t
11 // RUN: %clang_cc1 -std=c++20 A-impl-part.cpp -fsyntax-only -fprebuilt-module-path=%t
12 // RUN: %clang_cc1 -std=c++20 A-impl-1.cpp -fsyntax-only -fprebuilt-module-path=%t
13 // RUN: %clang_cc1 -std=c++20 A-impl-2.cpp -fsyntax-only -fprebuilt-module-path=%t
15 //--- A-interface.cpp
16 export module A;
18 export import :PubPart;
20 export void do_something();
22 void helper1();
23 void helper3();
25 //--- A-intf-part.cpp
26 export module A:PubPart;
28 void helper2();
30 //--- A-impl-top.cpp
32 module A;
34 void do_something() {
35 helper1();
36 helper2();
37 helper3();
40 //--- A-impl-part.cpp
41 module A:Secret;
43 import A;
45 void helper3() {}
47 //--- A-impl-1.cpp
48 module A;
50 void helper1() {}
52 //--- A-impl-2.cpp
53 module A;
55 void helper2() {}