mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extracted some test cases from SolidityEndToEnd.cpp
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
contract C {
|
||||
struct str { uint8 a; uint16 b; uint8 c; }
|
||||
uint8 x;
|
||||
uint16 y;
|
||||
str data;
|
||||
function test() public returns (uint) {
|
||||
x = 1;
|
||||
y = 2;
|
||||
data.a = 2;
|
||||
data.b = 0xabcd;
|
||||
data.c = 0xfa;
|
||||
if (x != 1 || y != 2 || data.a != 2 || data.b != 0xabcd || data.c != 0xfa)
|
||||
return 2;
|
||||
delete y;
|
||||
delete data.b;
|
||||
if (x != 1 || y != 0 || data.a != 2 || data.b != 0 || data.c != 0xfa)
|
||||
return 3;
|
||||
delete x;
|
||||
delete data;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 1
|
||||
// storageEmpty -> 1
|
||||
Reference in New Issue
Block a user