-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port interpreter test cases to a
dir-test
based test
- Loading branch information
Showing
8 changed files
with
334 additions
and
265 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
target = "evm-ethereum-london" | ||
|
||
|
||
#[(0.i8) -> 255.i8] | ||
#[(255.i8) -> 0.i8] | ||
func private %not(v0.i8) -> i8 { | ||
block0: | ||
v1.i8 = not v0; | ||
return v1; | ||
} | ||
|
||
#[(255.i32, 250.i32) -> 505.i32] | ||
#[(-1.i32, 1.i32) -> 0.i32] | ||
func private %add(v0.i32, v1.i32) -> i32 { | ||
block0: | ||
v2.i32 = add v0 v1; | ||
return v2; | ||
} | ||
|
||
|
||
#[(1.i32, 1.i32) -> 0.i32] | ||
#[(-1.i32, -1.i32) -> 0.i32] | ||
func private %sub(v0.i32, v1.i32) -> i32 { | ||
block0: | ||
v2.i32 = sub v0 v1; | ||
return v2; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
target = "evm-ethereum-london" | ||
|
||
|
||
func public %mult_by_two(v0.i8) -> i8 { | ||
block0: | ||
v1.i8 = mul v0 2.i8; | ||
return v1; | ||
} | ||
|
||
#[(0.i8) -> 0.i8] | ||
#[(2.i8) -> 4.i8] | ||
func public %call_test(v0.i8) -> i8 { | ||
block0: | ||
v1.i8 = call %mult_by_two v0; | ||
return v1; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
target = "evm-ethereum-london" | ||
|
||
#[() -> 0.i1] | ||
func private %jump() -> i1 { | ||
block0: | ||
jump block2; | ||
block1: | ||
return 1.i1; | ||
block2: | ||
return 0.i1; | ||
} | ||
|
||
#[(1.i1) -> 1.i8] | ||
#[(0.i1) -> 2.i8] | ||
func private %branch(v0.i1) -> i8 { | ||
block0: | ||
br v0 block1 block2; | ||
block1: | ||
return 1.i8; | ||
block2: | ||
return 2.i8; | ||
} | ||
|
||
#[(3.i64) -> 1.i64] | ||
#[(10.i64) -> 2.i64] | ||
#[(0.i64) -> 3.i64] | ||
#[(20.i64) -> 3.i64] | ||
func private %br_table(v0.i64) -> i64 { | ||
block0: | ||
br_table v0 block3 (3.i64 block1) (10.i64 block2); | ||
block1: | ||
return 1.i64; | ||
block2: | ||
return 2.i64; | ||
block3: | ||
return 3.i64; | ||
} | ||
|
||
|
||
#[(0.i1) -> 1.i8] | ||
#[(1.i1) -> -1.i8] | ||
func private %simple_phi(v0.i1) -> i8 { | ||
block0: | ||
br v0 block1 block2; | ||
block1: | ||
jump block2; | ||
block2: | ||
v1.i8 = phi (1.i8 block0) (-1.i8 block1); | ||
return v1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
target = "evm-ethereum-london" | ||
|
||
#[(10.i256, 255.i8) -> 255.i8] | ||
func private %store_load(v0.i256, v1.i8) -> i8 { | ||
block0: | ||
v2.*i8 = int_to_ptr v0 *i8; | ||
mstore v2 v1 i8; | ||
v3.i8 = mload v2 i8; | ||
return v3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
target = "evm-ethereum-london" | ||
|
||
type @s1 = {i32, i64, i1}; | ||
type @nested = {i32, [i16; 3], [i8; 2]}; | ||
|
||
#[(0.i256) -> 12.i256] | ||
#[(8.i256) -> 20.i256] | ||
func private %gep_basic(v0.i256) -> i256 { | ||
block0: | ||
v1.*@s1 = int_to_ptr v0 *@s1; | ||
v2.*i1 = gep v1 0.i256 2.i256; | ||
v3.i256 = ptr_to_int v2 i256; | ||
return v3; | ||
} | ||
|
||
|
||
#[(0.i256) -> 64.i256] | ||
func private %gep_ptr_ty(v0.i256) -> i256 { | ||
block0: | ||
v1.*[*i32; 3] = int_to_ptr v0 *[*i32; 3]; | ||
v2.**i32 = gep v1 0.i256 2.i256; | ||
v3.i256 = ptr_to_int v2 i256; | ||
return v3; | ||
} | ||
|
||
|
||
#[(0.i256) -> 11.i256] | ||
func private %gep_aggregate(v0.i256) -> i256 { | ||
block0: | ||
v1.*@nested = int_to_ptr v0 *@nested; | ||
v2.*i8 = gep v1 0.i256 2.i256 1.i256; | ||
v3.i256 = ptr_to_int v2 i256; | ||
return v3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters