cleaning up tests

This commit is contained in:
Jakub Doka 2024-10-27 19:13:25 +01:00
parent 3c12c0e288
commit 2c2f0c048b
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143
9 changed files with 28 additions and 31 deletions

View file

@ -776,7 +776,7 @@ sqrt := fn(x: uint): uint {
}
```
#### structs_in_registers
#### struct_in_register
```hb
ColorBGRA := struct {b: u8, g: u8, r: u8, a: u8}
MAGENTA := ColorBGRA.{b: 205, g: 0, r: 205, a: 255}

View file

@ -3684,7 +3684,7 @@ mod tests {
different_types;
struct_return_from_module_function;
sort_something_viredly;
//structs_in_registers;
struct_in_register;
comptime_function_from_another_file;
inline_test;
inlined_generic_functions;

View file

@ -1,12 +1,12 @@
main:
ADDI64 r254, r254, -36d
ST r31, r254, 28a, 8h
LI8 r1, 0b
ST r1, r254, 0a, 1h
ST r1, r254, 1a, 1h
LI8 r5, 255b
ST r5, r254, 2a, 1h
LI8 r8, 1b
LI8 r2, 0b
ST r2, r254, 0a, 1h
ST r2, r254, 1a, 1h
LI16 r4, 511h
ST r4, r254, 2a, 1h
LI16 r8, 1h
ST r8, r254, 3a, 1h
LI64 r11, 1d
ADDI64 r2, r254, 4d
@ -31,6 +31,6 @@ pass:
LD r1, r10, 0a, 8h
ADD64 r1, r1, r9
JALA r0, r31, 0a
code size: 316
code size: 318
ret: 8
status: Ok(())

View file

@ -16,15 +16,14 @@ set:
ADDI64 r254, r254, -25d
LI8 r7, 5b
ST r7, r254, 0a, 1h
ANDI r10, r4, 4294967295d
ST r10, r254, 1a, 4h
LI32 r1, 8w
ST r1, r254, 5a, 4h
ST r4, r254, 1a, 4h
LI64 r11, 8d
ST r11, r254, 5a, 4h
ST r2, r254, 9a, 8h
ST r3, r254, 17a, 8h
LD r1, r254, 1a, 4h
ADDI64 r254, r254, 25d
JALA r0, r31, 0a
code size: 284
code size: 277
ret: 1024
status: Ok(())

View file

@ -3,7 +3,6 @@ create_back_buffer:
ST r31, r254, 0a, 48h
LI64 r32, 255d
JGTS r2, r32, :0
AND r2, r2, r32
JAL r31, r0, :request_page
JMP :1
0: CP r33, r2
@ -21,7 +20,7 @@ create_back_buffer:
CP r2, r34
JAL r31, r0, :request_page
JMP :4
3: AND r2, r33, r32
3: CP r2, r33
JAL r31, r0, :request_page
4: SUB64 r33, r33, r32
JMP :5
@ -44,6 +43,6 @@ request_page:
LI64 r2, 3d
ECA
JALA r0, r31, 0a
code size: 336
code size: 331
ret: 42
status: Ok(())

View file

@ -1,7 +1,6 @@
main:
LI32 r1, 1w
ANDI r1, r1, 4294967295d
LI64 r1, 1d
JALA r0, r31, 0a
code size: 36
code size: 29
ret: 1
status: Ok(())

View file

@ -33,22 +33,22 @@ fib_iter:
JMP :2
1: JALA r0, r31, 0a
main:
ADDI64 r254, r254, -26d
ST r31, r254, 2a, 24h
LI8 r32, 10b
ST r32, r254, 0a, 1h
ST r32, r254, 1a, 1h
ADDI64 r254, r254, -18d
ST r31, r254, 2a, 16h
LI8 r1, 10b
ST r1, r254, 0a, 1h
ST r1, r254, 1a, 1h
LD r5, r254, 0a, 1h
ANDI r2, r5, 255d
JAL r31, r0, :fib
CP r33, r1
ANDI r2, r32, 255d
CP r32, r1
LI64 r2, 10d
JAL r31, r0, :fib_iter
CP r4, r33
CP r4, r32
SUB64 r1, r4, r1
LD r31, r254, 2a, 24h
ADDI64 r254, r254, 26d
LD r31, r254, 2a, 16h
ADDI64 r254, r254, 18d
JALA r0, r31, 0a
code size: 354
code size: 353
ret: 0
status: Ok(())