2012-05-08 08:14:45 +08:00
|
|
|
// Run lines below; this test is line- and column-sensitive.
|
|
|
|
|
|
|
|
void foo(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,obsoleted=10.7), availability(ios,introduced=3.2,deprecated=4.1)));
|
|
|
|
|
2013-10-16 01:00:53 +08:00
|
|
|
enum {
|
|
|
|
old_enum
|
|
|
|
} __attribute__((deprecated));
|
|
|
|
|
|
|
|
enum {
|
|
|
|
old_enum_plat
|
2017-06-13 03:06:30 +08:00
|
|
|
} __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,obsoleted=10.7)));
|
2013-10-16 01:00:53 +08:00
|
|
|
|
2017-06-13 03:06:30 +08:00
|
|
|
void bar(void) __attribute__((availability(macosx,introduced=10.4))) __attribute__((availability(macosx,obsoleted=10.6))) __attribute__((availability(ios,introduced=3.2))) __attribute__((availability(macosx,deprecated=10.5,message="use foobar")));
|
2012-05-08 08:29:04 +08:00
|
|
|
|
2017-06-13 03:06:30 +08:00
|
|
|
void bar2(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,obsoleted=10.7))) __attribute__((availability(ios,introduced=3.2,deprecated=10.0))) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,obsoleted=10.7))) __attribute__((availability(ios,introduced=3.2,deprecated=10.0)));
|
|
|
|
|
Support Swift in platform availability attribute
Summary: This adds support for Swift platform availability attributes. It's largely a port of the changes made to https://github.com/apple/swift-clang/ for Swift availability attributes. Specifically, https://github.com/apple/swift-clang/commit/84b5a21c31cb5b0d7d958a478bc01964939b6952 and https://github.com/apple/swift-clang/commit/e5b87f265aede41c8381094bbf54e2715c8293b0 . The implementation of attribute_availability_swift is a little different and additional tests in test/Index/availability.c were added.
Reviewers: manmanren, friss, doug.gregor, arphaman, jfb, erik.pilkington, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: aaron.ballman, ColinKinloch, jrmuizel, cfe-commits
Differential Revision: https://reviews.llvm.org/D50318
llvm-svn: 346633
2018-11-12 10:44:33 +08:00
|
|
|
void foo2(void) __attribute__((availability(swift,unavailable)));
|
|
|
|
void foo3(void) __attribute__((availability(swift,deprecated)));
|
|
|
|
|
2017-06-13 03:06:30 +08:00
|
|
|
// RUN: c-index-test -test-load-source all %s | FileCheck %s
|
|
|
|
// CHECK: FunctionDecl=foo:3:6{{.*}}(ios, introduced=3.2, deprecated=4.1) (macos, introduced=10.4, deprecated=10.5, obsoleted=10.7)
|
|
|
|
// CHECK: EnumConstantDecl=old_enum:6:3 (Definition) (deprecated)
|
|
|
|
// CHECK: EnumConstantDecl=old_enum_plat:10:3 {{.*}} (macos, introduced=10.4, deprecated=10.5, obsoleted=10.7)
|
|
|
|
// CHECK: FunctionDecl=bar:13:6{{.*}}(ios, introduced=3.2) (macos, introduced=10.4, deprecated=10.5, obsoleted=10.6, message="use foobar")
|
|
|
|
// CHECK: FunctionDecl=bar2:15:6{{.*}}(ios, introduced=3.2, deprecated=10.0) (macos, introduced=10.4, deprecated=10.5, obsoleted=10.7)
|
Support Swift in platform availability attribute
Summary: This adds support for Swift platform availability attributes. It's largely a port of the changes made to https://github.com/apple/swift-clang/ for Swift availability attributes. Specifically, https://github.com/apple/swift-clang/commit/84b5a21c31cb5b0d7d958a478bc01964939b6952 and https://github.com/apple/swift-clang/commit/e5b87f265aede41c8381094bbf54e2715c8293b0 . The implementation of attribute_availability_swift is a little different and additional tests in test/Index/availability.c were added.
Reviewers: manmanren, friss, doug.gregor, arphaman, jfb, erik.pilkington, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: aaron.ballman, ColinKinloch, jrmuizel, cfe-commits
Differential Revision: https://reviews.llvm.org/D50318
llvm-svn: 346633
2018-11-12 10:44:33 +08:00
|
|
|
// CHECK: FunctionDecl=foo2:17:6{{.*}}(swift, unavailable)
|
|
|
|
// CHECK: FunctionDecl=foo3:18:6{{.*}}(swift, deprecated=1)
|