blob: cbcdd382aaf01b8c18cb23c80afdc35ba02820ca [file] [log] [blame]
NAKAMURA Takumie7edf302011-12-10 07:50:30 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify %s
Douglas Gregor0a0d2b12011-03-23 00:50:03 +00002
3void f0() __attribute__((availability(macosx,introduced=10.4,deprecated=10.2))); // expected-warning{{feature cannot be deprecated in Mac OS X version 10.2 before it was introduced in version 10.4; attribute ignored}}
4void f1() __attribute__((availability(ios,obsoleted=2.1,deprecated=3.0))); // expected-warning{{feature cannot be obsoleted in iOS version 2.1 before it was deprecated in version 3.0; attribute ignored}}
Douglas Gregor3b6b7ac2011-08-10 15:31:35 +00005void f2() __attribute__((availability(ios,introduced=2.1,deprecated=2.1)));
Douglas Gregor0a0d2b12011-03-23 00:50:03 +00006
Douglas Gregor3b6b7ac2011-08-10 15:31:35 +00007void f3() __attribute__((availability(otheros,introduced=2.2))); // expected-warning{{unknown platform 'otheros' in availability macro}}
Fariborz Jahanian006e42f2011-12-10 00:28:41 +00008
9// rdar://10095131
10extern void
11ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName")));
12
13extern void
14ATSFontGetPostScriptName(int flags) __attribute__((availability(macosx,introduced=8.0,obsoleted=9.0, message="use ATSFontGetFullPostScriptName"))); // expected-note {{function has been explicitly marked unavailable here}}
15
16void test_10095131() {
17 ATSFontGetName("Hello"); // expected-warning {{'ATSFontGetName' is deprecated: first deprecated in Mac OS X 9.0 - use CTFontCopyFullName}}
18 ATSFontGetPostScriptName(100); // expected-error {{'ATSFontGetPostScriptName' is unavailable: obsoleted in Mac OS X 9.0 - use ATSFontGetFullPostScriptName}}
19}