blob: 6be1c09d4dc741bdbf42563b06f67246ff4e15f1 [file] [log] [blame]
Patrick Beardacfbe9e2012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wattributes -Wobjc-root-class %s
2@interface RootClass {} // expected-warning {{class 'RootClass' defined without specifying a base class}} \
3 // expected-note {{add a super class to fix this problem}}
4@end
5@implementation RootClass
6@end
7
8__attribute__((objc_root_class))
9@interface NonRootClass : RootClass // expected-error {{objc_root_class attribute may only be specified on a root class declaration}}
10@end
11@implementation NonRootClass
12@end
13
Aaron Ballmanf90ccb02013-07-18 14:56:42 +000014__attribute__((objc_root_class)) static void nonClassDeclaration() // expected-error {{'objc_root_class' attribute only applies to Objective-C interfaces}}
Patrick Beardacfbe9e2012-04-06 18:12:22 +000015{
16}
Aaron Ballman283ef422013-07-23 15:16:00 +000017
Aaron Ballmanb7243382013-07-23 19:30:11 +000018__attribute__((objc_root_class(1))) // expected-error {{'objc_root_class' attribute takes no arguments}}
Aaron Ballman283ef422013-07-23 15:16:00 +000019@interface I1
20@end