[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ExtractAPI / operator_overload.cpp
blob084038e42f59f798c4287bd437c502146745d861
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 int operator+(int x);
17 /// expected-no-diagnostics
19 //--- reference.output.json.in
21 "metadata": {
22 "formatVersion": {
23 "major": 0,
24 "minor": 5,
25 "patch": 3
27 "generator": "?"
29 "module": {
30 "name": "",
31 "platform": {
32 "architecture": "arm64",
33 "operatingSystem": {
34 "minimumVersion": {
35 "major": 11,
36 "minor": 0,
37 "patch": 0
39 "name": "macosx"
41 "vendor": "apple"
44 "relationships": [
46 "kind": "memberOf",
47 "source": "c:@S@Foo@F@operator+#I#",
48 "target": "c:@S@Foo",
49 "targetFallback": "Foo"
52 "symbols": [
54 "accessLevel": "public",
55 "declarationFragments": [
57 "kind": "keyword",
58 "spelling": "class"
61 "kind": "text",
62 "spelling": " "
65 "kind": "identifier",
66 "spelling": "Foo"
69 "kind": "text",
70 "spelling": ";"
73 "identifier": {
74 "interfaceLanguage": "c++",
75 "precise": "c:@S@Foo"
77 "kind": {
78 "displayName": "Class",
79 "identifier": "c++.class"
81 "location": {
82 "position": {
83 "character": 7,
84 "line": 1
86 "uri": "file://INPUT_DIR/input.h"
88 "names": {
89 "navigator": [
91 "kind": "identifier",
92 "spelling": "Foo"
95 "subHeading": [
97 "kind": "identifier",
98 "spelling": "Foo"
101 "title": "Foo"
103 "pathComponents": [
104 "Foo"
108 "accessLevel": "private",
109 "declarationFragments": [
111 "kind": "typeIdentifier",
112 "preciseIdentifier": "c:I",
113 "spelling": "int"
116 "kind": "text",
117 "spelling": " "
120 "kind": "identifier",
121 "spelling": "operator+"
124 "kind": "text",
125 "spelling": "("
128 "kind": "typeIdentifier",
129 "preciseIdentifier": "c:I",
130 "spelling": "int"
133 "kind": "text",
134 "spelling": " "
137 "kind": "internalParam",
138 "spelling": "x"
141 "kind": "text",
142 "spelling": ");"
145 "functionSignature": {
146 "parameters": [
148 "declarationFragments": [
150 "kind": "typeIdentifier",
151 "preciseIdentifier": "c:I",
152 "spelling": "int"
155 "kind": "text",
156 "spelling": " "
159 "kind": "internalParam",
160 "spelling": "x"
163 "name": "x"
166 "returns": [
168 "kind": "typeIdentifier",
169 "preciseIdentifier": "c:I",
170 "spelling": "int"
174 "identifier": {
175 "interfaceLanguage": "c++",
176 "precise": "c:@S@Foo@F@operator+#I#"
178 "kind": {
179 "displayName": "Instance Method",
180 "identifier": "c++.method"
182 "location": {
183 "position": {
184 "character": 7,
185 "line": 2
187 "uri": "file://INPUT_DIR/input.h"
189 "names": {
190 "navigator": [
192 "kind": "identifier",
193 "spelling": "operator+"
196 "subHeading": [
198 "kind": "identifier",
199 "spelling": "operator+"
202 "title": "operator+"
204 "pathComponents": [
205 "Foo",
206 "operator+"