xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/debug-property-synth.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -g %s -o - | FileCheck %s
2// rdar://problem/9468526
3//
4// Setting a breakpoint on a property should create breakpoints in
5// synthesized getters/setters.
6//
7@interface I {
8  int _p1;
9}
10// Test that the linetable entries for the synthesized getter and
11// setter are correct.
12//
13// CHECK: define {{.*}}[I p1]
14// CHECK-NOT: ret
15// CHECK: load {{.*}}, !dbg ![[DBG1:[0-9]+]]
16//
17// CHECK: define {{.*}}[I setP1:]
18// CHECK-NOT: ret
19// CHECK: load {{.*}}, !dbg ![[DBG2:[0-9]+]]
20//
21// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+4]]] [local] [def] [-[I p1]]
22// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+3]]] [local] [def] [-[I setP1:]]
23// CHECK: ![[DBG1]] = !MDLocation(line: [[@LINE+2]],
24// CHECK: ![[DBG2]] = !MDLocation(line: [[@LINE+1]],
25@property int p1;
26@end
27
28@implementation I
29@synthesize p1 = _p1;
30@end
31
32int main() {
33  I *myi;
34  myi.p1 = 2;
35  return myi.p1;
36}
37