From 682a7e6566066d930ba095850d808447c374cdf4 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Tue, 7 Oct 2025 03:15:34 +0530 Subject: [PATCH] Add const_int test for conditionals --- tests/passing_tests/conditionals/const_int.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/passing_tests/conditionals/const_int.py diff --git a/tests/passing_tests/conditionals/const_int.py b/tests/passing_tests/conditionals/const_int.py new file mode 100644 index 0000000..47589c8 --- /dev/null +++ b/tests/passing_tests/conditionals/const_int.py @@ -0,0 +1,21 @@ +from pythonbpf import bpf, section, bpfglobal, compile +from ctypes import c_void_p, c_int64 + + +@bpf +@section("tracepoint/syscalls/sys_enter_execve") +def hello_world(ctx: c_void_p) -> c_int64: + if 0: + print("Hello, World!") + else: + print("Goodbye, World!") + return + + +@bpf +@bpfglobal +def LICENSE() -> str: + return "GPL" + + +compile()