brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 0a7b116 Raw
58 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3@interface B4+(int) classGetter;5-(int) getter;6@end7 8@interface A : B9@end10 11@implementation A12+(int) classGetter {13  return 0;14}15 16+(int) classGetter2 {17  return super.classGetter;18}19 20-(void) method {21  int x = super.getter;22}23@end24 25void f0(void) {26  // FIXME: not implemented yet.27  //int l1 = A.classGetter;28  int l2 = [A classGetter2];29}30 31__attribute__((objc_root_class)) @interface ClassBase 32@property (nonatomic, retain) ClassBase * foo; // expected-note {{property declared here}}33@end34 35@implementation ClassBase 36- (void) Meth:(ClassBase*)foo {37  super.foo = foo; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}}38  [super setFoo:foo]; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}}39}40@end41 42@interface ClassDerived : ClassBase 43@property (nonatomic, retain) ClassDerived * foo; // expected-warning {{auto property synthesis will not synthesize property 'foo'; it will be implemented by its superclass}}44@end45 46@implementation ClassDerived // expected-note {{detected while default synthesizing properties in class implementation}}47- (void) Meth:(ClassBase*)foo {48  super.foo = foo; // must work with no warning49  [super setFoo:foo]; // works with no warning50}51@end52 53@implementation IFaceNotFound (Foo) // expected-error {{cannot find interface declaration for 'IFaceNotFound'}}54-(int) foo {55  return super.foo; // expected-error {{expected identifier or '('}}56}57@end58