aboutsummaryrefslogtreecommitdiff
path: root/tests/micropython
diff options
context:
space:
mode:
authorDamien George2014-08-15 23:47:59 +0100
committerDamien George2014-08-15 23:47:59 +0100
commite6c0dff9671c493e9a13a22a1b8902dee88da064 (patch)
tree5f703c1264160f9c752f8ecb0e0683ddf7e0e622 /tests/micropython
parenta5190a7dac7a73e676d6d649035f846ea92d2d2d (diff)
py: Viper can now store to global.
Diffstat (limited to 'tests/micropython')
-rw-r--r--tests/micropython/viper.py8
-rw-r--r--tests/micropython/viper.py.exp1
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/micropython/viper.py b/tests/micropython/viper.py
index 2ed70ade6..36849abaf 100644
--- a/tests/micropython/viper.py
+++ b/tests/micropython/viper.py
@@ -29,6 +29,13 @@ def viper_sum(a:int, b:int) -> int:
total += x
return total
+# accessing a global
+@micropython.viper
+def access_global():
+ global gl
+ gl = 1
+ return gl
+
# this doesn't work at the moment
#@micropython.viper
#def g() -> uint:
@@ -39,3 +46,4 @@ print(g(1, 2))
print(h(3))
print(i(4, 5))
print(viper_sum(10, 10000))
+print(access_global(), gl)
diff --git a/tests/micropython/viper.py.exp b/tests/micropython/viper.py.exp
index 6ee698f66..4c308316b 100644
--- a/tests/micropython/viper.py.exp
+++ b/tests/micropython/viper.py.exp
@@ -3,3 +3,4 @@
7
20
49994955
+1 1