Joe Daniels | f7393d2 | 2019-02-04 23:32:55 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify -Wno-objc-root-class -fsyntax-only %s |
| 2 | |
| 3 | __attribute__((objc_nonlazy_class)) |
| 4 | @interface A |
| 5 | @end |
| 6 | @implementation A |
| 7 | @end |
| 8 | |
| 9 | __attribute__((objc_nonlazy_class)) int X; // expected-error {{'objc_nonlazy_class' attribute only applies to Objective-C interfaces}} |
| 10 | |
| 11 | __attribute__((objc_nonlazy_class())) |
| 12 | @interface B |
| 13 | @end |
| 14 | @implementation B |
| 15 | @end |
| 16 | |
| 17 | __attribute__((objc_nonlazy_class("foo"))) // expected-error{{'objc_nonlazy_class' attribute takes no arguments}} |
| 18 | @interface C |
| 19 | @end |
| 20 | @implementation C |
| 21 | @end |
| 22 | |
| 23 | __attribute__((objc_nonlazy_class)) // expected-error {{'objc_nonlazy_class' attribute only applies to Objective-C interfaces}} |
| 24 | @protocol B |
| 25 | @end |
| 26 | |
| 27 | __attribute__((objc_nonlazy_class)) // expected-error {{'objc_nonlazy_class' attribute only applies to Objective-C interfaces}} |
| 28 | void foo(); |
| 29 | |
| 30 | @interface E |
| 31 | @end |
Erik Pilkington | 1138d8c | 2019-04-11 17:55:34 +0000 | [diff] [blame^] | 32 | |
Joe Daniels | f7393d2 | 2019-02-04 23:32:55 +0000 | [diff] [blame] | 33 | __attribute__((objc_nonlazy_class)) |
Erik Pilkington | c5a0583 | 2019-04-11 17:55:30 +0000 | [diff] [blame] | 34 | @implementation E |
Joe Daniels | f7393d2 | 2019-02-04 23:32:55 +0000 | [diff] [blame] | 35 | @end |
Erik Pilkington | 1138d8c | 2019-04-11 17:55:34 +0000 | [diff] [blame^] | 36 | |
| 37 | __attribute__((objc_nonlazy_class)) |
| 38 | @implementation E (MyCat) |
| 39 | @end |