diff options
author | D-Nice <D-Nice@users.noreply.github.com> | 2018-06-29 04:45:53 +0800 |
---|---|---|
committer | D-Nice <D-Nice@users.noreply.github.com> | 2018-06-29 04:45:53 +0800 |
commit | 3cad417710bc95a66d801a432f33c3befee390c9 (patch) | |
tree | 0fef00a91c2b8a7e2e21e1382b2d202e0be8c298 /test/libsolidity/syntaxTests/inlineAssembly | |
parent | d62476fb1f3c0e9399c413c988d50feb50821ef1 (diff) | |
download | dexon-solidity-3cad417710bc95a66d801a432f33c3befee390c9.tar.gz dexon-solidity-3cad417710bc95a66d801a432f33c3befee390c9.tar.zst dexon-solidity-3cad417710bc95a66d801a432f33c3befee390c9.zip |
Add passing test case
Diffstat (limited to 'test/libsolidity/syntaxTests/inlineAssembly')
-rw-r--r-- | test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol | 4 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol index 7b56102f..55c83674 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol @@ -1,6 +1,6 @@ contract C { uint[] x; - function() { + function() public { uint[] storage y = x; assembly { pop(y) @@ -8,4 +8,4 @@ contract C { } } // ---- -// TypeError: (110-111): You have to use the _slot or _offset suffix to access storage reference variables. +// TypeError: (117-118): You have to use the _slot or _offset suffix to access storage reference variables. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol new file mode 100644 index 00000000..3ae24b34 --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol @@ -0,0 +1,11 @@ +contract C { + uint[] x; + function() public { + uint[] storage y = x; + assembly { + pop(y_slot) + pop(y_offset) + } + } +} +// ---- |