Browse Source

test cases for JUMP

cl-refactor
artur-zawlocki 10 years ago
parent
commit
67789404b0
  1. 1
      evmcc/test/jump/jump1.evm
  2. 11
      evmcc/test/jump/jump1.lll
  3. 1
      evmcc/test/jump/jump2.evm
  4. 10
      evmcc/test/jump/jump2.lll
  5. 1
      evmcc/test/jump/jump3.evm
  6. 10
      evmcc/test/jump/jump3.lll
  7. 1
      evmcc/test/jump/jump4.evm
  8. 17
      evmcc/test/jump/jump4.lll
  9. 1
      evmcc/test/jump/jump5.evm
  10. 16
      evmcc/test/jump/jump5.lll
  11. 1
      evmcc/test/jump/jump6.evm
  12. 32
      evmcc/test/jump/jump6.lll

1
evmcc/test/jump/jump1.evm

@ -0,0 +1 @@
600458006001600154

11
evmcc/test/jump/jump1.lll

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

1
evmcc/test/jump/jump2.evm

@ -0,0 +1 @@
6008586001600154

10
evmcc/test/jump/jump2.lll

@ -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
)

1
evmcc/test/jump/jump3.evm

@ -0,0 +1 @@
602a586001600154

10
evmcc/test/jump/jump3.lll

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

1
evmcc/test/jump/jump4.evm

@ -0,0 +1 @@
600b6009580000600558005d6001600154

17
evmcc/test/jump/jump4.lll

@ -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
)

1
evmcc/test/jump/jump5.evm

@ -0,0 +1 @@
6005600e585d600160015400600f5800

16
evmcc/test/jump/jump5.lll

@ -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
)

1
evmcc/test/jump/jump6.evm

@ -0,0 +1 @@
600358600f600d58006014600758005d6001600154005d600260025400

32
evmcc/test/jump/jump6.lll

@ -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
)
Loading…
Cancel
Save