2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
enum X {A, B}
|
|
|
|
X public x;
|
|
|
|
|
|
|
|
function test_store() public returns (uint256) {
|
|
|
|
X garbled = X.A;
|
|
|
|
assembly {
|
|
|
|
garbled := 5
|
|
|
|
}
|
|
|
|
x = garbled;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_store_ok() public returns (uint256) {
|
|
|
|
x = X.A;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2020-10-13 11:28:39 +00:00
|
|
|
// ====
|
2020-11-02 19:53:42 +00:00
|
|
|
// 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
|
|
|
// ----
|
|
|
|
// test_store_ok() -> 1
|
|
|
|
// x() -> 0
|
2020-10-13 11:28:39 +00:00
|
|
|
// test_store() -> FAILURE, hex"4e487b71", 33 # should throw #
|