WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

Commit c82f43d0 authored by qinsoon's avatar qinsoon
Browse files

more tests about rpython time

parent c70cd85a
......@@ -2309,17 +2309,15 @@ impl <'a> InstructionSelection {
let (stack_arg_size, _, stack_arg_offsets) = backend::sequetial_layout(&stack_arg_tys, vm);
let mut stack_arg_size_with_padding = stack_arg_size;
let mut stack_arg_padding = 0;
if stack_arg_size % 16 == 0 {
// do not need to adjust rsp
} else if stack_arg_size % 8 == 0 {
// adjust rsp by -8
stack_arg_padding = 8;
stack_arg_size_with_padding += 8;
} else {
let rem = stack_arg_size % 16;
stack_arg_padding = 16 - rem;
let stack_arg_padding = 16 - rem;
stack_arg_size_with_padding += stack_arg_padding;
}
......@@ -2328,7 +2326,7 @@ impl <'a> InstructionSelection {
if stack_arg_size_with_padding != 0 {
let mut index = 0;
let mut rsp_offset_before_call = - (stack_arg_size_with_padding as i32);
let rsp_offset_before_call = - (stack_arg_size_with_padding as i32);
for arg in stack_args {
self.emit_store_base_offset(&x86_64::RSP, rsp_offset_before_call + (stack_arg_offsets[index]) as i32, &arg, vm);
......@@ -2763,7 +2761,7 @@ impl <'a> InstructionSelection {
// arg <- RBP + 16
// return addr
// old RBP <- RBP
let mut stack_arg_base_offset : i32 = 16;
let stack_arg_base_offset : i32 = 16;
let arg_by_stack_tys = arg_by_stack.iter().map(|x| x.ty.clone()).collect();
let (_, _, stack_arg_offsets) = backend::sequetial_layout(&arg_by_stack_tys, vm);
......
......@@ -661,10 +661,8 @@ fn pass_mixed_args_by_stack() -> VM {
// blk_entry
consta! ((vm, pass_mixed_args_by_stack_v1) int64_0_local = int64_0);
consta! ((vm, pass_mixed_args_by_stack_v1) int64_1_local = int64_1);
consta! ((vm, pass_mixed_args_by_stack_v1) int64_2_local = int64_2);
consta! ((vm, pass_mixed_args_by_stack_v1) int8_1_local = int8_1);
consta! ((vm, pass_mixed_args_by_stack_v1) int8_2_local = int8_2);
block! ((vm, pass_mixed_args_by_stack_v1) blk_entry);
block! ((vm, pass_mixed_args_by_stack_v1) blk_main);
......
......@@ -19,6 +19,7 @@ use test_compiler::test_call::gen_ccall_exit;
struct Foo (i8, i8, i8);
#[test]
#[allow(unused_variables)]
fn test_write_int8_val() {
let lib = testutil::compile_fnc("write_int8", &write_int8);
......
......@@ -1158,6 +1158,7 @@ def test_rpytarget_richards():
res = run_boot_image(main, '/tmp/test_richards-mu', args=['5'])
assert res.returncode == 0, res.err
@pytest.mark.xfail(reason='printing time fails')
@may_spawn_proc
def test_rpytarget_richards_measure_time():
from rpython.translator.goal.richards import entry_point
......@@ -1171,6 +1172,31 @@ def test_rpytarget_richards_measure_time():
res = run_boot_image(main, '/tmp/test_richards_measure_time-mu', args=['5'])
assert res.returncode == 0, res.err
@pytest.mark.xfail(reason='ValueError exception, probably formatting fails')
@may_spawn_proc
def test_rpython_print_time():
import time
def main(argv):
print time.time()
return 0
res = run_boot_image(main, '/tmp/test_print_time')
assert res.returncode == 0, res.err
@may_spawn_proc
def test_rpython_time_diff():
import time
def main(argv):
t1 = time.time()
t2 = time.time()
if t2 >= t1:
return 0
else:
return 1
res = run_boot_image(main, '/tmp/test_time_diff')
assert res.returncode == 0, res.err
@may_spawn_proc
def test_dtoa():
from rpython.rlib.rdtoa import dtoa
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment