[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / ExtractAPI / language.c
blobb9f69b272a44c3c4a4daf21821d245a2aa888cdb
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/c.reference.output.json.in >> %t/c.reference.output.json
5 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
6 // RUN: %t/objc.reference.output.json.in >> %t/objc.reference.output.json
8 // RUN: %clang -extract-api -x c-header -target arm64-apple-macosx \
9 // 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 \
11 // RUN: %t/objc.h -o %t/objc.output.json | FileCheck -allow-empty %s
13 // Generator version is not consistent across test runs, normalize it.
14 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
15 // RUN: %t/c.output.json >> %t/c.output-normalized.json
16 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
17 // RUN: %t/objc.output.json >> %t/objc.output-normalized.json
19 // RUN: diff %t/c.reference.output.json %t/c.output-normalized.json
20 // RUN: diff %t/objc.reference.output.json %t/objc.output-normalized.json
22 // CHECK-NOT: error:
23 // CHECK-NOT: warning:
25 //--- c.h
26 char c;
28 //--- objc.h
29 char objc;
31 //--- c.reference.output.json.in
33 "metadata": {
34 "formatVersion": {
35 "major": 0,
36 "minor": 5,
37 "patch": 3
39 "generator": "?"
41 "module": {
42 "name": "",
43 "platform": {
44 "architecture": "arm64",
45 "operatingSystem": {
46 "minimumVersion": {
47 "major": 11,
48 "minor": 0,
49 "patch": 0
51 "name": "macosx"
53 "vendor": "apple"
56 "relationships": [],
57 "symbols": [
59 "accessLevel": "public",
60 "declarationFragments": [
62 "kind": "typeIdentifier",
63 "preciseIdentifier": "c:C",
64 "spelling": "char"
67 "kind": "text",
68 "spelling": " "
71 "kind": "identifier",
72 "spelling": "c"
75 "identifier": {
76 "interfaceLanguage": "c",
77 "precise": "c:@c"
79 "kind": {
80 "displayName": "Global Variable",
81 "identifier": "c.var"
83 "location": {
84 "position": {
85 "character": 6,
86 "line": 1
88 "uri": "file://INPUT_DIR/c.h"
90 "names": {
91 "navigator": [
93 "kind": "identifier",
94 "spelling": "c"
97 "subHeading": [
99 "kind": "identifier",
100 "spelling": "c"
103 "title": "c"
105 "pathComponents": [
111 //--- objc.reference.output.json.in
113 "metadata": {
114 "formatVersion": {
115 "major": 0,
116 "minor": 5,
117 "patch": 3
119 "generator": "?"
121 "module": {
122 "name": "",
123 "platform": {
124 "architecture": "arm64",
125 "operatingSystem": {
126 "minimumVersion": {
127 "major": 11,
128 "minor": 0,
129 "patch": 0
131 "name": "macosx"
133 "vendor": "apple"
136 "relationships": [],
137 "symbols": [
139 "accessLevel": "public",
140 "declarationFragments": [
142 "kind": "typeIdentifier",
143 "preciseIdentifier": "c:C",
144 "spelling": "char"
147 "kind": "text",
148 "spelling": " "
151 "kind": "identifier",
152 "spelling": "objc"
155 "identifier": {
156 "interfaceLanguage": "objective-c",
157 "precise": "c:@objc"
159 "kind": {
160 "displayName": "Global Variable",
161 "identifier": "objective-c.var"
163 "location": {
164 "position": {
165 "character": 6,
166 "line": 1
168 "uri": "file://INPUT_DIR/objc.h"
170 "names": {
171 "navigator": [
173 "kind": "identifier",
174 "spelling": "objc"
177 "subHeading": [
179 "kind": "identifier",
180 "spelling": "objc"
183 "title": "objc"
185 "pathComponents": [
186 "objc"