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.
18 lines
285 B
Plaintext
18 lines
285 B
Plaintext
test compile
|
|
target aarch64
|
|
|
|
function %f() -> i64 {
|
|
gv0 = symbol %my_global
|
|
|
|
block0:
|
|
v0 = symbol_value.i64 gv0
|
|
return v0
|
|
}
|
|
|
|
; check: stp fp, lr, [sp, #-16]!
|
|
; nextln: mov fp, sp
|
|
; nextln: ldr x0, 8 ; b 12 ; data
|
|
; nextln: mov sp, fp
|
|
; nextln: ldp fp, lr, [sp], #16
|
|
; nextln: ret
|