aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r--test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol11
-rw-r--r--test/libsolidity/syntaxTests/inlineAssembly/storage_reference_fine.sol11
2 files changed, 22 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol
new file mode 100644
index 00000000..55c83674
--- /dev/null
+++ b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference.sol
@@ -0,0 +1,11 @@
+contract C {
+ uint[] x;
+ function() public {
+ uint[] storage y = x;
+ assembly {
+ pop(y)
+ }
+ }
+}
+// ----
+// 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)
+ }
+ }
+}
+// ----