96 lines · c
1// Test that call site debug info is (un)supported in various configurations.2 3// Supported: DWARF5, -O1, standalone DI4// 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=DIFlagAllCallsDescribed9 10// Supported: DWARF4 + LLDB tuning, -O1, limited DI11// 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=DIFlagAllCallsDescribed17 18// Note: DIFlagAllCallsDescribed may have been enabled prematurely when tuning19// for GDB under -gdwarf-4 in https://reviews.llvm.org/D69743. It's possible20// this should have been 'Unsupported' until entry values emission was enabled21// by default.22//23// Supported: DWARF4 + GDB tuning24// 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=DIFlagAllCallsDescribed29 30// Supported: DWARF4 + LLDB, -O131// 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=DIFlagAllCallsDescribed36 37// Unsupported: -O038// 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-ATTR42 43// Supported: DWARF4 + LLDB tuning, -O1, line-tables only DI44// 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-ONLY49 50// Unsupported: -O051// 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-ATTR55 56// Unsupported: DWARF457// 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-ATTR61 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-ATTR68 69// NO-ATTR-NOT: FlagAllCallsDescribed70 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 | DISPFlagOptimized75 76// HAS-ATTR-DAG: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition77 78// LINE-TABLES-ONLY: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition79 80void declaration1();81 82void declaration2();83 84void declaration2() {}85 86void declaration3(void);87 88void declaration4(void);89 90void declaration4(void) {}91 92void __attribute__((optnone)) force_irgen(void) {93 declaration1();94 declaration3();95}96