annotate clang/test/Sema/attr-availability-swift.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -fblocks -verify %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -ast-dump %s | FileCheck %s
anatofuz
parents:
diff changeset
3 //
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 #if !__has_feature(attribute_availability_with_message)
anatofuz
parents:
diff changeset
6 # error "Missing __has_feature"
anatofuz
parents:
diff changeset
7 #endif
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #if __has_feature(attribute_availability_swift)
anatofuz
parents:
diff changeset
10 # warning "okay"
anatofuz
parents:
diff changeset
11 // expected-warning@-1{{okay}}
anatofuz
parents:
diff changeset
12 #else
anatofuz
parents:
diff changeset
13 # error "Missing __has_feature"
anatofuz
parents:
diff changeset
14 #endif
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 extern int noSwiftGlobal1 __attribute__((availability(swift, unavailable)));
anatofuz
parents:
diff changeset
17 // CHECK: AvailabilityAttr {{.*}}swift 0 0 0 Unavailable "" ""
anatofuz
parents:
diff changeset
18 extern int noSwiftGlobal1 __attribute__((availability(macosx, introduced=10.1))); // okay
anatofuz
parents:
diff changeset
19 // CHECK: AvailabilityAttr {{.*}}Inherited swift 0 0 0 Unavailable "" ""
anatofuz
parents:
diff changeset
20 // CHECK: AvailabilityAttr {{.*}}macos 10.1 0 0 "" ""
anatofuz
parents:
diff changeset
21 extern int noSwiftGlobal1 __attribute__((availability(swift, unavailable, message="and this one has a message"))); // okay
anatofuz
parents:
diff changeset
22 // CHECK: AvailabilityAttr {{.*}}Inherited macos 10.1 0 0 "" ""
anatofuz
parents:
diff changeset
23 // CHECK: AvailabilityAttr {{.*}}swift 0 0 0 Unavailable "and this one has a message" ""
anatofuz
parents:
diff changeset
24 extern int noSwiftGlobal2 __attribute__((availability(swift, introduced=5))); // expected-warning{{only 'unavailable' and 'deprecated' are supported for Swift availability}}
anatofuz
parents:
diff changeset
25 // CHECK: VarDecl
anatofuz
parents:
diff changeset
26 // CHECK-NOT: AvailabilityAttr
anatofuz
parents:
diff changeset
27 extern int noSwiftGlobal3 __attribute__((availability(swift, deprecated, message="t")));
anatofuz
parents:
diff changeset
28 // CHECK: VarDecl
anatofuz
parents:
diff changeset
29 // CHECK: AvailabilityAttr {{.*}}swift 0 1 0 "t" ""