From 60bbad4d8643e341e56f9bfc11c99fa89f9605f8 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 17 Jun 2020 20:24:39 +0200 Subject: [PATCH] x64: fix a test --- vlib/v/gen/x64/tests/general.vv | 6 ++--- vlib/v/gen/x64/tests/simple_fn_calls.vv | 29 +++++++++++++++++++-- vlib/v/gen/x64/tests/simple_fn_calls.vv.out | 3 +++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/vlib/v/gen/x64/tests/general.vv b/vlib/v/gen/x64/tests/general.vv index f750d690ab..d5e3282649 100644 --- a/vlib/v/gen/x64/tests/general.vv +++ b/vlib/v/gen/x64/tests/general.vv @@ -32,6 +32,9 @@ fn foo(a int) { if a == 1 { println('a == 1') } + if a == 7 { + println('a == 7') + } a++ if a == 2 { println('a == 2') @@ -39,9 +42,6 @@ fn foo(a int) { if a == 3 { println('a == 3') } - if a == 7 { - println('a == 7') - } } diff --git a/vlib/v/gen/x64/tests/simple_fn_calls.vv b/vlib/v/gen/x64/tests/simple_fn_calls.vv index 5ac4246626..3f58472757 100644 --- a/vlib/v/gen/x64/tests/simple_fn_calls.vv +++ b/vlib/v/gen/x64/tests/simple_fn_calls.vv @@ -2,13 +2,38 @@ fn print_greeting(){ println('hello from x64') } -fn print_number() { +fn print_123() { println('123') } + +fn print_number(n int) { + if n == 1 { println('1') } + if n == 2 { println('2') } + if n == 3 { println('3') } + if n == 4 { println('4') } + if n == 5 { println('5') } + if n == 6 { println('6') } + if n == 7 { println('7') } + if n == 8 { println('8') } + if n == 9 { println('9') } +} + +fn test_add() { + println('test_add()') + x := 2 + y := 3 + //z := x + y + print_number(x) + print_number(y) + //print_number(z) + print_number(x) +} + fn main() { println('start') print_greeting() - print_number() + print_123() + test_add() println('end') } diff --git a/vlib/v/gen/x64/tests/simple_fn_calls.vv.out b/vlib/v/gen/x64/tests/simple_fn_calls.vv.out index 761cb66834..0af14617db 100644 --- a/vlib/v/gen/x64/tests/simple_fn_calls.vv.out +++ b/vlib/v/gen/x64/tests/simple_fn_calls.vv.out @@ -1,4 +1,7 @@ start hello from x64 123 +2 +3 +2 end