Test assumptions about variadic re-packing

This test uses the same style of re-packing variadic arguments through
two layers of variadic calls, and compares that call chain against one
direct variadic call.

The outer function uses the same kind of re-packing used in
src/libfaketime.c's syscall (leading to real_syscall), but the inner
functions use different assumptions about the types of each argument.

This is not an entirely comprehensive test, because we only define two
different inner function signatures.  If some particular syscall is
breaking when intercepted, consider adding something like its expected
function signature in test/variadic/inner.c, and invoke it in
test/variadic/main.c.

Note that we don't test any floating point types (those types are
typically passed in registers in x86-64, not on the stack, and are
also not used for any syscall that i'm aware of).
This commit is contained in:
Daniel Kahn Gillmor
2021-03-05 21:32:12 -05:00
parent 5a0071f952
commit 008d33fdf2
5 changed files with 146 additions and 1 deletions

1
.gitignore vendored
View File

@@ -8,6 +8,7 @@ test/run_*
test/repeat_random
test/getentropy_test
test/syscall_test
test/variadic_promotion
src/libfaketime.dylib.1
src/libfaketime.1.dylib