Patrick Beard | acfbe9e | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // 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 Ballman | f90ccb0 | 2013-07-18 14:56:42 +0000 | [diff] [blame] | 14 | __attribute__((objc_root_class)) static void nonClassDeclaration() // expected-error {{'objc_root_class' attribute only applies to Objective-C interfaces}} |
Patrick Beard | acfbe9e | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 15 | { |
| 16 | } |
Aaron Ballman | 283ef42 | 2013-07-23 15:16:00 +0000 | [diff] [blame^] | 17 | |
| 18 | __attribute__((objc_root_class(1))) // expected-error {{attribute 'objc_root_class' takes no arguments}} |
| 19 | @interface I1 |
| 20 | @end |