blob: 37ff11f51aee0db9e0197807d63ab2efcb0bbe55 [file] [log] [blame]
Stephen Hines651f13c2014-04-23 16:59:28 -07001// 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//
Devang Patel8d3f8972011-05-19 23:37:41 +00007@interface I {
8 int _p1;
9}
Stephen Hines651f13c2014-04-23 16:59:28 -070010// 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//
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -070021// CHECK: !MDSubprogram(name: "-[I p1]",{{.*}} line: [[@LINE+4]],{{.*}} isLocal: true, isDefinition: true
22// CHECK: !MDSubprogram(name: "-[I setP1:]",{{.*}} line: [[@LINE+3]],{{.*}} isLocal: true, isDefinition: true
Stephen Hines0e2c34f2015-03-23 12:09:02 -070023// CHECK: ![[DBG1]] = !MDLocation(line: [[@LINE+2]],
24// CHECK: ![[DBG2]] = !MDLocation(line: [[@LINE+1]],
Devang Patel8d3f8972011-05-19 23:37:41 +000025@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;
Stephen Hines651f13c2014-04-23 16:59:28 -070035 return myi.p1;
Devang Patel8d3f8972011-05-19 23:37:41 +000036}