mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 04:00:28 +01:00
qemu: Rename qemu-arm port to qemu.
Because this port now supports multiple architectures. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
31
ports/qemu/test-frzmpy/frozen_asm.py
Normal file
31
ports/qemu/test-frzmpy/frozen_asm.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Test freezing inline-asm code.
|
||||
|
||||
# ruff: noqa: F821 - @asm_thumb decorator adds names to function scope
|
||||
|
||||
import micropython
|
||||
|
||||
|
||||
@micropython.asm_thumb
|
||||
def asm_add(r0, r1):
|
||||
add(r0, r0, r1)
|
||||
|
||||
|
||||
@micropython.asm_thumb
|
||||
def asm_add1(r0) -> object:
|
||||
lsl(r0, r0, 1)
|
||||
add(r0, r0, 3)
|
||||
|
||||
|
||||
@micropython.asm_thumb
|
||||
def asm_cast_bool(r0) -> bool:
|
||||
pass
|
||||
|
||||
|
||||
@micropython.asm_thumb
|
||||
def asm_shift_int(r0) -> int:
|
||||
lsl(r0, r0, 29)
|
||||
|
||||
|
||||
@micropython.asm_thumb
|
||||
def asm_shift_uint(r0) -> uint:
|
||||
lsl(r0, r0, 29)
|
||||
11
ports/qemu/test-frzmpy/frozen_const.py
Normal file
11
ports/qemu/test-frzmpy/frozen_const.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Test freezing constants.
|
||||
|
||||
x0 = (1,)
|
||||
x1 = (1, 2)
|
||||
x2 = (1, 1 << 100)
|
||||
x3 = (None, False, True, ...)
|
||||
x4 = ("str", b"bytes")
|
||||
x5 = ((),)
|
||||
x6 = ((1,),)
|
||||
x7 = ((1, 2),)
|
||||
x8 = (1, "str", (), ("nested", 2, ((False, True), None, ...)))
|
||||
8
ports/qemu/test-frzmpy/frozen_viper.py
Normal file
8
ports/qemu/test-frzmpy/frozen_viper.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# Test freezing viper code.
|
||||
|
||||
import micropython
|
||||
|
||||
|
||||
@micropython.viper
|
||||
def viper_add(x, y):
|
||||
print(x + y)
|
||||
16
ports/qemu/test-frzmpy/native_frozen_align.py
Normal file
16
ports/qemu/test-frzmpy/native_frozen_align.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import micropython
|
||||
|
||||
|
||||
@micropython.native
|
||||
def native_x(x):
|
||||
print(x + 1)
|
||||
|
||||
|
||||
@micropython.native
|
||||
def native_y(x):
|
||||
print(x + 1)
|
||||
|
||||
|
||||
@micropython.native
|
||||
def native_z(x):
|
||||
print(x + 1)
|
||||
Reference in New Issue
Block a user