2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
enum X {A, B}
|
|
|
|
|
|
|
|
function test_return() public returns (X) {
|
|
|
|
X garbled;
|
|
|
|
assembly {
|
|
|
|
garbled := 5
|
|
|
|
}
|
|
|
|
return garbled;
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_inline_assignment() public returns (X _ret) {
|
|
|
|
assembly {
|
|
|
|
_ret := 5
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_assignment() public returns (X _ret) {
|
|
|
|
X tmp;
|
|
|
|
assembly {
|
|
|
|
tmp := 5
|
|
|
|
}
|
|
|
|
_ret = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2020-10-13 11:28:39 +00:00
|
|
|
// EVMVersion: >=byzantium
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
2020-10-13 11:28:39 +00:00
|
|
|
// test_return() -> FAILURE, hex"4e487b71", 33 # both should throw #
|
|
|
|
// test_inline_assignment() -> FAILURE, hex"4e487b71", 33
|
|
|
|
// test_assignment() -> FAILURE, hex"4e487b71", 33
|