2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
enum X {A, B}
|
|
|
|
|
|
|
|
function test_eq() public returns (bool) {
|
|
|
|
X garbled;
|
|
|
|
assembly {
|
|
|
|
garbled := 5
|
|
|
|
}
|
|
|
|
return garbled == garbled;
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_eq_ok() public returns (bool) {
|
|
|
|
X garbled = X.A;
|
|
|
|
return garbled == garbled;
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_neq() public returns (bool) {
|
|
|
|
X garbled;
|
|
|
|
assembly {
|
|
|
|
garbled := 5
|
|
|
|
}
|
|
|
|
return garbled != garbled;
|
|
|
|
}
|
|
|
|
}
|
2020-05-05 15:22:54 +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_eq_ok() -> 1
|
2020-10-13 11:28:39 +00:00
|
|
|
// test_eq() -> FAILURE, hex"4e487b71", 33 # both should throw #
|
|
|
|
// test_neq() -> FAILURE, hex"4e487b71", 33
|