-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use def_op_num in process_insn_to_rename. Permit mir as add file in runtests.sh. Add issue253.c, add-issue253.mir, and issue253.expect.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 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,26 @@ | ||
iteration: module | ||
export iteration | ||
import print_identity | ||
import print_and_return_zero | ||
_proto_1: proto p, p:a0 | ||
_proto_2: proto i32, p:a0 | ||
iteration: func p, p:a0 | ||
local i64:x2, i64:x1, i64:z1 | ||
# 2 args, 4 locals | ||
mov x1, a0 | ||
mov x2, 0 | ||
L1: | ||
bf L3, x2 | ||
bt L3, i64:(x2) | ||
L3: | ||
call _proto_1, print_identity, x2, x1 | ||
call _proto_2, print_and_return_zero, z1, x2 | ||
bt L4, z1 | ||
jmp L5 | ||
L4: | ||
jmp L1 | ||
L5: | ||
ret x1 | ||
ret x2 | ||
endfunc | ||
endmodule |
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,18 @@ | ||
#include <stdio.h> | ||
void* print_identity (void* x) { | ||
printf ("in print_identity: %p\n", x); | ||
return x; | ||
} | ||
|
||
int print_and_return_zero (void* t) { | ||
printf ("in print_and_return_zero: %p\n", t); | ||
return 0; | ||
} | ||
|
||
extern void* iteration (void*); | ||
void* (*v) (void*) = iteration; | ||
|
||
int main (void) { | ||
v ((void*) 0xdeadbeaf); | ||
return 0; | ||
} |