mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
InlineAssembly: Extracting tests for variable declaration
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
let x := 7
|
||||
}
|
||||
// ====
|
||||
// dialect: yul
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
let x := true
|
||||
let y := false
|
||||
}
|
||||
// ====
|
||||
// dialect: evm
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
let y := 2
|
||||
let x := add(add(7, mul(6, y)), mul(7, 8))
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
let x
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
function f() -> x, y {}
|
||||
let x, y := f()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
function f() -> x, y {}
|
||||
let x, x := f()
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1395: (28-43): Variable name x already taken in this scope.
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
let x := 1
|
||||
let x := 2
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1395: (15-25): Variable name x already taken in this scope.
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
x := 2
|
||||
let x := 3
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1133: (3-4): Variable x used before it was declared.
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
let x := mul(2, x)
|
||||
}
|
||||
|
||||
// ----
|
||||
// DeclarationError 4990: (19-20): Variable x used before it was declared.
|
||||
Reference in New Issue
Block a user