From a049796b81cdd58d6f4420541443d595b86adde4 Mon Sep 17 00:00:00 2001 From: varun-r-mallya Date: Sun, 5 Oct 2025 00:55:22 +0530 Subject: [PATCH] add failing test --- tests/failing_tests/undeclared_values.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/failing_tests/undeclared_values.py diff --git a/tests/failing_tests/undeclared_values.py b/tests/failing_tests/undeclared_values.py new file mode 100644 index 0000000..1cd0d59 --- /dev/null +++ b/tests/failing_tests/undeclared_values.py @@ -0,0 +1,21 @@ +import logging + +from pythonbpf import compile, bpf, section, bpfglobal, compile_to_ir +from ctypes import c_void_p, c_int64 + +# This should not pass as somevalue is not declared at all. +@bpf +@section("tracepoint/syscalls/sys_enter_execve") +def sometag(ctx: c_void_p) -> c_int64: + print("test") + print(f"{somevalue}") + return c_int64(1) + +@bpf +@bpfglobal +def LICENSE() -> str: + return "GPL" + + +compile_to_ir("globals.py", "globals.ll", loglevel=logging.INFO) +compile()