Fix a bug in the binemit file test.
Only emit each instruction once, or the offset computations go all wrong.
This commit is contained in:
@@ -75,9 +75,11 @@ ebb0:
|
|||||||
[-,%x7] v140 = iconst.i32 0x12345000 ; bin: 123453b7
|
[-,%x7] v140 = iconst.i32 0x12345000 ; bin: 123453b7
|
||||||
[-,%x16] v141 = iconst.i32 0xffffffff_fedcb000 ; bin: fedcb837
|
[-,%x16] v141 = iconst.i32 0xffffffff_fedcb000 ; bin: fedcb837
|
||||||
|
|
||||||
|
jump ebb1
|
||||||
|
|
||||||
; Control Transfer Instructions
|
; Control Transfer Instructions
|
||||||
|
|
||||||
|
ebb1:
|
||||||
; beq
|
; beq
|
||||||
br_icmp eq, v1, v2, ebb0 ; bin: Branch(ebb0) 01550063
|
br_icmp eq, v1, v2, ebb0 ; bin: Branch(ebb0) 01550063
|
||||||
; bne
|
; bne
|
||||||
|
|||||||
@@ -177,8 +177,6 @@ impl SubTest for TestBinEmit {
|
|||||||
inst,
|
inst,
|
||||||
func.dfg.display_inst(inst)));
|
func.dfg.display_inst(inst)));
|
||||||
}
|
}
|
||||||
sink.text.clear();
|
|
||||||
isa.emit_inst(&func, inst, &mut sink);
|
|
||||||
let have = sink.text.trim();
|
let have = sink.text.trim();
|
||||||
if have != want {
|
if have != want {
|
||||||
return Err(format!("Bad machine code for {}: {}\nWant: {}\nGot: {}",
|
return Err(format!("Bad machine code for {}: {}\nWant: {}\nGot: {}",
|
||||||
|
|||||||
Reference in New Issue
Block a user