Debian Codegraph @

clang/test/DebugInfo/Generic/dbg-info-all-calls-described.c

raw
1 // Test that call site debug info is (un)supported in various configurations.
2
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
9
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
17
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.
22 //
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
29
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
36
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
42
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
49
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
55
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
61
62 // Disabled by feature flag (enabled by default)
63 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
64 // RUN: -O1 -disable-llvm-passes \
65 // RUN: -debug-info-kind=standalone -dwarf-version=5 \
66 // RUN: -gno-call-site-info \
67 // RUN: | FileCheck %s -check-prefix=NO-ATTR
68
69 // NO-ATTR-NOT: FlagAllCallsDescribed
70
71 // HAS-ATTR-DAG: DISubprogram(name: "declaration1", {{.*}}, spFlags: DISPFlagOptimized)
72 // HAS-ATTR-DAG: DISubprogram(name: "declaration2", {{.*}}, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized
73 // HAS-ATTR-DAG: DISubprogram(name: "declaration3", {{.*}}, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
74 // HAS-ATTR-DAG: DISubprogram(name: "declaration4", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized
75
76 // HAS-ATTR-DAG: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
77
78 // LINE-TABLES-ONLY: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
79
80 void declaration1();
81
82 void declaration2();
83
84 void declaration2() {}
85
86 void declaration3(void);
87
88 void declaration4(void);
89
90 void declaration4(void) {}
91
92 void __attribute__((optnone)) force_irgen(void) {
93 declaration1();
94 declaration3();
95 }