Skip to content

Commit 9e1142b

Browse files
committed
Add type_mismatch failing test for conditionals
1 parent 1843ca6 commit 9e1142b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from pythonbpf import bpf, section, bpfglobal, compile
2+
from ctypes import c_void_p, c_int64, c_int32
3+
4+
5+
@bpf
6+
@section("tracepoint/syscalls/sys_enter_execve")
7+
def hello_world(ctx: c_void_p) -> c_int64:
8+
x = 0
9+
y = c_int32(0)
10+
if x == y:
11+
print("Hello, World!")
12+
else:
13+
print("Goodbye, World!")
14+
return
15+
16+
17+
@bpf
18+
@bpfglobal
19+
def LICENSE() -> str:
20+
return "GPL"
21+
22+
23+
compile()

0 commit comments

Comments
 (0)