diff --git a/test/libsolidity/semanticTests/inlineAssembly/shielded_cstore_then_sstore.sol b/test/libsolidity/semanticTests/inlineAssembly/shielded_cstore_then_sstore.sol new file mode 100644 index 000000000..8e6283fad --- /dev/null +++ b/test/libsolidity/semanticTests/inlineAssembly/shielded_cstore_then_sstore.sol @@ -0,0 +1,16 @@ +contract C { + suint256 a; + + function f1() public { + a = suint(7); + } + + function f() public returns (uint256 x) { + assembly { + sstore(a.slot, 42) + } + } +} +// ---- +// f1() +// f() -> FAILURE diff --git a/test/libsolidity/semanticTests/inlineAssembly/shielded_sstore_then_cload.sol b/test/libsolidity/semanticTests/inlineAssembly/shielded_sstore_then_cload.sol index 5ce8f0086..6eaca4b7f 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/shielded_sstore_then_cload.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/shielded_sstore_then_cload.sol @@ -13,4 +13,4 @@ contract C { } // ---- // f1() -// f() -> FAILURE +// f() -> 7 diff --git a/test/libsolidity/semanticTests/inlineAssembly/shielded_sstore_then_cstore.sol b/test/libsolidity/semanticTests/inlineAssembly/shielded_sstore_then_cstore.sol new file mode 100644 index 000000000..3d7986945 --- /dev/null +++ b/test/libsolidity/semanticTests/inlineAssembly/shielded_sstore_then_cstore.sol @@ -0,0 +1,22 @@ +contract C { + uint256 a; + + function set() public { + a = 7; + } + + function deletea() public { + delete a; + } + + function f() public { + assembly { + cstore(a.slot, 42) + } + } +} +// ---- +// set() +// f() -> FAILURE +// deletea() +// f() diff --git a/test/libsolidity/semanticTests/inlineAssembly/sstore_then_cload_no_optimize.sol b/test/libsolidity/semanticTests/inlineAssembly/sstore_then_cload_no_optimize.sol index b7bdab03d..c8cd40cf3 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/sstore_then_cload_no_optimize.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/sstore_then_cload_no_optimize.sol @@ -7,4 +7,4 @@ contract C { } } // ---- -// f() -> FAILURE +// f() -> 42