xref: /llvm-project/clang/test/CodeGen/assignment-tracking/flag.cpp (revision de6da6ad55d3ca945195d1cb109cb8efdf40a52a)
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
5 
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
10 
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
15 
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
25 
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
43 
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
53 
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).
58 
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
63 
fun(int a)64 void fun(int a) {}
65