[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / CodeGenCXX / dbg-info-all-calls-described.cpp
blobe64e07cdb7485c68063a9d4487b974987e1971d2
1 // Test that call site debug info is (un)supported in various configurations.
3 // Supported: DWARF5, -O1, standalone DI
4 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
5 // RUN: -O1 -disable-llvm-passes \
6 // RUN: -debug-info-kind=standalone -dwarf-version=5 \
7 // RUN: | FileCheck %s -check-prefix=HAS-ATTR \
8 // RUN: -implicit-check-not=DISubprogram -implicit-check-not=DIFlagAllCallsDescribed
10 // Supported: DWARF4 + LLDB tuning, -O1, limited DI
11 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
12 // RUN: -O1 -disable-llvm-passes \
13 // RUN: -debugger-tuning=lldb \
14 // RUN: -debug-info-kind=standalone -dwarf-version=4 \
15 // RUN: | FileCheck %s -check-prefix=HAS-ATTR \
16 // RUN: -implicit-check-not=DISubprogram -implicit-check-not=DIFlagAllCallsDescribed
18 // Note: DIFlagAllCallsDescribed may have been enabled prematurely when tuning
19 // for GDB under -gdwarf-4 in https://reviews.llvm.org/D69743. It's possible
20 // this should have been 'Unsupported' until entry values emission was enabled
21 // by default.
23 // Supported: DWARF4 + GDB tuning
24 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu \
25 // RUN: %s -o - -O1 -disable-llvm-passes -debugger-tuning=gdb \
26 // RUN: -debug-info-kind=standalone -dwarf-version=4 \
27 // RUN: | FileCheck %s -check-prefix=HAS-ATTR \
28 // RUN: -implicit-check-not=DIFlagAllCallsDescribed
30 // Supported: DWARF4 + LLDB, -O1
31 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu \
32 // RUN: %s -o - -O1 -disable-llvm-passes -debugger-tuning=lldb \
33 // RUN: -debug-info-kind=standalone -dwarf-version=4 \
34 // RUN: | FileCheck %s -check-prefix=HAS-ATTR \
35 // RUN: -implicit-check-not=DIFlagAllCallsDescribed
37 // Unsupported: -O0
38 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu \
39 // RUN: %s -o - -O0 -disable-llvm-passes -debugger-tuning=gdb \
40 // RUN: -debug-info-kind=standalone -dwarf-version=4 \
41 // RUN: | FileCheck %s -check-prefix=NO-ATTR
43 // Supported: DWARF4 + LLDB tuning, -O1, line-tables only DI
44 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
45 // RUN: -O1 -disable-llvm-passes \
46 // RUN: -debugger-tuning=lldb \
47 // RUN: -debug-info-kind=line-tables-only -dwarf-version=4 \
48 // RUN: | FileCheck %s -check-prefix=LINE-TABLES-ONLY
50 // Unsupported: -O0
51 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
52 // RUN: -O0 \
53 // RUN: -debug-info-kind=standalone -dwarf-version=5 \
54 // RUN: | FileCheck %s -check-prefix=NO-ATTR
56 // Unsupported: DWARF4
57 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
58 // RUN: -O1 -disable-llvm-passes \
59 // RUN: -debug-info-kind=standalone -dwarf-version=4 \
60 // RUN: | FileCheck %s -check-prefix=NO-ATTR
62 // NO-ATTR-NOT: FlagAllCallsDescribed
64 // HAS-ATTR-DAG: DISubprogram(name: "declaration1", {{.*}}, flags: DIFlagPrototyped
65 // HAS-ATTR-DAG: DISubprogram(name: "declaration2", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
66 // HAS-ATTR-DAG: DISubprogram(name: "struct1", {{.*}}, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
67 // HAS-ATTR-DAG: DISubprogram(name: "struct1", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
68 // HAS-ATTR-DAG: DISubprogram(name: "method1", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
69 // HAS-ATTR-DAG: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
71 // LINE-TABLES-ONLY: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
73 void declaration1();
75 void declaration2();
77 void declaration2() {}
79 struct struct1 {
80 struct1() {}
81 void method1() {}
84 void __attribute__((optnone)) force_irgen() {
85 declaration1();
86 struct1().method1();