xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/debug-info-ivars-extension.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -g %s -o - | FileCheck %s
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc// Make sure we generate debug symbols for ivars added by a class extension.
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc@interface I
6f4a2713aSLionel Sambuc{
7f4a2713aSLionel Sambuc    @public int a;
8f4a2713aSLionel Sambuc}
9f4a2713aSLionel Sambuc@end
10f4a2713aSLionel Sambuc
11f4a2713aSLionel Sambucvoid foo(I* pi) {
12f4a2713aSLionel Sambuc    // poking into pi for primary class ivars.
13f4a2713aSLionel Sambuc    int _a = pi->a;
14f4a2713aSLionel Sambuc}
15f4a2713aSLionel Sambuc
16f4a2713aSLionel Sambuc@interface I()
17f4a2713aSLionel Sambuc{
18f4a2713aSLionel Sambuc    @public int b;
19f4a2713aSLionel Sambuc}
20f4a2713aSLionel Sambuc@end
21f4a2713aSLionel Sambuc
22f4a2713aSLionel Sambucvoid gorf (I* pg) {
23f4a2713aSLionel Sambuc    // poking into pg for ivars for class extension
24f4a2713aSLionel Sambuc    int _b = pg->b;
25f4a2713aSLionel Sambuc}
26f4a2713aSLionel Sambuc
27f4a2713aSLionel Sambuc// CHECK: {{.*}} [ DW_TAG_structure_type ] [I]
28f4a2713aSLionel Sambuc// Check for "a".
29*0a6a1f1dSLionel Sambuc// CHECK: {{.*}} [ DW_TAG_member ] [a] [line 7, size 32, align 32, offset 0] [public] [from int]
30f4a2713aSLionel Sambuc// Make sure we don't output the same type twice.
31f4a2713aSLionel Sambuc// CHECK-NOT: {{.*}} [ DW_TAG_structure_type ] [I]
32f4a2713aSLionel Sambuc// Check for "b".
33*0a6a1f1dSLionel Sambuc// CHECK: {{.*}} [ DW_TAG_member ] [b] [line 18, size 32, align 32, offset 0] [public] [from int]
34