diff options
author | Martin Storsjö <martin@martin.st> | 2020-08-06 21:50:50 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2020-08-07 07:16:26 +0300 |
commit | 0b8249442ef12b7ea061ce15211991333baa4bee (patch) | |
tree | fd101feca77aa64019bd33847ad39e678d1b731c /tests | |
parent | e86ddd562e89b044ecff8519f1e4f60372dcbd3e (diff) |
checkasm: Enforce declare_func to be outside of check_func
Move the declaration of func_ref/func_new into declare_func. This
enforces that declare_func is a scope outside of/before check_func.
This ensures that if the signal handler is triggered, we rewind
to a scope outside of check_func, where check_func makes sure we
don't rerun the test that just triggered the signal handler.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/checkasm/checkasm.c | 1 | ||||
-rw-r--r-- | tests/checkasm/checkasm.h | 3 |
2 files changed, 1 insertions, 3 deletions
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 2bf15d8..6d368d2 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -518,7 +518,6 @@ static void print_cpu_name(void) { } int main(int argc, char *argv[]) { - (void)func_new, (void)func_ref; state.seed = get_seed(); while (argc > 1) { diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 2a3391b..6c81481 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -86,8 +86,6 @@ int float_near_abs_eps_array(const float *a, const float *b, float eps, int float_near_abs_eps_array_ulp(const float *a, const float *b, float eps, unsigned max_ulp, int len); -static void *func_ref, *func_new; - #define BENCH_RUNS (1 << 12) /* Trade-off between accuracy and speed */ /* Decide whether or not the specified function needs to be tested */ @@ -99,6 +97,7 @@ static void *func_ref, *func_new; * is optional. */ #define declare_func(ret, ...)\ declare_new(ret, __VA_ARGS__)\ + void *func_ref, *func_new;\ typedef ret func_type(__VA_ARGS__);\ checkasm_save_context() |