aboutsummaryrefslogtreecommitdiff
path: root/clang/test/ExtractAPI/known_files_only.c
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@gmail.com>2024-04-03 17:22:45 -0700
committerGitHub <noreply@github.com>2024-04-03 17:22:45 -0700
commit28fa873d3642324ba64f1624a8ae0cc34c582489 (patch)
tree3c2c6c57cc31ac50e3cf89f706ddb3d0956b63f4 /clang/test/ExtractAPI/known_files_only.c
parent7e2a1d6f23cb604203324b47237f8e463704a497 (diff)
downloadllvm-28fa873d3642324ba64f1624a8ae0cc34c582489.zip
llvm-28fa873d3642324ba64f1624a8ae0cc34c582489.tar.gz
llvm-28fa873d3642324ba64f1624a8ae0cc34c582489.tar.bz2
Revert "Reenable external categories (#87357)"revert-87357-reenable-external-categories
This reverts commit e05c1b46d0d3739cc48ad912dbe6e9affce05927.
Diffstat (limited to 'clang/test/ExtractAPI/known_files_only.c')
-rw-r--r--clang/test/ExtractAPI/known_files_only.c101
1 files changed, 96 insertions, 5 deletions
diff --git a/clang/test/ExtractAPI/known_files_only.c b/clang/test/ExtractAPI/known_files_only.c
index de1e786..68881aa 100644
--- a/clang/test/ExtractAPI/known_files_only.c
+++ b/clang/test/ExtractAPI/known_files_only.c
@@ -1,7 +1,17 @@
// RUN: rm -rf %t
// RUN: split-file %s %t
-// RUN: %clang_cc1 -extract-api --pretty-sgf --product-name=GlobalRecord -triple arm64-apple-macosx \
-// RUN: %t/input1.h -verify -o - | FileCheck %s
+// RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
+// RUN: %t/reference.output.json.in >> %t/reference.output.json
+// RUN: %clang -extract-api --product-name=GlobalRecord -target arm64-apple-macosx \
+// RUN: %t/input1.h -o %t/output.json | FileCheck -allow-empty %s
+
+// Generator version is not consistent across test runs, normalize it.
+// RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
+// RUN: %t/output.json >> %t/output-normalized.json
+// RUN: diff %t/reference.output.json %t/output-normalized.json
+
+// CHECK-NOT: error:
+// CHECK-NOT: warning:
//--- input1.h
int num;
@@ -14,6 +24,87 @@ char not_emitted;
void foo(int);
struct Foo { int a; };
-// CHECK-NOT: input2.h
-
-// expected-no-diagnostics
+//--- reference.output.json.in
+{
+ "metadata": {
+ "formatVersion": {
+ "major": 0,
+ "minor": 5,
+ "patch": 3
+ },
+ "generator": "?"
+ },
+ "module": {
+ "name": "GlobalRecord",
+ "platform": {
+ "architecture": "arm64",
+ "operatingSystem": {
+ "minimumVersion": {
+ "major": 11,
+ "minor": 0,
+ "patch": 0
+ },
+ "name": "macosx"
+ },
+ "vendor": "apple"
+ }
+ },
+ "relationships": [],
+ "symbols": [
+ {
+ "accessLevel": "public",
+ "declarationFragments": [
+ {
+ "kind": "typeIdentifier",
+ "preciseIdentifier": "c:I",
+ "spelling": "int"
+ },
+ {
+ "kind": "text",
+ "spelling": " "
+ },
+ {
+ "kind": "identifier",
+ "spelling": "num"
+ },
+ {
+ "kind": "text",
+ "spelling": ";"
+ }
+ ],
+ "identifier": {
+ "interfaceLanguage": "c",
+ "precise": "c:@num"
+ },
+ "kind": {
+ "displayName": "Global Variable",
+ "identifier": "c.var"
+ },
+ "location": {
+ "position": {
+ "character": 4,
+ "line": 0
+ },
+ "uri": "file://INPUT_DIR/input1.h"
+ },
+ "names": {
+ "navigator": [
+ {
+ "kind": "identifier",
+ "spelling": "num"
+ }
+ ],
+ "subHeading": [
+ {
+ "kind": "identifier",
+ "spelling": "num"
+ }
+ ],
+ "title": "num"
+ },
+ "pathComponents": [
+ "num"
+ ]
+ }
+ ]
+}