|
4 | 4 | // RUN: %t/c.reference.output.json.in >> %t/c.reference.output.json
|
5 | 5 | // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
|
6 | 6 | // RUN: %t/objc.reference.output.json.in >> %t/objc.reference.output.json
|
| 7 | +// RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \ |
| 8 | +// RUN: %t/objcpp.reference.output.json.in >> %t/objcpp.reference.output.json |
7 | 9 |
|
8 |
| -// RUN: %clang -extract-api -x c-header -target arm64-apple-macosx \ |
| 10 | +// RUN: %clang_cc1 -extract-api -x c-header -triple arm64-apple-macosx \ |
9 | 11 | // RUN: %t/c.h -o %t/c.output.json | FileCheck -allow-empty %s
|
10 |
| -// RUN: %clang -extract-api -x objective-c-header -target arm64-apple-macosx \ |
| 12 | +// RUN: %clang_cc1 -extract-api -x objective-c-header -triple arm64-apple-macosx \ |
11 | 13 | // RUN: %t/objc.h -o %t/objc.output.json | FileCheck -allow-empty %s
|
| 14 | +// RUN: %clang_cc1 -extract-api -x objective-c++-header -triple arm64-apple-macosx \ |
| 15 | +// RUN: %t/objcpp.h -o %t/objcpp.output.json | FileCheck -allow-empty %s |
12 | 16 |
|
13 | 17 | // Generator version is not consistent across test runs, normalize it.
|
14 | 18 | // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
|
15 | 19 | // RUN: %t/c.output.json >> %t/c.output-normalized.json
|
16 | 20 | // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
|
17 | 21 | // RUN: %t/objc.output.json >> %t/objc.output-normalized.json
|
| 22 | +// RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \ |
| 23 | +// RUN: %t/objcpp.output.json >> %t/objcpp.output-normalized.json |
18 | 24 |
|
19 | 25 | // RUN: diff %t/c.reference.output.json %t/c.output-normalized.json
|
20 | 26 | // RUN: diff %t/objc.reference.output.json %t/objc.output-normalized.json
|
| 27 | +// RUN: diff %t/objcpp.reference.output.json %t/objcpp.output-normalized.json |
21 | 28 |
|
22 | 29 | // CHECK-NOT: error:
|
23 | 30 | // CHECK-NOT: warning:
|
24 | 31 |
|
25 | 32 | //--- c.h
|
26 | 33 | char c;
|
| 34 | +///expected-no-diagnostics |
27 | 35 |
|
28 | 36 | //--- objc.h
|
29 | 37 | char objc;
|
| 38 | +///expected-no-diagnostics |
| 39 | + |
| 40 | +//--- objcpp.h |
| 41 | +char objcpp; |
| 42 | +///expected-no-diagnostics |
30 | 43 |
|
31 | 44 | //--- c.reference.output.json.in
|
32 | 45 | {
|
@@ -196,3 +209,87 @@ char objc;
|
196 | 209 | }
|
197 | 210 | ]
|
198 | 211 | }
|
| 212 | +//--- objcpp.reference.output.json.in |
| 213 | +{ |
| 214 | + "metadata": { |
| 215 | + "formatVersion": { |
| 216 | + "major": 0, |
| 217 | + "minor": 5, |
| 218 | + "patch": 3 |
| 219 | + }, |
| 220 | + "generator": "?" |
| 221 | + }, |
| 222 | + "module": { |
| 223 | + "name": "", |
| 224 | + "platform": { |
| 225 | + "architecture": "arm64", |
| 226 | + "operatingSystem": { |
| 227 | + "minimumVersion": { |
| 228 | + "major": 11, |
| 229 | + "minor": 0, |
| 230 | + "patch": 0 |
| 231 | + }, |
| 232 | + "name": "macosx" |
| 233 | + }, |
| 234 | + "vendor": "apple" |
| 235 | + } |
| 236 | + }, |
| 237 | + "relationships": [], |
| 238 | + "symbols": [ |
| 239 | + { |
| 240 | + "accessLevel": "public", |
| 241 | + "declarationFragments": [ |
| 242 | + { |
| 243 | + "kind": "typeIdentifier", |
| 244 | + "preciseIdentifier": "c:C", |
| 245 | + "spelling": "char" |
| 246 | + }, |
| 247 | + { |
| 248 | + "kind": "text", |
| 249 | + "spelling": " " |
| 250 | + }, |
| 251 | + { |
| 252 | + "kind": "identifier", |
| 253 | + "spelling": "objcpp" |
| 254 | + }, |
| 255 | + { |
| 256 | + "kind": "text", |
| 257 | + "spelling": ";" |
| 258 | + } |
| 259 | + ], |
| 260 | + "identifier": { |
| 261 | + "interfaceLanguage": "objective-c++", |
| 262 | + "precise": "c:@objcpp" |
| 263 | + }, |
| 264 | + "kind": { |
| 265 | + "displayName": "Global Variable", |
| 266 | + "identifier": "objective-c++.var" |
| 267 | + }, |
| 268 | + "location": { |
| 269 | + "position": { |
| 270 | + "character": 5, |
| 271 | + "line": 0 |
| 272 | + }, |
| 273 | + "uri": "file://INPUT_DIR/objcpp.h" |
| 274 | + }, |
| 275 | + "names": { |
| 276 | + "navigator": [ |
| 277 | + { |
| 278 | + "kind": "identifier", |
| 279 | + "spelling": "objcpp" |
| 280 | + } |
| 281 | + ], |
| 282 | + "subHeading": [ |
| 283 | + { |
| 284 | + "kind": "identifier", |
| 285 | + "spelling": "objcpp" |
| 286 | + } |
| 287 | + ], |
| 288 | + "title": "objcpp" |
| 289 | + }, |
| 290 | + "pathComponents": [ |
| 291 | + "objcpp" |
| 292 | + ] |
| 293 | + } |
| 294 | + ] |
| 295 | +} |
0 commit comments