diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-17 17:57:33 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-17 17:57:33 +0000 |
commit | 391db8669b77e50eebe4d1583749430a3549fab7 (patch) | |
tree | 147c05c57016c20ebcbae74db22236cff09d0208 /tests/basics/ifcond.py | |
parent | 235f9b33c81e5f60f1d5b975528353bae667007c (diff) | |
download | micropython-391db8669b77e50eebe4d1583749430a3549fab7.tar.gz micropython-391db8669b77e50eebe4d1583749430a3549fab7.zip |
py: Add more compiler optimisations for constant if/while conditions.
Diffstat (limited to 'tests/basics/ifcond.py')
-rw-r--r-- | tests/basics/ifcond.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/basics/ifcond.py b/tests/basics/ifcond.py index 9101c3859f..911440efa2 100644 --- a/tests/basics/ifcond.py +++ b/tests/basics/ifcond.py @@ -1,5 +1,38 @@ # test if conditions which are optimised by the compiler +if 0: + print(5) +else: + print(6) + +if 1: + print(7) + +if 2: + print(8) + +if -1: + print(9) +elif 1: + print(10) + +if 0: + print(11) +else: + print(12) + +if 0: + print(13) +elif 1: + print(14) + +if 0: + print(15) +elif 0: + print(16) +else: + print(17) + f2 = 0 def f(t1, t2, f1): |