[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / assignment-tracking / flag.cpp
blob3bd974fe07c6c0b39c2cf8e21c4eeed9ee97e77f
1 //// Explicitly enabled:
2 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
3 // RUN: -emit-llvm -fexperimental-assignment-tracking=enabled %s -o - -O1 \
4 // RUN: | FileCheck %s --check-prefixes=ENABLE
6 //// Explicitly disabled:
7 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
8 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=disabled -O1\
9 // RUN: | FileCheck %s --check-prefixes=DISABLE
11 //// Enabled by default:
12 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
13 // RUN: -emit-llvm %s -o - -O1 \
14 // RUN: | FileCheck %s --check-prefixes=ENABLE
16 //// Disabled at O0 unless forced.
17 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
18 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=enabled \
19 // RUN: -O0 -disable-O0-optnone \
20 // RUN: | FileCheck %s --check-prefixes=DISABLE
21 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
22 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=forced \
23 // RUN: -O0 -disable-O0-optnone \
24 // RUN: | FileCheck %s --check-prefixes=ENABLE
26 //// Disabled for LTO and thinLTO unless forced.
27 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
28 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=enabled \
29 // RUN: -O1 -flto=full \
30 // RUN: | FileCheck %s --check-prefixes=DISABLE
31 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
32 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=enabled \
33 // RUN: -O1 -flto=thin \
34 // RUN: | FileCheck %s --check-prefixes=DISABLE
35 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
36 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=forced \
37 // RUN: -O1 -flto=full \
38 // RUN: | FileCheck %s --check-prefixes=ENABLE
39 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
40 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=forced \
41 // RUN: -O1 -flto=thin \
42 // RUN: | FileCheck %s --check-prefixes=ENABLE
44 //// Disabled for LLDB debugger tuning unless forced.
45 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
46 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=enabled \
47 // RUN: -O1 -debugger-tuning=lldb \
48 // RUN: | FileCheck %s --check-prefixes=DISABLE
49 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone \
50 // RUN: -emit-llvm %s -o - -fexperimental-assignment-tracking=forced \
51 // RUN: -O1 -debugger-tuning=lldb \
52 // RUN: | FileCheck %s --check-prefixes=ENABLE
54 // Check the assignment-tracking module flag appears in the output when the
55 // flag -fexperimental-assignment-tracking is set to 'enabled' (in some cases)
56 // or 'forced' (always), and is does not appear when the flag is set to
57 // 'disabled' (default).
59 // ENABLE: "debug-info-assignment-tracking"
60 // DISABLE-NOT: "debug-info-assignment-tracking"
61 //// Check there's actually any output at all.
62 // DISABLE: llvm.module.flags
64 void fun(int a) {}