mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 04:06:44 +00:00
test cases for JUMPS/phi nodes
This commit is contained in:
parent
7c78ecbdb2
commit
a2a496ebce
4 changed files with 57 additions and 0 deletions
1
evmcc/test/jump/loop1.evm
Normal file
1
evmcc/test/jump/loop1.evm
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
600a600181038060025900
|
||||||
27
evmcc/test/jump/loop1.lll
Normal file
27
evmcc/test/jump/loop1.lll
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
;; Produces 1 2 3 4 5 6 7 8 9 10 on the stack and exits
|
||||||
|
|
||||||
|
(asm
|
||||||
|
10
|
||||||
|
|
||||||
|
;; 2
|
||||||
|
1
|
||||||
|
DUP2
|
||||||
|
SUB
|
||||||
|
DUP1
|
||||||
|
2
|
||||||
|
JUMPI
|
||||||
|
|
||||||
|
;; stack = 1 2 3 4 5 6 7 8 9 10
|
||||||
|
;;0
|
||||||
|
;;MSTORE
|
||||||
|
;;1
|
||||||
|
;;MSTORE
|
||||||
|
;;2
|
||||||
|
;;MSTORE
|
||||||
|
;;3
|
||||||
|
;;MSTORE
|
||||||
|
|
||||||
|
STOP
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
1
evmcc/test/jump/loop2.evm
Normal file
1
evmcc/test/jump/loop2.evm
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
600a80600160800360a060025900
|
||||||
28
evmcc/test/jump/loop2.lll
Normal file
28
evmcc/test/jump/loop2.lll
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
;; Produces 1 2 3 4 5 6 7 8 9 10 on the stack and exits
|
||||||
|
|
||||||
|
(asm
|
||||||
|
10
|
||||||
|
|
||||||
|
;; 2
|
||||||
|
DUP1
|
||||||
|
1
|
||||||
|
SWAP
|
||||||
|
SUB
|
||||||
|
DUP
|
||||||
|
2
|
||||||
|
JUMPI
|
||||||
|
|
||||||
|
;; stack = 1 2 3 4 5 6 7 8 9 10
|
||||||
|
;;0
|
||||||
|
;;MSTORE
|
||||||
|
;;1
|
||||||
|
;;MSTORE
|
||||||
|
;;2
|
||||||
|
;;MSTORE
|
||||||
|
;;3
|
||||||
|
;;MSTORE
|
||||||
|
|
||||||
|
STOP
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue