[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ExtractAPI / constructor_destructor.cpp
blob65a924b53d69cbfb2e19fbf6c168a4c6308408fe
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_cc1 -extract-api -triple arm64-apple-macosx \
6 // RUN: -x c++-header %t/input.h -o %t/output.json -verify
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 //--- input.h
14 class Foo {
15 Foo();
16 ~Foo();
18 /// expected-no-diagnostics
20 //--- reference.output.json.in
22 "metadata": {
23 "formatVersion": {
24 "major": 0,
25 "minor": 5,
26 "patch": 3
28 "generator": "?"
30 "module": {
31 "name": "",
32 "platform": {
33 "architecture": "arm64",
34 "operatingSystem": {
35 "minimumVersion": {
36 "major": 11,
37 "minor": 0,
38 "patch": 0
40 "name": "macosx"
42 "vendor": "apple"
45 "relationships": [
47 "kind": "memberOf",
48 "source": "c:@S@Foo@F@Foo#",
49 "target": "c:@S@Foo",
50 "targetFallback": "Foo"
53 "kind": "memberOf",
54 "source": "c:@S@Foo@F@~Foo#",
55 "target": "c:@S@Foo",
56 "targetFallback": "Foo"
59 "symbols": [
61 "accessLevel": "public",
62 "declarationFragments": [
64 "kind": "keyword",
65 "spelling": "class"
68 "kind": "text",
69 "spelling": " "
72 "kind": "identifier",
73 "spelling": "Foo"
76 "kind": "text",
77 "spelling": ";"
80 "identifier": {
81 "interfaceLanguage": "c++",
82 "precise": "c:@S@Foo"
84 "kind": {
85 "displayName": "Class",
86 "identifier": "c++.class"
88 "location": {
89 "position": {
90 "character": 7,
91 "line": 1
93 "uri": "file://INPUT_DIR/input.h"
95 "names": {
96 "navigator": [
98 "kind": "identifier",
99 "spelling": "Foo"
102 "subHeading": [
104 "kind": "identifier",
105 "spelling": "Foo"
108 "title": "Foo"
110 "pathComponents": [
111 "Foo"
115 "accessLevel": "private",
116 "declarationFragments": [
118 "kind": "identifier",
119 "spelling": "Foo"
122 "kind": "text",
123 "spelling": "();"
126 "functionSignature": {
127 "returns": [
129 "kind": "typeIdentifier",
130 "preciseIdentifier": "c:v",
131 "spelling": "void"
135 "identifier": {
136 "interfaceLanguage": "c++",
137 "precise": "c:@S@Foo@F@Foo#"
139 "kind": {
140 "displayName": "Instance Method",
141 "identifier": "c++.method"
143 "location": {
144 "position": {
145 "character": 3,
146 "line": 2
148 "uri": "file://INPUT_DIR/input.h"
150 "names": {
151 "navigator": [
153 "kind": "identifier",
154 "spelling": "Foo"
157 "subHeading": [
159 "kind": "identifier",
160 "spelling": "Foo"
163 "title": "Foo"
165 "pathComponents": [
166 "Foo",
167 "Foo"
171 "accessLevel": "private",
172 "declarationFragments": [
174 "kind": "identifier",
175 "spelling": "~Foo"
178 "kind": "text",
179 "spelling": "();"
182 "functionSignature": {
183 "returns": [
185 "kind": "typeIdentifier",
186 "preciseIdentifier": "c:v",
187 "spelling": "void"
191 "identifier": {
192 "interfaceLanguage": "c++",
193 "precise": "c:@S@Foo@F@~Foo#"
195 "kind": {
196 "displayName": "Instance Method",
197 "identifier": "c++.method"
199 "location": {
200 "position": {
201 "character": 3,
202 "line": 3
204 "uri": "file://INPUT_DIR/input.h"
206 "names": {
207 "navigator": [
209 "kind": "identifier",
210 "spelling": "~Foo"
213 "subHeading": [
215 "kind": "identifier",
216 "spelling": "Foo"
219 "title": "~Foo"
221 "pathComponents": [
222 "Foo",
223 "~Foo"