From e56482d0fdfd4e229e5d4fca61232c4c8b13bc22 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 6 Apr 2017 11:13:13 -0700 Subject: [PATCH] Fix a bug in the binemit file test. Only emit each instruction once, or the offset computations go all wrong. --- filetests/isa/riscv/binary32.cton | 2 ++ src/filetest/binemit.rs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/filetests/isa/riscv/binary32.cton b/filetests/isa/riscv/binary32.cton index 93b1a9cc2d..8055289c65 100644 --- a/filetests/isa/riscv/binary32.cton +++ b/filetests/isa/riscv/binary32.cton @@ -75,9 +75,11 @@ ebb0: [-,%x7] v140 = iconst.i32 0x12345000 ; bin: 123453b7 [-,%x16] v141 = iconst.i32 0xffffffff_fedcb000 ; bin: fedcb837 + jump ebb1 ; Control Transfer Instructions +ebb1: ; beq br_icmp eq, v1, v2, ebb0 ; bin: Branch(ebb0) 01550063 ; bne diff --git a/src/filetest/binemit.rs b/src/filetest/binemit.rs index eee96e6ee5..f4ec6262c6 100644 --- a/src/filetest/binemit.rs +++ b/src/filetest/binemit.rs @@ -177,8 +177,6 @@ impl SubTest for TestBinEmit { inst, func.dfg.display_inst(inst))); } - sink.text.clear(); - isa.emit_inst(&func, inst, &mut sink); let have = sink.text.trim(); if have != want { return Err(format!("Bad machine code for {}: {}\nWant: {}\nGot: {}",