[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / search-partitions.cpp
blob92f7c637c8338483475d742cc9bfa6a7023a3517
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/partition1.cpp \
6 // RUN: -o %t/A-Part1.pcm
8 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/partition2.cpp \
9 // RUN: -o %t/A-Part2.pcm
11 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/partition3.cpp \
12 // RUN: -o %t/A-Part3.pcm
14 // RUN: %clang_cc1 -std=c++20 %t/moduleA.cpp -fsyntax-only -verify \
15 // RUN: -fprebuilt-module-path=%t
17 // Test again with reduced BMI
18 // RUN: rm -rf %t
19 // RUN: mkdir -p %t
20 // RUN: split-file %s %t
22 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/partition1.cpp \
23 // RUN: -o %t/A-Part1.pcm
25 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/partition2.cpp \
26 // RUN: -o %t/A-Part2.pcm
28 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/partition3.cpp \
29 // RUN: -o %t/A-Part3.pcm
31 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/moduleA.cpp -fprebuilt-module-path=%t
33 //--- partition1.cpp
34 export module A:Part1;
36 int part1();
38 //--- partition2.cpp
40 export module A:Part2;
42 int part2();
44 //--- partition3.cpp
46 export module A:Part3;
48 int part3();
50 //--- moduleA.cpp
51 // expected-no-diagnostics
52 export module A;
54 import :Part1;
55 export import :Part2;
56 import :Part3;
58 int foo();