Skip to content

Commit

Permalink
Issue #27: adding another loop test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lialan committed Nov 20, 2019
1 parent 52f0d4d commit 83fe2a1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/CodeGen/EVM/runtime_tests/loop2.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
; Function Attrs: noinline nounwind optnone ssp uwtable
define i256 @abc(i256, i256) #0 {
%3 = alloca i256, align 4
%4 = alloca i256, align 4
%5 = alloca i256, align 4
store i256 %0, i256* %3, align 4
store i256 %1, i256* %4, align 4
store i256 0, i256* %5, align 4
br label %6

; <label>:6: ; preds = %14, %2
%7 = load i256, i256* %5, align 4
%8 = load i256, i256* %4, align 4
%9 = icmp ult i256 %7, %8
br i1 %9, label %10, label %17

; <label>:10: ; preds = %6
%11 = load i256, i256* %3, align 4
%12 = load i256, i256* %3, align 4
%13 = add i256 %12, %11
store i256 %13, i256* %3, align 4
br label %14

; <label>:14: ; preds = %10
%15 = load i256, i256* %5, align 4
%16 = add i256 %15, 1
store i256 %16, i256* %5, align 4
br label %6

; <label>:17: ; preds = %6
%18 = load i256, i256* %3, align 4
ret i256 %18
}

4 changes: 4 additions & 0 deletions tools/evm-test/evm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ def run_string_input(name: str, inputs: List[str], output: str, function: str) -
"input": ["0x00001000", "0x00000001"],
"output": "0x00000000000000000000000000000000000000000000000000000100a",
},
"loop2.ll" : {
"input": ["0x00001000", "0x0000000a"],
"output": "0x00000000000000000000000000000000000000000000000000000a000",
},
}

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

0 comments on commit 83fe2a1

Please sign in to comment.