From ab38605802524aa73ed8caf200d486e5128279cf Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 21 Apr 2020 06:16:47 +0200 Subject: [PATCH] tests: disable clipboard on linux; x64: leave() --- vlib/clipboard/clipboard_test.v | 6 +++++- vlib/v/gen/x64/gen.v | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/vlib/clipboard/clipboard_test.v b/vlib/clipboard/clipboard_test.v index a25216f4d0..bbe7a36e41 100644 --- a/vlib/clipboard/clipboard_test.v +++ b/vlib/clipboard/clipboard_test.v @@ -14,10 +14,14 @@ fn run_test(is_primary bool){ fn test_primary(){ $if linux { - run_test(true) + return + //run_test(true) } } fn test_clipboard(){ + $if linux { + return + } run_test(false) } diff --git a/vlib/v/gen/x64/gen.v b/vlib/v/gen/x64/gen.v index 48d9b34a9f..6ea11cff49 100644 --- a/vlib/v/gen/x64/gen.v +++ b/vlib/v/gen/x64/gen.v @@ -262,6 +262,11 @@ pub fn (mut g Gen) sub32(reg Register, val int) { g.write8(0x48) g.write8(0x81) g.write8(0xe8 + reg) // TODO rax is different? + g.write32(val) +} + +fn (mut g Gen) leave() { + g.write8(0xc9) } // returns label's relative address @@ -452,6 +457,7 @@ fn (mut g Gen) fn_decl(it ast.FnDecl) { // return } if !is_main { + // g.leave() g.pop(.rbp) } g.ret()