[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / module-fgen-reduced-bmi.cppm
blob1223189fb49b725854ef3a44c38a887902639203
1 // It is annoying to handle different slash direction
2 // in Windows and Linux. So we disable the test on Windows
3 // here.
4 // REQUIRES: !system-windows
5 // On AIX, the default output for `-c` may be `.s` instead of `.o`,
6 // which makes the test fail. So disable the test on AIX.
7 // UNSUPPORTED: system-aix
8 //
9 // RUN: rm -rf %t && split-file %s %t && cd %t
11 // RUN: %clang -std=c++20 Hello.cppm -fmodule-output=Hello.pcm \
12 // RUN:     -fexperimental-modules-reduced-bmi -c -o Hello.o -### 2>&1 | FileCheck Hello.cppm
14 // RUN: %clang -std=c++20 Hello.cppm \
15 // RUN:     -fexperimental-modules-reduced-bmi -c -o Hello.o -### 2>&1 | \
16 // RUN:         FileCheck Hello.cppm --check-prefix=CHECK-UNSPECIFIED
18 // RUN: %clang -std=c++20 Hello.cppm \
19 // RUN:     -fexperimental-modules-reduced-bmi -c -### 2>&1 | \
20 // RUN:         FileCheck Hello.cppm --check-prefix=CHECK-NO-O
22 // RUN: %clang -std=c++20 Hello.cppm \
23 // RUN:     -fexperimental-modules-reduced-bmi -c -o AnotherName.o -### 2>&1 | \
24 // RUN:         FileCheck Hello.cppm --check-prefix=CHECK-ANOTHER-NAME
26 // RUN: %clang -std=c++20 Hello.cppm --precompile -fexperimental-modules-reduced-bmi \
27 // RUN:     -o Hello.full.pcm -### 2>&1 | FileCheck Hello.cppm \
28 // RUN:     --check-prefix=CHECK-EMIT-MODULE-INTERFACE
30 // RUN: %clang -std=c++20 Hello.cc -fexperimental-modules-reduced-bmi -Wall -Werror \
31 // RUN:     -c -o Hello.o -### 2>&1 | FileCheck Hello.cc
33 //--- Hello.cppm
34 export module Hello;
36 // Test that we won't generate the emit-module-interface as 2 phase compilation model.
37 // CHECK-NOT: -emit-module-interface
38 // CHECK: "-fexperimental-modules-reduced-bmi"
40 // CHECK-UNSPECIFIED: -fmodule-output=Hello.pcm
42 // CHECK-NO-O: -fmodule-output=Hello.pcm
43 // CHECK-ANOTHER-NAME: -fmodule-output=AnotherName.pcm
45 // With `-emit-module-interface` specified, we should still see the `-emit-module-interface`
46 // flag.
47 // CHECK-EMIT-MODULE-INTERFACE: -emit-module-interface
49 //--- Hello.cc
51 // CHECK-NOT: "-fexperimental-modules-reduced-bmi"