From 214fcd5223dcc631e37aaa129f6999aad8f4cf0d Mon Sep 17 00:00:00 2001 From: Lukas Diekmann Date: Wed, 18 Dec 2024 16:07:56 +0000 Subject: [PATCH] Add simple peeling test. --- tests/c/simple_peeling.c | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/c/simple_peeling.c diff --git a/tests/c/simple_peeling.c b/tests/c/simple_peeling.c new file mode 100644 index 000000000..e962820c5 --- /dev/null +++ b/tests/c/simple_peeling.c @@ -0,0 +1,49 @@ +// Run-time: +// env-var: YKD_LOG_IR=jit-post-opt +// env-var: YKD_SERIALISE_COMPILATION=1 +// env-var: YK_LOG=4 +// stderr: +// ... +// --- Begin jit-post-opt --- +// ... +// header_start ... +// ... +// header_end [%{{0}}, %{{1}}, %{{2}}, %{{3}}, %{{4}}, %{{25}}] +// ... +// body_start [%{{30}}, %{{31}}, %{{32}}, %{{33}}, %{{34}}, %{{35}}] +// ... +// body_end ... +// ... +// --- End jit-post-opt --- +// ... + +// Check that basic trace compilation works. + +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + YkMT *mt = yk_mt_new(NULL); + yk_mt_hot_threshold_set(mt, 0); + YkLocation loc = yk_location_new(); + + int res = 9998; + int i = 4; + NOOPT_VAL(loc); + NOOPT_VAL(res); + NOOPT_VAL(i); + while (i > 0) { + yk_mt_control_point(mt, &loc); + fprintf(stderr, "%d\n", i); + i--; + } + fprintf(stderr, "exit\n"); + NOOPT_VAL(res); + yk_location_drop(loc); + yk_mt_shutdown(mt); + return (EXIT_SUCCESS); +}