Add tests showing hex literals are not allowed in Yul

This commit is contained in:
Alex Beregszaszi 2020-08-12 23:58:21 +01:00
parent e68d16d8e0
commit acb1e8c280
6 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
let x := hex"0011"
}
}
}
// ----
// ParserError 1856: (72-81): Literal or identifier expected.

View File

@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
pop(hex"2233")
}
}
}
// ----
// ParserError 1856: (67-76): Literal or identifier expected.

View File

@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
switch codesize()
case hex"00" {}
case hex"1122" {}
}
}
}
// ----
// ParserError 1856: (92-99): Literal or identifier expected.

View File

@ -0,0 +1,5 @@
{
let x := hex"0011"
}
// ----
// ParserError 1856: (15-24): Literal or identifier expected.

View File

@ -0,0 +1,5 @@
{
pop(hex"2233")
}
// ----
// ParserError 1856: (10-19): Literal or identifier expected.

View File

@ -0,0 +1,7 @@
{
switch codesize()
case hex"00" {}
case hex"1122" {}
}
// ----
// ParserError 1856: (33-40): Literal or identifier expected.