Michael Buch 3f3bc4853e
[clang][test][DebugInfo] Move debug-info tests from CodeGen to DebugInfo directory (#154311)
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/CodeGen` tests.

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

I created a couple of subdirectories in `clang/test/DebugInfo` where I
thought it made sense (mostly when the tests were target-specific).

There's a couple of tests in `clang/test/CodeGen` 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-19 18:25:13 +01:00

26 lines
1.1 KiB
C++

// RUN: %clang_cc1 -x c++ -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s
namespace foo {
template <typename T>
struct S {
T x;
};
extern S<char> s;
int test(void) {
return s.x;
}
} // namespace foo
// CHECK: distinct !DIGlobalVariable(name: "s", scope: ![[NAMESPACE:[0-9]+]],{{.*}} type: ![[STRUCT_TYPE:[0-9]+]], isLocal: false, isDefinition: false)
// CHECK: ![[NAMESPACE]] = !DINamespace(name: "foo", scope: null)
// CHECK: ![[STRUCT_TYPE]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S<char>",{{.*}}size: 8, flags: DIFlagTypePassByValue, elements: ![[ELEMENT_TYPE:[0-9]+]], templateParams: ![[TEMPLATE_TYPE:[0-9]+]], identifier: "_ZTSN3foo1SIcEE")
// CHECK: ![[ELEMENT_TYPE]] = !{![[ELEMENT_TYPE:[0-9]+]]}
// CHECK: ![[ELEMENT_TYPE]] = !DIDerivedType(tag: DW_TAG_member, name: "x",{{.*}} baseType: ![[BASE_TYPE:[0-9]+]], size: 8)
// CHECK: ![[BASE_TYPE]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
// CHECK: ![[TEMPLATE_TYPE]] = !{![[TEMPLATE_TYPE:[0-9]+]]}
// CHECK: ![[TEMPLATE_TYPE]] = !DITemplateTypeParameter(name: "T", type: ![[BASE_TYPE]])