brintos

brintos / llvm-project-archived public Read only

0
0
Text · 637 B · a6c2b13 Raw
18 lines · c
1// RUN: %clang -emit-llvm -DCOUNTED_BY -S -g %s -o - | FileCheck %s2// RUN: %clang -emit-llvm -S -g %s -o - | FileCheck %s3 4#ifdef COUNTED_BY5#define __counted_by(member)    __attribute__((__counted_by__(member)))6#else7#define __counted_by(member)8#endif9 10struct {11  int num_counters;12  long value[] __counted_by(num_counters);13} agent_send_response_port_num;14 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)