From d30d5c99afba705e8286e9177768e0e38db59fff Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 6 Dec 2023 16:05:37 +1100 Subject: [PATCH] tests/run-tests.py: Skip Thumb2 tests if target doesn't support them. Signed-off-by: Damien George --- tests/feature_check/inlineasm_thumb2.py | 10 ++++++++++ tests/feature_check/inlineasm_thumb2.py.exp | 1 + tests/run-tests.py | 15 +++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 tests/feature_check/inlineasm_thumb2.py create mode 100644 tests/feature_check/inlineasm_thumb2.py.exp diff --git a/tests/feature_check/inlineasm_thumb2.py b/tests/feature_check/inlineasm_thumb2.py new file mode 100644 index 0000000000..bc4c128baf --- /dev/null +++ b/tests/feature_check/inlineasm_thumb2.py @@ -0,0 +1,10 @@ +# check if Thumb2/ARMV7M instructions are supported + + +@micropython.asm_thumb +def f(): + it(eq) + nop() + + +print("thumb2") diff --git a/tests/feature_check/inlineasm_thumb2.py.exp b/tests/feature_check/inlineasm_thumb2.py.exp new file mode 100644 index 0000000000..05d125af9f --- /dev/null +++ b/tests/feature_check/inlineasm_thumb2.py.exp @@ -0,0 +1 @@ +thumb2 diff --git a/tests/run-tests.py b/tests/run-tests.py index 2d511c20ca..2dc387946c 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -465,6 +465,21 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1): if output != b"a=1\n": skip_fstring = True + # Check if @micropython.asm_thumb supports Thumb2 instructions, and skip such tests if it doesn't + output = run_feature_check(pyb, args, base_path, "inlineasm_thumb2.py") + if output != b"thumb2\n": + skip_tests.add("inlineasm/asmbcc.py") + skip_tests.add("inlineasm/asmbitops.py") + skip_tests.add("inlineasm/asmconst.py") + skip_tests.add("inlineasm/asmdiv.py") + skip_tests.add("inlineasm/asmfpaddsub.py") + skip_tests.add("inlineasm/asmfpcmp.py") + skip_tests.add("inlineasm/asmfpldrstr.py") + skip_tests.add("inlineasm/asmfpmuldiv.py") + skip_tests.add("inlineasm/asmfpsqrt.py") + skip_tests.add("inlineasm/asmit.py") + skip_tests.add("inlineasm/asmspecialregs.py") + # Check if emacs repl is supported, and skip such tests if it's not t = run_feature_check(pyb, args, base_path, "repl_emacs_check.py") if "True" not in str(t, "ascii"):