49 lines · plain
1// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s2 3// Checks debug info for properties from class extensions for a few cases.4 5 6// Readonly property in interface made readwrite in a category, with @impl7// The interesting bit is that when the ivar debug info is generated, the corresponding8// property is looked up and also gets debug info. If the debug info from the interface's9// declaration and from the ivar doesn't match, this will end up with two DIObjCProperty10// entries which would be bad.11@interface FooROWithImpl12// CHECK-NOT: !DIObjCProperty(name: "evolvingpropwithimpl"{{.*}}line: [[@LINE+1]]13@property (readonly) int evolvingpropwithimpl;14@end15@interface FooROWithImpl ()16// CHECK: !DIObjCProperty(name: "evolvingpropwithimpl"{{.*}}line: [[@LINE+1]]17@property int evolvingpropwithimpl;18@end19@implementation FooROWithImpl20@synthesize evolvingpropwithimpl = _evolvingpropwithimpl;21@end22 23 24// Simple property from a class extension:25@interface Foo26@end27@interface Foo()28// CHECK: !DIObjCProperty(name: "myprop"{{.*}}line: [[@LINE+1]]29@property int myprop;30@end31// There's intentionally no @implementation for Foo, because that would32// generate debug info for the property via the backing ivar.33 34 35// Readonly property in interface made readwrite in a category:36@interface FooRO37// Shouldn't be here but in the class extension below.38// CHECK-NOT: !DIObjCProperty(name: "evolvingprop"{{.*}}line: [[@LINE+1]]39@property (readonly) int evolvingprop;40@end41@interface FooRO ()42// CHECK: !DIObjCProperty(name: "evolvingprop"{{.*}}line: [[@LINE+1]]43@property int evolvingprop;44@end45 46 47// This references types in this file to force emission of their debug info.48void foo(Foo *f, FooRO *g, FooROWithImpl* h) { }49