Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / ExtractAPI / class_template_spec.cpp
blob166b03911db7dc352372e79aa805147ec47f20de
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 template<typename T> class Foo {};
16 template<> class Foo<int> {};
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": [],
46 "symbols": [
48 "accessLevel": "public",
49 "declarationFragments": [
51 "kind": "keyword",
52 "spelling": "template"
55 "kind": "text",
56 "spelling": "<"
59 "kind": "keyword",
60 "spelling": "typename"
63 "kind": "text",
64 "spelling": " "
67 "kind": "genericParameter",
68 "spelling": "T"
71 "kind": "text",
72 "spelling": "> "
75 "kind": "keyword",
76 "spelling": "class"
79 "kind": "text",
80 "spelling": " "
83 "kind": "identifier",
84 "spelling": "Foo"
87 "kind": "text",
88 "spelling": ";"
91 "identifier": {
92 "interfaceLanguage": "c++",
93 "precise": "c:@ST>1#T@Foo"
95 "kind": {
96 "displayName": "Class",
97 "identifier": "c++.class"
99 "location": {
100 "position": {
101 "character": 28,
102 "line": 1
104 "uri": "file://INPUT_DIR/input.h"
106 "names": {
107 "navigator": [
109 "kind": "identifier",
110 "spelling": "Foo"
113 "subHeading": [
115 "kind": "identifier",
116 "spelling": "Foo"
119 "title": "Foo"
121 "pathComponents": [
122 "Foo"
124 "swiftGenerics": {
125 "parameters": [
127 "depth": 0,
128 "index": 0,
129 "name": "T"
135 "accessLevel": "public",
136 "declarationFragments": [
138 "kind": "keyword",
139 "spelling": "template"
142 "kind": "text",
143 "spelling": "<> "
146 "kind": "keyword",
147 "spelling": "class"
150 "kind": "text",
151 "spelling": " "
154 "kind": "identifier",
155 "spelling": "Foo"
158 "kind": "text",
159 "spelling": "<"
162 "kind": "typeIdentifier",
163 "preciseIdentifier": "c:I",
164 "spelling": "int"
167 "kind": "text",
168 "spelling": ">;"
171 "identifier": {
172 "interfaceLanguage": "c++",
173 "precise": "c:@S@Foo>#I"
175 "kind": {
176 "displayName": "Class",
177 "identifier": "c++.class"
179 "location": {
180 "position": {
181 "character": 18,
182 "line": 3
184 "uri": "file://INPUT_DIR/input.h"
186 "names": {
187 "navigator": [
189 "kind": "identifier",
190 "spelling": "Foo"
193 "subHeading": [
195 "kind": "identifier",
196 "spelling": "Foo"
199 "title": "Foo"
201 "pathComponents": [
202 "Foo"