aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/codesearch/testdata/source0.c
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-01-26 17:56:07 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-01-26 18:02:51 +0000
commit28819515a548ec25957603ae1fac0620c3eaa9a0 (patch)
treeba12494a0daf650d2d03ae77873a6c54e62ac444 /pkg/codesearch/testdata/source0.c
parentfa7953d4ea9f5b7e5147ff086ac5a67bc2d2675b (diff)
pkg/codesearch: support finding field reads/writes
Diffstat (limited to 'pkg/codesearch/testdata/source0.c')
-rw-r--r--pkg/codesearch/testdata/source0.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/codesearch/testdata/source0.c b/pkg/codesearch/testdata/source0.c
index e5b47841b..9482908c9 100644
--- a/pkg/codesearch/testdata/source0.c
+++ b/pkg/codesearch/testdata/source0.c
@@ -35,3 +35,12 @@ int func_accepting_a_struct(struct some_struct* p)
void function_with_quotes_in_type(void __attribute__((btf_type_tag("user"))) *)
{
}
+
+int field_refs(struct some_struct* p, union some_union* u)
+{
+ p->x = p->y;
+ *(&p->x) = 1;
+ u->p = 0;
+ u->s.x = 2;
+ return p->x;
+}