mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add tests showing hex literals are not allowed in Yul
This commit is contained in:
parent
e68d16d8e0
commit
acb1e8c280
@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
let x := hex"0011"
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 1856: (72-81): Literal or identifier expected.
|
@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
pop(hex"2233")
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 1856: (67-76): Literal or identifier expected.
|
@ -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.
|
5
test/libyul/yulSyntaxTests/hex_assignment.yul
Normal file
5
test/libyul/yulSyntaxTests/hex_assignment.yul
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
let x := hex"0011"
|
||||
}
|
||||
// ----
|
||||
// ParserError 1856: (15-24): Literal or identifier expected.
|
5
test/libyul/yulSyntaxTests/hex_expression.yul
Normal file
5
test/libyul/yulSyntaxTests/hex_expression.yul
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
pop(hex"2233")
|
||||
}
|
||||
// ----
|
||||
// ParserError 1856: (10-19): Literal or identifier expected.
|
7
test/libyul/yulSyntaxTests/hex_switch_case.yul
Normal file
7
test/libyul/yulSyntaxTests/hex_switch_case.yul
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
switch codesize()
|
||||
case hex"00" {}
|
||||
case hex"1122" {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 1856: (33-40): Literal or identifier expected.
|
Loading…
Reference in New Issue
Block a user