Skip to content

Commit

Permalink
Add simple peeling test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ptersilie committed Dec 18, 2024
1 parent 950c72d commit 214fcd5
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tests/c/simple_peeling.c
Original file line number Diff line number Diff line change
@@ -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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <yk.h>
#include <yk_testing.h>

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);
}

0 comments on commit 214fcd5

Please sign in to comment.