Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / ExtractAPI / class_template.cpp
blob25895a6fefe06d6acbb82e1d7f3dba4cbc3e81f5
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 /// expected-no-diagnostics
18 //--- reference.output.json.in
20 "metadata": {
21 "formatVersion": {
22 "major": 0,
23 "minor": 5,
24 "patch": 3
26 "generator": "?"
28 "module": {
29 "name": "",
30 "platform": {
31 "architecture": "arm64",
32 "operatingSystem": {
33 "minimumVersion": {
34 "major": 11,
35 "minor": 0,
36 "patch": 0
38 "name": "macosx"
40 "vendor": "apple"
43 "relationships": [],
44 "symbols": [
46 "accessLevel": "public",
47 "declarationFragments": [
49 "kind": "keyword",
50 "spelling": "template"
53 "kind": "text",
54 "spelling": "<"
57 "kind": "keyword",
58 "spelling": "typename"
61 "kind": "text",
62 "spelling": " "
65 "kind": "genericParameter",
66 "spelling": "T"
69 "kind": "text",
70 "spelling": "> "
73 "kind": "keyword",
74 "spelling": "class"
77 "kind": "text",
78 "spelling": " "
81 "kind": "identifier",
82 "spelling": "Foo"
85 "kind": "text",
86 "spelling": ";"
89 "identifier": {
90 "interfaceLanguage": "c++",
91 "precise": "c:@ST>1#T@Foo"
93 "kind": {
94 "displayName": "Class",
95 "identifier": "c++.class"
97 "location": {
98 "position": {
99 "character": 28,
100 "line": 1
102 "uri": "file://INPUT_DIR/input.h"
104 "names": {
105 "navigator": [
107 "kind": "identifier",
108 "spelling": "Foo"
111 "subHeading": [
113 "kind": "identifier",
114 "spelling": "Foo"
117 "title": "Foo"
119 "pathComponents": [
120 "Foo"
122 "swiftGenerics": {
123 "parameters": [
125 "depth": 0,
126 "index": 0,
127 "name": "T"