Skip to content

Commit 7ae84a0

Browse files
add failing test
1 parent df3f002 commit 7ae84a0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import logging
2+
3+
from pythonbpf import compile, bpf, section, bpfglobal, compile_to_ir
4+
from ctypes import c_void_p, c_int64
5+
6+
# This should not pass as somevalue is not declared at all.
7+
@bpf
8+
@section("tracepoint/syscalls/sys_enter_execve")
9+
def sometag(ctx: c_void_p) -> c_int64:
10+
print("test")
11+
print(f"{somevalue}")
12+
return c_int64(1)
13+
14+
@bpf
15+
@bpfglobal
16+
def LICENSE() -> str:
17+
return "GPL"
18+
19+
20+
compile_to_ir("globals.py", "globals.ll", loglevel=logging.INFO)
21+
compile()

0 commit comments

Comments
 (0)