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: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
6 // RUN: %t/known_files_only.hmap.json.in >> %t/known_files_only.hmap.json
7 // RUN: %hmaptool write %t/known_files_only.hmap.json %t/known_files_only.hmap
8 // RUN: %clang -extract-api --product-name=KnownFilesOnlyHmap -target arm64-apple-macosx \
9 // RUN: -I%t/known_files_only.hmap -I%t/subdir %t/subdir/subdir1/input.h \
10 // RUN: %t/subdir/subdir2/known_file.h -o %t/output.json | FileCheck -allow-empty %s
12 // Generator version is not consistent across test runs, normalize it.
13 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
14 // RUN: %t/output.json >> %t/output-normalized.json
15 // RUN: diff %t/reference.output.json %t/output-normalized.json
18 // CHECK-NOT: warning:
19 //--- known_files_only.hmap.json.in
23 "subdir2/known_file.h" : "INPUT_DIR/subdir/subdir3/unknown.h"
27 //--- subdir/subdir1/input.h
29 #include "subdir2/known_file.h"
31 //--- subdir/subdir2/known_file.h
34 //--- subdir/subdir3/unknown.h
35 // Ensure that these symbols are not emitted in the Symbol Graph.
42 struct Foo
{ int a
; };
46 //--- reference.output.json.in
57 "name": "KnownFilesOnlyHmap",
59 "architecture": "arm64",
74 "accessLevel": "public",
75 "declarationFragments": [
77 "kind": "typeIdentifier",
78 "preciseIdentifier": "c:I",
91 "interfaceLanguage": "c",
95 "displayName": "Global Variable",
103 "uri": "file://INPUT_DIR/subdir/subdir1/input.h"
108 "kind": "identifier",
114 "kind": "identifier",
125 "accessLevel": "public",
126 "declarationFragments": [
128 "kind": "typeIdentifier",
129 "preciseIdentifier": "c:I",
137 "kind": "identifier",
138 "spelling": "known_num"
142 "interfaceLanguage": "c",
143 "precise": "c:@known_num"
146 "displayName": "Global Variable",
147 "identifier": "c.var"
154 "uri": "file://INPUT_DIR/subdir/subdir2/known_file.h"
159 "kind": "identifier",
160 "spelling": "known_num"
165 "kind": "identifier",
166 "spelling": "known_num"