[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / attr-counted-by-debug-info.c
bloba6c2b1382b796bffa1dad5f0dae61eef41ec3443
1 // RUN: %clang -emit-llvm -DCOUNTED_BY -S -g %s -o - | FileCheck %s
2 // RUN: %clang -emit-llvm -S -g %s -o - | FileCheck %s
4 #ifdef COUNTED_BY
5 #define __counted_by(member) __attribute__((__counted_by__(member)))
6 #else
7 #define __counted_by(member)
8 #endif
10 struct {
11 int num_counters;
12 long value[] __counted_by(num_counters);
13 } agent_send_response_port_num;
15 // CHECK: !DICompositeType(tag: DW_TAG_array_type, baseType: ![[BT:.*]], elements: ![[ELEMENTS:.*]])
16 // CHECK: ![[BT]] = !DIBasicType(name: "long", size: {{.*}}, encoding: DW_ATE_signed)
17 // CHECK: ![[ELEMENTS]] = !{![[COUNT:.*]]}
18 // CHECK: ![[COUNT]] = !DISubrange(count: -1)