Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify that bpf2bpf updates r10 #245

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/call_local.data
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,27 @@ mov %r6, 6
mov %r7, 7
mov %r8, 8
mov %r9, 9
# Write to the stack to make sure it's preserved.
stdw [%r10-8], 0x44332211
stdw [%r10-16], 0x88776655
call local func1
# %r0 contains the return value
# %r0 should contain 1 + 2 + 3 + 4 + 5
# Write to the stack to make sure it's preserved.
jne %r0, 15, failed
# %r6 through %r9 should be preserved
jne %r6, 6, failed
jne %r7, 7, failed
jne %r8, 8, failed
jne %r9, 9, failed
# Read back values from stack.
# Check that the values were not overwritten by func1.
ldxw %r6, [%r10-8]
mov32 %r0, 0x44332211
jne %r6, %r0, failed
ldxw %r7, [%r10-16]
mov32 %r0, 0x88776655
jne %r7, %r0, failed
# Success
mov %r0, 1
exit
Expand All @@ -36,6 +48,9 @@ add %r0, %r2
add %r0, %r3
add %r0, %r4
add %r0, %r5
# Write to the stack, shouldn't overwrite the callee's values.
stdw [%r10-8], 0xCCBBAA99
stdw [%r10-16], 0x00FFEEDD
mov %r6, 0
mov %r7, 0
mov %r8, 0
Expand Down