1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 -fsyntax-only -Wno-objc-root-class -verify %s
5 // expected-warning@+1 {{'always_inline' attribute only applies to functions and statements}}
6 __attribute__((always_inline))
7 @implementation I1 @end
9 // expected-warning@+1 {{'always_inline' attribute only applies to functions and statements}}
10 __attribute__((always_inline))
11 @implementation I1 (MyCat) @end
13 // expected-warning@+1 {{'always_inline' attribute only applies to functions and statements}}
14 __attribute__((always_inline))
15 // expected-warning@+1 {{cannot find interface declaration for 'I2'}}
16 @implementation I2 @end
18 // expected-error@+1 {{only applies to Objective-C interfaces}}
19 __attribute__((objc_root_class))
20 // expected-warning@+1 {{cannot find interface declaration for 'I3'}}
21 @implementation I3 @end
23 #define AVAIL_ATTR __attribute__((availability(macos, introduced=1000)))
25 typedef int AVAIL_ATTR unavail_int; // expected-note {{marked as being introduced}}
27 @interface I4 @end // expected-note {{annotate}}
29 unavail_int x; // expected-warning {{'unavail_int' is only available on macOS 1000 or newer}}
35 #pragma clang attribute push (AVAIL_ATTR, apply_to=objc_implementation)
40 #pragma clang attribute pop
44 // expected-error@+1 2 {{'annotate' attribute takes at least 1 argument}}
45 #pragma clang attribute push (__attribute__((annotate)), apply_to=objc_implementation)
47 @interface I6 (MyCat) @end
50 @implementation I6 @end // expected-note {{when applied to this declaration}}
51 @implementation I6 (MyCat) @end // expected-note {{when applied to this declaration}}
53 #pragma clang attribute pop