InlineAssembly: Extracting tests for for-statements.

This commit is contained in:
Christian Parpart
2020-11-04 12:03:33 +01:00
parent 671b1c950e
commit f2117b87f7
22 changed files with 131 additions and 41 deletions
@@ -0,0 +1,5 @@
{
for {} {} {} {}
}
// ----
// ParserError 1856: (10-11): Literal or identifier expected.
@@ -0,0 +1,5 @@
{
for 1 1 {} {}
}
// ----
// ParserError 2314: (7-8): Expected '{' but got 'Number'
@@ -0,0 +1,5 @@
{
for {} 1 1 {}
}
// ----
// ParserError 2314: (12-13): Expected '{' but got 'Number'
@@ -0,0 +1,5 @@
{
for {} 1 {} 1
}
// ----
// ParserError 2314: (15-16): Expected '{' but got 'Number'
@@ -0,0 +1,5 @@
{
for {} mload {} {}
}
// ----
// ParserError 2314: (16-17): Expected '(' but got '{'
@@ -0,0 +1,7 @@
{
for {} mstore(1, 1) {} {}
}
// ====
// dialect: evm
// ----
// TypeError 3950: (10-22): Expected expression to evaluate to one value, but got 0 values instead.
@@ -0,0 +1,10 @@
{
{ for {} 1 {} {} }
{ for { let i := 1 } lt(i, 5) { i := add(i, 1) } {} }
{ for {} 1 {} {} }
{ let x := calldatasize() for { let i := 0} lt(i, x) { i := add(i, 1) } { mstore(i, 2) } }
}
// ====
// dialect: evm
// ----
@@ -0,0 +1,5 @@
{
for { let i := 1 } i { pop(i) } { pop(i) }
}
// ====
// dialect: evm
@@ -0,0 +1,7 @@
{
for {} i { let i := 1 } {}
}
// ====
// dialect: evm
// ----
// DeclarationError 8198: (10-11): Identifier not found.
@@ -0,0 +1,7 @@
{
for {} 1 { let i := 1 } { pop(i) }
}
// ====
// dialect: evm
// ----
// DeclarationError 8198: (33-34): Identifier not found.
@@ -0,0 +1,7 @@
{
for {} 1 { pop(i) } { let i := 1 }
}
// ====
// dialect: evm
// ----
// DeclarationError 8198: (18-19): Identifier not found.
@@ -0,0 +1,7 @@
{
for { pop(i) } 1 { let i := 1 } {}
}
// ====
// dialect: evm
// ----
// DeclarationError 8198: (13-14): Identifier not found.
@@ -0,0 +1,7 @@
{
for { pop(i) } 1 { } { let i := 1 }
}
// ====
// dialect: evm
// ----
// DeclarationError 8198: (13-14): Identifier not found.
@@ -0,0 +1,7 @@
{
for {} i {} { let i := 1 }
}
// ====
// dialect: evm
// ----
// DeclarationError 8198: (10-11): Identifier not found.
@@ -0,0 +1,7 @@
{
for {} 1 { pop(i) } { let i := 1 }
}
// ====
// dialect: evm
// ----
// DeclarationError 8198: (18-19): Identifier not found.
@@ -0,0 +1,7 @@
{
for { let x := 1 } 1 { let x := 1 } {}
}
// ====
// dialect: yul
// ----
// DeclarationError 1395: (26-36): Variable name x already taken in this scope.
@@ -0,0 +1,7 @@
{
for { let x := 1 } 1 {} { let x := 1 }
}
// ====
// dialect: yul
// ----
// DeclarationError 1395: (29-39): Variable name x already taken in this scope.
@@ -0,0 +1,5 @@
{
let x := 1 for { let x := 1 } 1 {} {}
}
// ----
// DeclarationError 1395: (20-30): Variable name x already taken in this scope.
@@ -0,0 +1,5 @@
{
let x := 1 for {} 1 { let x := 1 } {}
}
// ----
// DeclarationError 1395: (25-35): Variable name x already taken in this scope.
@@ -0,0 +1,5 @@
{
let x := 1 for {} 1 {} { let x := 1 }
}
// ----
// DeclarationError 1395: (28-38): Variable name x already taken in this scope.
@@ -0,0 +1,6 @@
{
// Check that body and post are not sub-scopes of each other.
for {} 1 { let x := 1 } { let x := 1 }
}
// ====
// dialect: evm