cl/instr:asmFull test case with multiple input & output
This commit is contained in:
@@ -6,9 +6,22 @@ import _ "unsafe"
|
||||
func asmFull(instruction string, regs map[string]any) uintptr
|
||||
|
||||
func main() {
|
||||
// no input,no return value
|
||||
asmFull("nop", nil)
|
||||
// input only,no return value
|
||||
asmFull("# test value {value}", map[string]any{"value": 42})
|
||||
result := asmFull("mov {}, {value}", map[string]any{
|
||||
// input with return value
|
||||
res1 := asmFull("mov {}, {value}", map[string]any{
|
||||
"value": 42,
|
||||
})
|
||||
println("Result:", result)
|
||||
println("Result:", res1)
|
||||
// note(zzy): multiple inputs with return value
|
||||
// only for test register & constraint,not have actual meaning
|
||||
// the ir compare cannot crossplatform currently
|
||||
// so just use a comment to test it
|
||||
res2 := asmFull("# calc {x} + {y} -> {}", map[string]any{
|
||||
"x": 25,
|
||||
"y": 17,
|
||||
})
|
||||
println("Result:", res2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user