Skip to content

Commit

Permalink
Issue #27: dispatcher adding free memory pointer initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
lialan committed Nov 18, 2019
1 parent d3fb166 commit 266ee7f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/CodeGen/EVM/runtime_tests/simple_test_7.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;; simple comparison
define i256 @abcd(i256 %a, i256 %b) {
entry:
%0 = alloca i256
%1 = icmp ugt i256 %a, %b
br i1 %1, label %true, label %false

true:
store i256 %a, i256* %0
br label %finally

false:
store i256 %b, i256* %0
br label %finally

finally:
%2 = load i256, i256* %0
ret i256 %2
}

10 changes: 10 additions & 0 deletions tools/evm-test/evm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

template_x_1 = """
Start:
PUSH2 0x100
PUSH1 0x40
MSTORE
PUSH1 Return
${pushes}
PUSH2 Function
Expand All @@ -28,6 +31,9 @@

template_x_0 = """
Start:
PUSH2 0x100
PUSH1 0x40
MSTORE
PUSH1 Return
${pushes}
PUSH2 Function
Expand Down Expand Up @@ -201,6 +207,10 @@ def run_string_input(name: str, inputs: List[str], output: str, function: str) -
"input": ["0x12345678", "0x87654321"],
"output": "0x000000000000000000000000000000000000000000000000012345678",
},
"simple_test_7.ll" : {
"input": ["0x12345678", "0x87654321"],
"output": "0x000000000000000000000000000000000000000000000000087654321",
},
}

def assembly_tests() -> List[str]:
Expand Down

0 comments on commit 266ee7f

Please sign in to comment.