Added tests for array/struct impl, but they in general require printing
to screen
This commit is contained in:
52
test/arrays.c0.bc0
Normal file
52
test/arrays.c0.bc0
Normal file
@@ -0,0 +1,52 @@
|
||||
C0 C0 FF EE # magic number
|
||||
00 09 # version 4, arch = 1 (64 bits)
|
||||
|
||||
00 00 # int pool count
|
||||
# int pool
|
||||
|
||||
00 00 # string pool total size
|
||||
# string pool
|
||||
|
||||
00 01 # function count
|
||||
# function_pool
|
||||
|
||||
#<main>
|
||||
00 00 # number of arguments = 0
|
||||
00 01 # number of local variables = 1
|
||||
00 33 # code length = 51 bytes
|
||||
10 FE # bipush -2 # -2
|
||||
BC 04 # newarray 4 # alloc_array(int, -(2))
|
||||
36 00 # vstore 0 # A = alloc_array(int, -(2));
|
||||
15 00 # vload 0 # A
|
||||
10 03 # bipush 3 # 3
|
||||
63 # aadds # &A[3]
|
||||
10 00 # bipush 0 # 0
|
||||
4E # imstore # A[3] = 0;
|
||||
15 00 # vload 0 # A
|
||||
10 03 # bipush 3 # 3
|
||||
63 # aadds # &A[3]
|
||||
10 01 # bipush 1 # 1
|
||||
4E # imstore # A[3] = 1;
|
||||
15 00 # vload 0 # A
|
||||
10 03 # bipush 3 # 3
|
||||
63 # aadds # &A[3]
|
||||
10 02 # bipush 2 # 2
|
||||
4E # imstore # A[3] = 2;
|
||||
15 00 # vload 0 # A
|
||||
10 03 # bipush 3 # 3
|
||||
63 # aadds # &A[3]
|
||||
10 03 # bipush 3 # 3
|
||||
4E # imstore # A[3] = 3;
|
||||
15 00 # vload 0 # A
|
||||
10 03 # bipush 3 # 3
|
||||
63 # aadds # &A[3]
|
||||
2E # imload # A[3]
|
||||
B7 00 00 # invokenative 0 # printint(A[3])
|
||||
57 # pop # (ignore result)
|
||||
10 00 # bipush 0 # 0
|
||||
B0 # return #
|
||||
|
||||
00 01 # native count
|
||||
# native pool
|
||||
00 01 00 09 # printint
|
||||
|
||||
Reference in New Issue
Block a user