[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / ExtractAPI / known_files_only.c
blobddb6e577823a851157b19a58f9a07f93b9848578
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
4 // RUN: %t/reference.output.json.in >> %t/reference.output.json
5 // RUN: %clang -extract-api --product-name=GlobalRecord -target arm64-apple-macosx \
6 // RUN: %t/input1.h -o %t/output.json | FileCheck -allow-empty %s
8 // Generator version is not consistent across test runs, normalize it.
9 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
10 // RUN: %t/output.json >> %t/output-normalized.json
11 // RUN: diff %t/reference.output.json %t/output-normalized.json
13 // CHECK-NOT: error:
14 // CHECK-NOT: warning:
16 //--- input1.h
17 int num;
18 #include "input2.h"
20 //--- input2.h
21 // Ensure that these symbols are not emitted in the Symbol Graph.
22 #define HELLO 1
23 char not_emitted;
24 void foo(int);
25 struct Foo { int a; };
27 //--- reference.output.json.in
29 "metadata": {
30 "formatVersion": {
31 "major": 0,
32 "minor": 5,
33 "patch": 3
35 "generator": "?"
37 "module": {
38 "name": "GlobalRecord",
39 "platform": {
40 "architecture": "arm64",
41 "operatingSystem": {
42 "minimumVersion": {
43 "major": 11,
44 "minor": 0,
45 "patch": 0
47 "name": "macosx"
49 "vendor": "apple"
52 "relationships": [],
53 "symbols": [
55 "accessLevel": "public",
56 "declarationFragments": [
58 "kind": "typeIdentifier",
59 "preciseIdentifier": "c:I",
60 "spelling": "int"
63 "kind": "text",
64 "spelling": " "
67 "kind": "identifier",
68 "spelling": "num"
71 "identifier": {
72 "interfaceLanguage": "c",
73 "precise": "c:@num"
75 "kind": {
76 "displayName": "Global Variable",
77 "identifier": "c.var"
79 "location": {
80 "position": {
81 "character": 5,
82 "line": 1
84 "uri": "file://INPUT_DIR/input1.h"
86 "names": {
87 "navigator": [
89 "kind": "identifier",
90 "spelling": "num"
93 "subHeading": [
95 "kind": "identifier",
96 "spelling": "num"
99 "title": "num"
101 "pathComponents": [
102 "num"