llvm-project/clang/test/DebugInfo/CXX/all-calls-described.cpp
Michael Buch f2aedc21f9
[clang][DebugInfo][test] Move debug-info tests from CodeGenCXX to DebugInfo directory (#154538)
This patch works towards consolidating all Clang debug-info into the
`clang/test/DebugInfo` directory
(https://discourse.llvm.org/t/clang-test-location-of-clang-debug-info-tests/87958).

Here we move only the `clang/test/CodeGenCXX` tests. I created a `CXX`
subdirectory for now because many of the tests I checked actually did
seem C++-specific. There is probably overlap between the `Generic` and
`CXX` subdirectory, but I haven't gone through and audited them all.

The list of files i came up with is:
1. searched for anything with `*debug-info*` in the filename
2. searched for occurrences of `debug-info-kind` in the tests

There's a couple of tests in `clang/test/CodeGenCXX` that still set
`-debug-info-kind`. They probably don't need to do that, but I'm not
changing that as part of this PR.
2025-08-21 09:26:08 +01:00

88 lines
3.7 KiB
C++

// Test that call site debug info is (un)supported in various configurations.
// Supported: DWARF5, -O1, standalone DI
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
// RUN: -O1 -disable-llvm-passes \
// RUN: -debug-info-kind=standalone -dwarf-version=5 \
// RUN: | FileCheck %s -check-prefix=HAS-ATTR \
// RUN: -implicit-check-not=DISubprogram -implicit-check-not=DIFlagAllCallsDescribed
// Supported: DWARF4 + LLDB tuning, -O1, limited DI
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
// RUN: -O1 -disable-llvm-passes \
// RUN: -debugger-tuning=lldb \
// RUN: -debug-info-kind=standalone -dwarf-version=4 \
// RUN: | FileCheck %s -check-prefix=HAS-ATTR \
// RUN: -implicit-check-not=DISubprogram -implicit-check-not=DIFlagAllCallsDescribed
// Note: DIFlagAllCallsDescribed may have been enabled prematurely when tuning
// for GDB under -gdwarf-4 in https://reviews.llvm.org/D69743. It's possible
// this should have been 'Unsupported' until entry values emission was enabled
// by default.
//
// Supported: DWARF4 + GDB tuning
// RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu \
// RUN: %s -o - -O1 -disable-llvm-passes -debugger-tuning=gdb \
// RUN: -debug-info-kind=standalone -dwarf-version=4 \
// RUN: | FileCheck %s -check-prefix=HAS-ATTR \
// RUN: -implicit-check-not=DIFlagAllCallsDescribed
// Supported: DWARF4 + LLDB, -O1
// RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu \
// RUN: %s -o - -O1 -disable-llvm-passes -debugger-tuning=lldb \
// RUN: -debug-info-kind=standalone -dwarf-version=4 \
// RUN: | FileCheck %s -check-prefix=HAS-ATTR \
// RUN: -implicit-check-not=DIFlagAllCallsDescribed
// Unsupported: -O0
// RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu \
// RUN: %s -o - -O0 -disable-llvm-passes -debugger-tuning=gdb \
// RUN: -debug-info-kind=standalone -dwarf-version=4 \
// RUN: | FileCheck %s -check-prefix=NO-ATTR
// Supported: DWARF4 + LLDB tuning, -O1, line-tables only DI
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
// RUN: -O1 -disable-llvm-passes \
// RUN: -debugger-tuning=lldb \
// RUN: -debug-info-kind=line-tables-only -dwarf-version=4 \
// RUN: | FileCheck %s -check-prefix=LINE-TABLES-ONLY
// Unsupported: -O0
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
// RUN: -O0 \
// RUN: -debug-info-kind=standalone -dwarf-version=5 \
// RUN: | FileCheck %s -check-prefix=NO-ATTR
// Unsupported: DWARF4
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - \
// RUN: -O1 -disable-llvm-passes \
// RUN: -debug-info-kind=standalone -dwarf-version=4 \
// RUN: | FileCheck %s -check-prefix=NO-ATTR
// NO-ATTR-NOT: FlagAllCallsDescribed
// HAS-ATTR-DAG: DISubprogram(name: "declaration1", {{.*}}, flags: DIFlagPrototyped
// HAS-ATTR-DAG: DISubprogram(name: "declaration2", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
// HAS-ATTR-DAG: DISubprogram(name: "struct1", {{.*}}, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
// HAS-ATTR-DAG: DISubprogram(name: "struct1", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
// HAS-ATTR-DAG: DISubprogram(name: "method1", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
// HAS-ATTR-DAG: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
// LINE-TABLES-ONLY: DISubprogram(name: "force_irgen", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
void declaration1();
void declaration2();
void declaration2() {}
struct struct1 {
struct1() {}
void method1() {}
};
void __attribute__((optnone)) force_irgen() {
declaration1();
struct1().method1();
}