support referencing other variables inside binops

This commit is contained in:
2025-09-12 23:05:52 +05:30
parent a09e4e1bb6
commit ca203a1fdd
6 changed files with 61 additions and 47 deletions

View File

@ -1,5 +1,5 @@
BPF_CLANG := clang
CFLAGS := -O2 -emit-llvm -target bpf -c
CFLAGS := -O0 -emit-llvm -target bpf -c
SRC := $(wildcard *.bpf.c)
LL := $(SRC:.bpf.c=.bpf.ll)

View File

@ -13,6 +13,9 @@ struct {
SEC("tracepoint/syscalls/sys_enter_execve")
int hello(struct pt_regs *ctx) {
bpf_printk("Hello, World!\n");
u64 b;
u64 a = 3 * b;
bpf_printk("%d", a);
return 0;
}