llvm-project/clang/test/DebugInfo/Generic/attr-counted-by-debug-info.c
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

18 lines
637 B
C

// RUN: %clang -emit-llvm -DCOUNTED_BY -S -g %s -o - | FileCheck %s
// RUN: %clang -emit-llvm -S -g %s -o - | FileCheck %s
#ifdef COUNTED_BY
#define __counted_by(member) __attribute__((__counted_by__(member)))
#else
#define __counted_by(member)
#endif
struct {
int num_counters;
long value[] __counted_by(num_counters);
} agent_send_response_port_num;
// CHECK: !DICompositeType(tag: DW_TAG_array_type, baseType: ![[BT:.*]], elements: ![[ELEMENTS:.*]])
// CHECK: ![[BT]] = !DIBasicType(name: "long", size: {{.*}}, encoding: DW_ATE_signed)
// CHECK: ![[ELEMENTS]] = !{![[COUNT:.*]]}
// CHECK: ![[COUNT]] = !DISubrange(count: -1)