To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit c96021e1 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano
Browse files

Added swapstack spilling test

parent b8cf426f
...@@ -104,6 +104,38 @@ def test_swapstack_pass_stack_args(): ...@@ -104,6 +104,38 @@ def test_swapstack_pass_stack_args():
""", "test_swapstack_pass_stack_args"); """, "test_swapstack_pass_stack_args");
assert(execute("test_swapstack_pass_stack_args", []) == 45); assert(execute("test_swapstack_pass_stack_args", []) == 45);
def test_swapstack_spill():
compile_bundle(
"""
.funcdef test_swapstack_spill_swapee <(stackref)->()>
{
entry(<stackref>s):
SWAPSTACK s KILL_OLD PASS_VALUES<>()
}
.funcdef test_swapstack_spill <main_sig>
{
entry(<int<32>>argc <uptr<uptr<char>>>argv):
BRANCH block(<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)
block(<double>d0 <double>d1 <double>d2 <double>d3 <double>d4 <double>d5 <double>d6 <double>d7 <double> d8 <double> d9):
cs = COMMINST uvm.current_stack()
s = COMMINST uvm.new_stack<[(stackref)->()]>(test_swapstack_spill_swapee)
SWAPSTACK s RET_WITH<> PASS_VALUES<stackref>(cs)
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
RET r
}
""", "test_swapstack_spill");
assert(execute("test_swapstack_spill", []) == 45);
def test_swapstack_throw(): def test_swapstack_throw():
compile_bundle( compile_bundle(
""" """
......
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