mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
new test cases
This commit is contained in:
parent
d28139677b
commit
0dae894c05
13 changed files with 86 additions and 0 deletions
7
evmcc/test/jump/ackermann.ethel
Normal file
7
evmcc/test/jump/ackermann.ethel
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let A m n =
|
||||
if m == 0 then n+1
|
||||
else if n == 0 then A (m-1) 1
|
||||
else A (m-1) (A (m) (n-1))
|
||||
|
||||
return A 3 8
|
||||
|
||||
1
evmcc/test/jump/ackermann.evm
Normal file
1
evmcc/test/jump/ackermann.evm
Normal file
|
|
@ -0,0 +1 @@
|
|||
6009600360086012585d60005460206000f26000820e6047596000810e603859603460018303603084600185036012585d6012585d60445860436001830360016012585d604b5860018101905090509058
|
||||
5
evmcc/test/jump/fac.ethel
Normal file
5
evmcc/test/jump/fac.ethel
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
let fac n =
|
||||
if n == 0 then 1
|
||||
else n * fac (n-1)
|
||||
|
||||
return fac 60
|
||||
1
evmcc/test/jump/fac.evm
Normal file
1
evmcc/test/jump/fac.evm
Normal file
|
|
@ -0,0 +1 @@
|
|||
6007603c6010585d60005460206000f26000810e6026596020600182036010585d8102602858600190509058
|
||||
5
evmcc/test/jump/fac_tail.ethel
Normal file
5
evmcc/test/jump/fac_tail.ethel
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
let fac a n =
|
||||
if n == 0 then a
|
||||
else fac (a*n) (n-1)
|
||||
|
||||
return fac 1 60
|
||||
1
evmcc/test/jump/fac_tail.evm
Normal file
1
evmcc/test/jump/fac_tail.evm
Normal file
|
|
@ -0,0 +1 @@
|
|||
60096001603c6012585d60005460206000f26000810e6029596025818302600183036012585d602a5881905090509058
|
||||
1
evmcc/test/stack/oos.evm
Normal file
1
evmcc/test/stack/oos.evm
Normal file
|
|
@ -0,0 +1 @@
|
|||
60018194505050509150
|
||||
11
evmcc/test/stack/oos.lll
Normal file
11
evmcc/test/stack/oos.lll
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(asm ;; x . v y z
|
||||
1 ;; 1 x . v y z
|
||||
DUP2 ;; x 1 x . v y z
|
||||
SWAP5 ;; y 1 x . v x z
|
||||
POP ;; 1 x . v x z
|
||||
POP ;; x . v x z
|
||||
POP ;; . v x z
|
||||
POP ;; v x z
|
||||
SWAP2 ;; z x v
|
||||
POP ;; x v
|
||||
)
|
||||
1
evmcc/test/stack/swap.evm
Normal file
1
evmcc/test/stack/swap.evm
Normal file
|
|
@ -0,0 +1 @@
|
|||
600160026001600a590090600160115900016000546001601ff2
|
||||
25
evmcc/test/stack/swap.lll
Normal file
25
evmcc/test/stack/swap.lll
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(asm
|
||||
1 ;; 0
|
||||
2 ;; 2
|
||||
1 ;; 4
|
||||
10 ;; 6
|
||||
JUMPI ;; 8
|
||||
STOP ;; 9
|
||||
|
||||
;; stack = 2,1
|
||||
SWAP1 ;; 10
|
||||
1 ;; 11
|
||||
17 ;; 13
|
||||
JUMPI ;; 15
|
||||
STOP ;; 16
|
||||
|
||||
;; stack = 1,2
|
||||
ADD ;; 17
|
||||
0
|
||||
MSTORE
|
||||
1
|
||||
31
|
||||
RETURN ;; returns 03
|
||||
)
|
||||
|
||||
|
||||
1
evmcc/test/stack/swapswap.evm
Normal file
1
evmcc/test/stack/swapswap.evm
Normal file
|
|
@ -0,0 +1 @@
|
|||
600160026001600a59009090600160125900016000546001601ff2
|
||||
26
evmcc/test/stack/swapswap.lll
Normal file
26
evmcc/test/stack/swapswap.lll
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
(asm
|
||||
1 ;; 0
|
||||
2 ;; 2
|
||||
1 ;; 4
|
||||
10 ;; 6
|
||||
JUMPI ;; 8
|
||||
STOP ;; 9
|
||||
|
||||
;; stack = 2,1
|
||||
SWAP1 ;; 10
|
||||
SWAP1 ;; 11
|
||||
1 ;; 12
|
||||
18 ;; 14
|
||||
JUMPI ;; 16
|
||||
STOP ;; 17
|
||||
|
||||
;; stack = 2,1
|
||||
ADD ;; 18
|
||||
0
|
||||
MSTORE
|
||||
1
|
||||
31
|
||||
RETURN ;; returns 03
|
||||
)
|
||||
|
||||
|
||||
1
evmcc/test/stack/test.evm
Normal file
1
evmcc/test/stack/test.evm
Normal file
|
|
@ -0,0 +1 @@
|
|||
60018194505050509150
|
||||
Loading…
Reference in a new issue