Commit 790a2b8f authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Added newthread stack argument test

parent 0ca6181a
......@@ -432,7 +432,6 @@ fn copy_inline_blocks(
// Create the new blocks contents
{
let old_block_content = old_block.content.as_ref().unwrap();
let block_name = block.name().clone();
let block_content = block.content.as_mut().unwrap();
// Copy the old_block contents (minus the last one)
......@@ -461,7 +460,6 @@ fn copy_inline_blocks(
trace!("last instruction: {}", inst);
let hdr = inst.hdr.clone_with_id(inst_new_id);
let inst_name = inst.name().clone();
let ref value = inst.value;
let ref ops = inst.ops;
let ref v = inst.v;
......
......@@ -300,4 +300,35 @@ def test_newthread_threadlocal():
COMMINST uvm.thread_exit()
}
""", "test_newthread_threadlocal");
assert(execute("test_newthread_threadlocal", []) == 3);
\ No newline at end of file
assert(execute("test_newthread_threadlocal", []) == 3);
def test_newthread_stack_args():
compile_bundle(
"""
.funcsig stack_sig = (stackref double double double double double double double double double double)->()
.funcdef test_newthread_stack_args_thread <stack_sig>
{
entry(<stackref>s <double>d0 <double>d1 <double>d2 <double>d3 <double>d4 <double>d5 <double>d6 <double>d7 <double> d8 <double> d9):
s1 = FADD <double> d0 d1
s2 = FADD <double> s1 d2
s3 = FADD <double> s2 d3
s4 = FADD <double> s3 d4
s5 = FADD <double> s4 d5
s6 = FADD <double> s5 d6
s7 = FADD <double> s6 d7
s8 = FADD <double> s7 d8
s9 = FADD <double> s8 d9
r = FPTOSI <double int<32>> s9
CCALL #DEFAULT <exit_type exit_sig> exit(r)
RET
}
.funcdef test_newthread_stack_args <main_sig>
{
entry(<int<32>>argc <uptr<uptr<char>>>argv):
cs = COMMINST uvm.current_stack()
s = COMMINST uvm.new_stack<[stack_sig]>(test_newthread_stack_args_thread)
t = NEWTHREAD s PASS_VALUES<stackref double double double double double double double double double double>(cs <double>0.0 d <double>1.0 d <double>2.0 d <double>3.0 d <double>4.0 d <double>5.0 d <double>6.0 d <double>7.0 d <double>8.0 d <double>9.0 d)
COMMINST uvm.thread_exit()
}
""", "test_newthread_stack_args");
assert(execute("test_newthread_stack_args", []) == 45);
\ No newline at end of file
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