summaryrefslogtreecommitdiff
path: root/tests/micropython/const.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython/const.py')
-rw-r--r--tests/micropython/const.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/micropython/const.py b/tests/micropython/const.py
new file mode 100644
index 000000000..457365c50
--- /dev/null
+++ b/tests/micropython/const.py
@@ -0,0 +1,11 @@
+# test constant optimisation
+
+X = const(123)
+Y = const(X + 456)
+
+print(X, Y + 1)
+
+def f():
+ print(X, Y + 1)
+
+f()