mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: fix x64 output comparison
This commit is contained in:
parent
10677c2b0c
commit
67a76cee1e
@ -27,6 +27,7 @@ enum Register {
|
||||
rax
|
||||
rdi
|
||||
rsi
|
||||
rbp
|
||||
edx
|
||||
rdx
|
||||
r12
|
||||
@ -214,6 +215,13 @@ pub fn (var g Gen) ret() {
|
||||
g.write8(0xc3)
|
||||
}
|
||||
|
||||
pub fn (var g Gen) push(reg Register) {
|
||||
match reg {
|
||||
.rbp { g.write8(0x55) }
|
||||
else {}
|
||||
}
|
||||
}
|
||||
|
||||
// returns label's relative address
|
||||
pub fn (var g Gen) gen_loop_start(from int) int {
|
||||
g.mov(.r12, from)
|
||||
|
@ -49,9 +49,12 @@ fn test_x64() {
|
||||
panic(err)
|
||||
}
|
||||
expected = expected.trim_space().trim('\n').replace('\r\n', '\n')
|
||||
mut found := res.output.trim_space().trim('\n').replace('\r\n', '\n')
|
||||
found = found[..found.len-1] // remove ACK char TODO fix this
|
||||
|
||||
var found := res.output.trim_space().trim('\n').replace('\r\n', '\n')
|
||||
// remove ACK char TODO fix this in x64
|
||||
buf := [byte(0x06)]
|
||||
ack := string(buf)
|
||||
found = found.replace(ack, '')
|
||||
found = found.trim_space()
|
||||
if expected != found {
|
||||
println(term.red('FAIL'))
|
||||
println('============')
|
||||
@ -72,4 +75,3 @@ fn test_x64() {
|
||||
exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user