From 9e1142bf053629738c7d0c10e191f138b0c7a246 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Tue, 7 Oct 2025 14:02:09 +0530 Subject: [PATCH] Add type_mismatch failing test for conditionals --- .../conditionals/type_mismatch.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/failing_tests/conditionals/type_mismatch.py diff --git a/tests/failing_tests/conditionals/type_mismatch.py b/tests/failing_tests/conditionals/type_mismatch.py new file mode 100644 index 0000000..1efc5e2 --- /dev/null +++ b/tests/failing_tests/conditionals/type_mismatch.py @@ -0,0 +1,23 @@ +from pythonbpf import bpf, section, bpfglobal, compile +from ctypes import c_void_p, c_int64, c_int32 + + +@bpf +@section("tracepoint/syscalls/sys_enter_execve") +def hello_world(ctx: c_void_p) -> c_int64: + x = 0 + y = c_int32(0) + if x == y: + print("Hello, World!") + else: + print("Goodbye, World!") + return + + +@bpf +@bpfglobal +def LICENSE() -> str: + return "GPL" + + +compile()