[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ExtractAPI / namespace.cpp
blob2346093db7d5fd542ac2018db6f4c1c720e96de2
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 -std=c++20 -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 namespace Foo {
15 class Bar { };
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:@N@Foo@S@Bar",
49 "target": "c:@N@Foo",
50 "targetFallback": "Foo"
53 "symbols": [
55 "accessLevel": "public",
56 "declarationFragments": [
58 "kind": "keyword",
59 "spelling": "namespace"
62 "kind": "text",
63 "spelling": " "
66 "kind": "identifier",
67 "spelling": "Foo"
70 "kind": "text",
71 "spelling": ";"
74 "identifier": {
75 "interfaceLanguage": "c++",
76 "precise": "c:@N@Foo"
78 "kind": {
79 "displayName": "Namespace",
80 "identifier": "c++.namespace"
82 "location": {
83 "position": {
84 "character": 11,
85 "line": 1
87 "uri": "file://INPUT_DIR/input.h"
89 "names": {
90 "navigator": [
92 "kind": "identifier",
93 "spelling": "Foo"
96 "subHeading": [
98 "kind": "identifier",
99 "spelling": "Foo"
102 "title": "Foo"
104 "pathComponents": [
105 "Foo"
109 "accessLevel": "public",
110 "declarationFragments": [
112 "kind": "keyword",
113 "spelling": "class"
116 "kind": "text",
117 "spelling": " "
120 "kind": "identifier",
121 "spelling": "Bar"
124 "kind": "text",
125 "spelling": ";"
128 "identifier": {
129 "interfaceLanguage": "c++",
130 "precise": "c:@N@Foo@S@Bar"
132 "kind": {
133 "displayName": "Class",
134 "identifier": "c++.class"
136 "location": {
137 "position": {
138 "character": 9,
139 "line": 2
141 "uri": "file://INPUT_DIR/input.h"
143 "names": {
144 "navigator": [
146 "kind": "identifier",
147 "spelling": "Bar"
150 "subHeading": [
152 "kind": "identifier",
153 "spelling": "Bar"
156 "title": "Bar"
158 "pathComponents": [
159 "Foo",
160 "Bar"