Skip to content

Commit 7b6c506

Browse files
committed
Fix issue253.c:
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.
1 parent 7e8a9ed commit 7b6c506

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

c-tests/new/add-issue253.mir

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
iteration: module
2+
export iteration
3+
import print_identity
4+
import print_and_return_zero
5+
_proto_1: proto p, p:a0
6+
_proto_2: proto i32, p:a0
7+
iteration: func p, p:a0
8+
local i64:x2, i64:x1, i64:z1
9+
# 2 args, 4 locals
10+
mov x1, a0
11+
mov x2, 0
12+
L1:
13+
bf L3, x2
14+
bt L3, i64:(x2)
15+
L3:
16+
call _proto_1, print_identity, x2, x1
17+
call _proto_2, print_and_return_zero, z1, x2
18+
bt L4, z1
19+
jmp L5
20+
L4:
21+
jmp L1
22+
L5:
23+
ret x1
24+
ret x2
25+
endfunc
26+
endmodule

c-tests/new/issue253.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <stdio.h>
2+
void* print_identity (void* x) {
3+
printf ("in print_identity: %p\n", x);
4+
return x;
5+
}
6+
7+
int print_and_return_zero (void* t) {
8+
printf ("in print_and_return_zero: %p\n", t);
9+
return 0;
10+
}
11+
12+
extern void* iteration (void*);
13+
void* (*v) (void*) = iteration;
14+
15+
int main (void) {
16+
v ((void*) 0xdeadbeaf);
17+
return 0;
18+
}

0 commit comments

Comments
 (0)