circuitpython/tests/micropython/opt_level.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
340 B
Python
Raw Normal View History

2023-08-22 11:15:46 -04:00
import micropython
# check we can get and set the level
micropython.opt_level(0)
print(micropython.opt_level())
micropython.opt_level(1)
print(micropython.opt_level())
# check that the optimisation levels actually differ
micropython.opt_level(0)
2021-03-15 09:57:36 -04:00
exec("print(__debug__)")
micropython.opt_level(1)
2021-03-15 09:57:36 -04:00
exec("print(__debug__)")
exec("assert 0")