-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1409 from vext01/inttoptr
Relax cg_zeroextend to allow zeroextends into pointer types.
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Run-time: | ||
// env-var: YKD_LOG_IR=-:aot | ||
// env-var: YKD_SERIALISE_COMPILATION=1 | ||
// env-var: YK_LOG=4 | ||
// stderr: | ||
// yk-jit-event: start-tracing | ||
// 4: 0x4 | ||
// yk-jit-event: stop-tracing | ||
// --- Begin aot --- | ||
// ... | ||
// %{{11_2}}: ptr = zext %{{11_1}}, ptr | ||
// %{{11_3}}: i32 = call fprintf(%{{_}}, @{{_}}, %{{11_1}}, %{{11_2}}) | ||
// ... | ||
// --- End aot --- | ||
// 3: 0x3 | ||
// yk-jit-event: enter-jit-code | ||
// 2: 0x2 | ||
// 1: 0x1 | ||
// yk-jit-event: deoptimise | ||
|
||
// Check that converting an integer to a pointer works. | ||
|
||
#include <inttypes.h> | ||
#include <stdio.h> | ||
#include <stdlib.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(); | ||
|
||
uintptr_t i = 4; | ||
NOOPT_VAL(loc); | ||
NOOPT_VAL(i); | ||
while (i > 0) { | ||
yk_mt_control_point(mt, &loc); | ||
fprintf(stderr, "%" PRIuPTR ": %p\n", i, (void *) i); | ||
i--; | ||
} | ||
yk_location_drop(loc); | ||
yk_mt_shutdown(mt); | ||
return (EXIT_SUCCESS); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters