aboutsummaryrefslogtreecommitdiff
path: root/clang/test/ExtractAPI/inherited_availability.m
blob: 3d9f953bbda1f817487ef0cfeeaf149bf3d148f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// RUN: rm -rf %t
// RUN: %clang_cc1 -extract-api --pretty-sgf --emit-sgf-symbol-labels-for-testing -triple arm64-apple-macosx \
// RUN:   -x objective-c-header %s -o %t/output.symbols.json -verify


// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix A
__attribute__((availability(macos, introduced=9.0, deprecated=12.0, obsoleted=30.0)))
@interface A
// A-LABEL: "!testLabel": "c:objc(cs)A"
// A:      "availability": [
// A-NEXT:   {
// A-NEXT:     "deprecated": {
// A-NEXT:       "major": 12,
// A-NEXT:       "minor": 0,
// A-NEXT:       "patch": 0
// A-NEXT:     }
// A-NEXT:     "domain": "macos"
// A-NEXT:     "introduced": {
// A-NEXT:       "major": 9,
// A-NEXT:       "minor": 0,
// A-NEXT:       "patch": 0
// A-NEXT:     }
// A-NEXT:     "obsoleted": {
// A-NEXT:       "major": 30,
// A-NEXT:       "minor": 0,
// A-NEXT:       "patch": 0
// A-NEXT:     }
// A-NEXT:   }
// A-NEXT: ]

// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix CP
@property(class) int CP;
// CP-LABEL: "!testLabel": "c:objc(cs)A(cpy)CP"
// CP:      "availability": [
// CP-NEXT:   {
// CP-NEXT:     "deprecated": {
// CP-NEXT:       "major": 12,
// CP-NEXT:       "minor": 0,
// CP-NEXT:       "patch": 0
// CP-NEXT:     }
// CP-NEXT:     "domain": "macos"
// CP-NEXT:     "introduced": {
// CP-NEXT:       "major": 9,
// CP-NEXT:       "minor": 0,
// CP-NEXT:       "patch": 0
// CP-NEXT:     }
// CP-NEXT:     "obsoleted": {
// CP-NEXT:       "major": 30,
// CP-NEXT:       "minor": 0,
// CP-NEXT:       "patch": 0
// CP-NEXT:     }
// CP-NEXT:   }
// CP-NEXT: ]

// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix IP
@property int IP;
// IP-LABEL: "!testLabel": "c:objc(cs)A(py)IP"
// IP:      "availability": [
// IP-NEXT:   {
// IP-NEXT:     "deprecated": {
// IP-NEXT:       "major": 12,
// IP-NEXT:       "minor": 0,
// IP-NEXT:       "patch": 0
// IP-NEXT:     }
// IP-NEXT:     "domain": "macos"
// IP-NEXT:     "introduced": {
// IP-NEXT:       "major": 9,
// IP-NEXT:       "minor": 0,
// IP-NEXT:       "patch": 0
// IP-NEXT:     }
// IP-NEXT:     "obsoleted": {
// IP-NEXT:       "major": 30,
// IP-NEXT:       "minor": 0,
// IP-NEXT:       "patch": 0
// IP-NEXT:     }
// IP-NEXT:   }
// IP-NEXT: ]

// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix MR
@property int moreRestrictive __attribute__((availability(macos, introduced=10.0, deprecated=11.0, obsoleted=29.0)));
// MR-LABEL: "!testLabel": "c:objc(cs)A(py)moreRestrictive"
// MR:      "availability": [
// MR-NEXT:   {
// MR-NEXT:     "deprecated": {
// MR-NEXT:       "major": 11,
// MR-NEXT:       "minor": 0,
// MR-NEXT:       "patch": 0
// MR-NEXT:     }
// MR-NEXT:     "domain": "macos"
// MR-NEXT:     "introduced": {
// MR-NEXT:       "major": 10,
// MR-NEXT:       "minor": 0,
// MR-NEXT:       "patch": 0
// MR-NEXT:     }
// MR-NEXT:     "obsoleted": {
// MR-NEXT:       "major": 29,
// MR-NEXT:       "minor": 0,
// MR-NEXT:       "patch": 0
// MR-NEXT:     }
// MR-NEXT:   }
// MR-NEXT: ]

@end

// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix B
__attribute__((deprecated("B is deprecated")))
@interface B
// B-LABEL: "!testLabel": "c:objc(cs)B"
// B:      "availability": [
// B-NEXT:   {
// B-NEXT:     "domain": "*"
// B-NEXT:     "isUnconditionallyDeprecated": true
// B-NEXT:   }
// B-NEXT: ]

// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix BIP
@property int BIP;
// BIP-LABEL: "!testLabel": "c:objc(cs)B(py)BIP"
// BIP:      "availability": [
// BIP-NEXT:   {
// BIP-NEXT:     "domain": "*"
// BIP-NEXT:     "isUnconditionallyDeprecated": true
// BIP-NEXT:   }
// BIP-NEXT: ]
@end

// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix C
__attribute__((availability(macos, unavailable)))
@interface C
// C-LABEL: "!testLabel": "c:objc(cs)C"
// C:      "availability": [
// C-NEXT:   {
// C-NEXT:     "domain": "macos"
// C-NEXT:     "isUnconditionallyUnavailable": true
// C-NEXT:   }
// C-NEXT: ]

// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix CIP
@property int CIP;
// CIP-LABEL: "!testLabel": "c:objc(cs)C(py)CIP"
// CIP:      "availability": [
// CIP-NEXT:   {
// CIP-NEXT:     "domain": "macos"
// CIP-NEXT:     "isUnconditionallyUnavailable": true
// CIP-NEXT:   }
// CIP-NEXT: ]
@end

@interface D
// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix DIP
@property int DIP __attribute__((availability(macos, introduced=10.0, deprecated=11.0, obsoleted=29.0)));
// DIP-LABEL: "!testLabel": "c:objc(cs)D(py)DIP"
// DIP:      "availability": [
// DIP-NEXT:   {
// DIP-NEXT:     "deprecated": {
// DIP-NEXT:       "major": 11,
// DIP-NEXT:       "minor": 0,
// DIP-NEXT:       "patch": 0
// DIP-NEXT:     }
// DIP-NEXT:     "domain": "macos"
// DIP-NEXT:     "introduced": {
// DIP-NEXT:       "major": 10,
// DIP-NEXT:       "minor": 0,
// DIP-NEXT:       "patch": 0
// DIP-NEXT:     }
// DIP-NEXT:     "obsoleted": {
// DIP-NEXT:       "major": 29,
// DIP-NEXT:       "minor": 0,
// DIP-NEXT:       "patch": 0
// DIP-NEXT:     }
// DIP-NEXT:   }
// DIP-NEXT: ]
@end

// expected-no-diagnostics