diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-26 17:56:07 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-26 18:02:51 +0000 |
| commit | 28819515a548ec25957603ae1fac0620c3eaa9a0 (patch) | |
| tree | ba12494a0daf650d2d03ae77873a6c54e62ac444 /pkg/codesearch/testdata/source0.c.json | |
| parent | fa7953d4ea9f5b7e5147ff086ac5a67bc2d2675b (diff) | |
pkg/codesearch: support finding field reads/writes
Diffstat (limited to 'pkg/codesearch/testdata/source0.c.json')
| -rw-r--r-- | pkg/codesearch/testdata/source0.c.json | 89 |
1 files changed, 84 insertions, 5 deletions
diff --git a/pkg/codesearch/testdata/source0.c.json b/pkg/codesearch/testdata/source0.c.json index 5d347ae1b..451ab58cc 100644 --- a/pkg/codesearch/testdata/source0.c.json +++ b/pkg/codesearch/testdata/source0.c.json @@ -12,6 +12,73 @@ "comment": {} }, { + "name": "field_refs", + "type": "int (struct some_struct *, union some_union *)", + "kind": "function", + "body": { + "file": "source0.c", + "start_line": 39, + "end_line": 46 + }, + "comment": {}, + "refs": [ + { + "name": "some_struct", + "kind": "uses", + "entity_kind": "struct", + "line": 39 + }, + { + "name": "some_union", + "kind": "uses", + "entity_kind": "union", + "line": 39 + }, + { + "name": "some_struct::x", + "kind": "writes", + "entity_kind": "field", + "line": 41 + }, + { + "name": "some_struct::y", + "kind": "reads", + "entity_kind": "field", + "line": 41 + }, + { + "name": "some_struct::x", + "kind": "takes-address-of", + "entity_kind": "field", + "line": 42 + }, + { + "name": "some_union::p", + "kind": "writes", + "entity_kind": "field", + "line": 43 + }, + { + "name": "some_struct::x", + "kind": "writes", + "entity_kind": "field", + "line": 44 + }, + { + "name": "some_union::s", + "kind": "reads", + "entity_kind": "field", + "line": 44 + }, + { + "name": "some_struct::x", + "kind": "reads", + "entity_kind": "field", + "line": 45 + } + ] + }, + { "name": "func_accepting_a_struct", "type": "int (struct some_struct *)", "kind": "function", @@ -29,6 +96,12 @@ "line": 29 }, { + "name": "some_struct::x", + "kind": "reads", + "entity_kind": "field", + "line": 31 + }, + { "name": "some_struct_t", "kind": "uses", "entity_kind": "typedef", @@ -41,6 +114,12 @@ "line": 31 }, { + "name": "some_union::x", + "kind": "reads", + "entity_kind": "field", + "line": 32 + }, + { "name": "some_union", "kind": "uses", "entity_kind": "union", @@ -155,7 +234,7 @@ "body": { "file": "source0.h", "start_line": 40, - "end_line": 43 + "end_line": 44 }, "comment": {} }, @@ -164,8 +243,8 @@ "kind": "enum", "body": { "file": "source0.h", - "start_line": 45, - "end_line": 48 + "start_line": 46, + "end_line": 49 }, "comment": {} }, @@ -184,8 +263,8 @@ "kind": "typedef", "body": { "file": "source0.h", - "start_line": 50, - "end_line": 50 + "start_line": 51, + "end_line": 51 }, "comment": {} }, |
