diff options
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) + } + } +} +// ---- |