mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9614 from ethereum/yul-hex
Update tests/documentation to show that hex literals are not supported in Yul
This commit is contained in:
@@ -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.
|
||||
@@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
switch codesize()
|
||||
case "1" {}
|
||||
case "2" {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user