I hadn't realized before that the filetest backend for `test vcode` is doing essentially what `compile` is doing, but for new (`MachInst`) backends: it is just getting a disassembly and running it through filecheck. There's no reason not to reuse `test compile` for the AArch64 tests as well. This was motivated by the desire to have "this IR compiles successfully" tests work on both x86 and AArch64. It seems this should work fine by adding multiple `target` directives when a test case should be compile-tested on multiple architectures.
17 lines
311 B
Plaintext
17 lines
311 B
Plaintext
test compile
|
|
target aarch64
|
|
|
|
function %f(i64, i64) -> i64 {
|
|
sig0 = (i64) -> i64
|
|
block0(v0: i64, v1: i64):
|
|
v2 = call_indirect.i64 sig0, v1(v0)
|
|
return v2
|
|
}
|
|
|
|
; check: stp fp, lr, [sp, #-16]!
|
|
; nextln: mov fp, sp
|
|
; nextln: blr x1
|
|
; nextln: mov sp, fp
|
|
; nextln: ldp fp, lr, [sp], #16
|
|
; nextln: ret
|