test cases for JUMP

This commit is contained in:
artur-zawlocki 2014-10-10 10:03:12 +01:00
parent 2b36803c96
commit 67789404b0
12 changed files with 102 additions and 0 deletions

View file

@ -0,0 +1 @@
600458006001600154

11
evmcc/test/jump/jump1.lll Normal file
View file

@ -0,0 +1,11 @@
;; Direct JUMP.
;; output: memory[1] == 1
(asm
4 ;; 0
JUMP ;; 2
STOP ;; 3
1 ;; 4
1 ;; 6
MSTORE ;; 8
)

View file

@ -0,0 +1 @@
6008586001600154

10
evmcc/test/jump/jump2.lll Normal file
View file

@ -0,0 +1,10 @@
;; Direct JUMP to the end of code.
;; output: memory should have size 0.
(asm
8 ;; 0
JUMP ;; 2
1 ;; 3
1 ;; 5
MSTORE ;; 7
)

View file

@ -0,0 +1 @@
602a586001600154

10
evmcc/test/jump/jump3.lll Normal file
View file

@ -0,0 +1,10 @@
;; Direct JUMP past the end of code.
;; output: memory should have size 0.
(asm
42
JUMP
1
1
MSTORE
)

View file

@ -0,0 +1 @@
600b6009580000600558005d6001600154

17
evmcc/test/jump/jump4.lll Normal file
View file

@ -0,0 +1,17 @@
;; Direct JUMP.
;; output: memory[1] = 1
(asm
11 ;; 0
9 ;; 2
JUMP ;; 4 --> 9
STOP ;; 5
STOP ;; 6
5 ;; 7
JUMP ;; 9 --> 11
STOP ;; 10
JUMPDEST
1 ;; 11
1
MSTORE
)

View file

@ -0,0 +1 @@
6005600e585d600160015400600f5800

16
evmcc/test/jump/jump5.lll Normal file
View file

@ -0,0 +1,16 @@
;; Direct JUMP.
;; output: memory[1] = 1
(asm
5 ;; 0
14 ;; 2
JUMP ;; 4 --> 14
JUMPDEST ;; 5
1 ;; 6
1 ;; 8
MSTORE ;; 10
STOP ;; 11
15 ;; 12
JUMP ;; 14 --> 5
STOP ;; 15
)

View file

@ -0,0 +1 @@
600358600f600d58006014600758005d6001600154005d600260025400

32
evmcc/test/jump/jump6.lll Normal file
View file

@ -0,0 +1,32 @@
;; Direct JUMP.
;; output: memory[1] = 1
;; 0, 2 --> 3 .. 7 --> 13 -*-> 15 .. 19
(asm
3 ;; 0
JUMP ;; 2
15 ;; 3 <- start
13 ;; 5
JUMP ;; 7 <- b
STOP ;; 8
20 ;; 9
7 ;; 11
JUMP ;; 13 <- a
STOP ;; 14
JUMPDEST ;; 15 <- c
1 ;; 16
1 ;; 18
MSTORE ;; 19
STOP ;; 20
JUMPDEST ;; 21 <- d
2 ;; 22
2 ;; 24
MSTORE ;; 26
STOP ;; 27
)