InlineAssembly: Extracting tests for if statement

This commit is contained in:
Christian Parpart
2020-11-04 12:03:33 +01:00
parent 8270af8560
commit 6f872dbebf
8 changed files with 46 additions and 27 deletions
@@ -0,0 +1,8 @@
{
{ if 42 {} }
{ if 42 { let x := 3 } }
{ function f() -> x {} if f() { pop(f()) } }
{ let x := 0 if eq(calldatasize(), 0) { x := 1 } mstore(0, x) }
}
// ====
// dialect: evm
@@ -0,0 +1,5 @@
{
if mload {}
}
// ----
// ParserError 2314: (15-16): Expected '(' but got '{'
@@ -0,0 +1,7 @@
{
if mstore(1, 1) {}
}
// ====
// dialect: evm
// ----
// TypeError 3950: (6-18): Expected expression to evaluate to one value, but got 0 values instead.
@@ -0,0 +1,7 @@
{
if 32 let x := 3
}
// ====
// dialect: yul
// ----
// ParserError 2314: (12-15): Expected '{' but got reserved keyword 'let'
@@ -0,0 +1,5 @@
{
if calldatasize {}
}
// ----
// ParserError 2314: (22-23): Expected '(' but got '{'
@@ -0,0 +1,6 @@
{
let x := 2
if 42 { x := 3 }
}
// ====
// dialect: evm
@@ -0,0 +1,8 @@
{
if 32 { let x := 3 }
x := 2
}
// ====
// dialect: evm
// ----
// DeclarationError 4634: (25-26): Variable not found or variable not lvalue.