Skip to content

Commit 5ba0bd1

Browse files
committed
tests/run-tests.py: Detect inlineasm support and add tests if needed.
This PR implements a method to detect at runtime if inline assembler support is enabled, and if so which platform it targets. This allows clean test runs even on modified version of Arm-based ports where inline assembler support is disabled, running inline assembler tests on ports that have such feature not enabled by default and manually enabled, and allows to always run the correct inlineasm tests for ports that support more than one architecture (esp32, qemu, rp2). Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
1 parent 0fa9979 commit 5ba0bd1

12 files changed

+68
-36
lines changed

ports/qemu/boards/MICROBIT.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ LDSCRIPT = mcu/arm/nrf51.ld
1111
SRC_BOARD_O = shared/runtime/gchelper_native.o shared/runtime/gchelper_thumb1.o
1212

1313
MPY_CROSS_FLAGS += -march=armv7m
14-
15-
# These RV32 tests don't run on Thumb, so exclude them.
16-
RUN_TESTS_ARGS = --exclude 'inlineasm/rv32'

ports/qemu/boards/MPS2_AN385.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ LDSCRIPT = mcu/arm/mps2.ld
1010
SRC_BOARD_O = shared/runtime/gchelper_native.o shared/runtime/gchelper_thumb2.o
1111

1212
MPY_CROSS_FLAGS += -march=armv7m
13-
14-
# These RV32 tests don't run on Thumb, so exclude them.
15-
RUN_TESTS_ARGS = --exclude 'inlineasm/rv32'

ports/qemu/boards/NETDUINO2.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ LDSCRIPT = mcu/arm/stm32.ld
1010
SRC_BOARD_O = shared/runtime/gchelper_native.o shared/runtime/gchelper_thumb2.o
1111

1212
MPY_CROSS_FLAGS += -march=armv7m
13-
14-
# These RV32 tests don't run on Thumb, so exclude them.
15-
RUN_TESTS_ARGS = --exclude 'inlineasm/rv32'

ports/qemu/boards/SABRELITE.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ SRC_BOARD_O = shared/runtime/gchelper_generic.o
1616
MPY_CROSS_FLAGS += -march=armv6
1717

1818
# These tests don't work on Cortex-A9, so exclude them.
19-
RUN_TESTS_ARGS = --exclude 'inlineasm/rv32|inlineasm/thumb/(asmdiv|asmspecialregs).py'
19+
RUN_TESTS_ARGS = --exclude 'inlineasm/thumb/(asmdiv|asmspecialregs).py'

ports/qemu/boards/VIRT_RV32.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ LDSCRIPT = mcu/rv32/virt.ld
99
SRC_BOARD_O += shared/runtime/gchelper_native.o shared/runtime/gchelper_rv32i.o
1010

1111
MPY_CROSS_FLAGS += -march=rv32imc
12-
13-
# These Thumb tests don't run on RV32, so exclude them.
14-
RUN_TESTS_ARGS = --exclude 'inlineasm/thumb'

tests/feature_check/inlineasm_rv32.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# check if RISC-V 32 inline asm is supported
2+
3+
4+
@micropython.asm_rv32
5+
def f():
6+
add(a0, a0, a0)
7+
8+
9+
print("rv32")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rv32
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# check if Thumb inline asm is supported
2+
3+
4+
@micropython.asm_thumb
5+
def f():
6+
nop()
7+
8+
9+
print("thumb")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
thumb
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# check if Xtensa inline asm is supported
2+
3+
4+
@micropython.asm_xtensa
5+
def f():
6+
ret_n()
7+
8+
9+
print("xtensa")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy