summaryrefslogtreecommitdiff
path: root/tests/micropython/native_while.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython/native_while.py')
-rw-r--r--tests/micropython/native_while.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/micropython/native_while.py b/tests/micropython/native_while.py
new file mode 100644
index 000000000..ccf0ae0e0
--- /dev/null
+++ b/tests/micropython/native_while.py
@@ -0,0 +1,13 @@
+# test native while loop
+
+
+@micropython.native
+def f(n):
+ i = 0
+ while i < n:
+ print(i)
+ i += 1
+
+
+f(2)
+f(4)