From c53c0f5c58d9105e843fa2bff0f73c3969241912 Mon Sep 17 00:00:00 2001 From: Jonatan Antoni Date: Mon, 27 Nov 2023 13:32:36 +0100 Subject: [PATCH] Restructure Core tests - Move tests into src subfolder - Use temp directory for intermediate object files - Include test report in matrix summary --- CMSIS/Core/Test/README.md | 0 CMSIS/Core/Test/bkpt.c | 10 ---------- CMSIS/Core/Test/build.py | 11 ++++++++--- CMSIS/Core/Test/dmb.c | 11 ----------- CMSIS/Core/Test/dsb.c | 11 ----------- CMSIS/Core/Test/isb.c | 11 ----------- CMSIS/Core/Test/lit.cfg.py | 6 +++--- CMSIS/Core/Test/nop.c | 10 ---------- CMSIS/Core/Test/sev.c | 11 ----------- CMSIS/Core/Test/{ => src}/apsr.c | 2 +- CMSIS/Core/Test/{ => src}/basepri.c | 2 +- CMSIS/Core/Test/src/bkpt.c | 10 ++++++++++ CMSIS/Core/Test/{ => src}/clrex.c | 2 +- CMSIS/Core/Test/{ => src}/clz.c | 2 +- CMSIS/Core/Test/{ => src}/control.c | 2 +- CMSIS/Core/Test/{ => src}/cp15.c | 2 +- CMSIS/Core/Test/{ => src}/cpsr.c | 2 +- CMSIS/Core/Test/src/dmb.c | 11 +++++++++++ CMSIS/Core/Test/src/dsb.c | 11 +++++++++++ CMSIS/Core/Test/{ => src}/fault_irq.c | 2 +- CMSIS/Core/Test/{ => src}/faultmask.c | 2 +- CMSIS/Core/Test/{ => src}/fpexc.c | 2 +- CMSIS/Core/Test/{ => src}/fpexc_nofp.c | 2 +- CMSIS/Core/Test/{ => src}/fpscr.c | 2 +- CMSIS/Core/Test/{ => src}/fpscr_nofp.c | 2 +- CMSIS/Core/Test/{ => src}/ipsr.c | 2 +- CMSIS/Core/Test/{ => src}/irq.c | 2 +- CMSIS/Core/Test/src/isb.c | 11 +++++++++++ CMSIS/Core/Test/{ => src}/lda.c | 2 +- CMSIS/Core/Test/{ => src}/ldaex.c | 2 +- CMSIS/Core/Test/{ => src}/ldrex.c | 2 +- CMSIS/Core/Test/{ => src}/ldrt.c | 2 +- CMSIS/Core/Test/{ => src}/msp.c | 2 +- CMSIS/Core/Test/{ => src}/msplim.c | 2 +- CMSIS/Core/Test/src/nop.c | 10 ++++++++++ CMSIS/Core/Test/{ => src}/noreturn.c | 2 +- CMSIS/Core/Test/{ => src}/primask.c | 2 +- CMSIS/Core/Test/{ => src}/psp.c | 2 +- CMSIS/Core/Test/{ => src}/psplim.c | 2 +- CMSIS/Core/Test/{ => src}/psplim_baseline.c | 2 +- CMSIS/Core/Test/{ => src}/rbit.c | 2 +- CMSIS/Core/Test/{ => src}/rev.c | 2 +- CMSIS/Core/Test/{ => src}/rev16.c | 2 +- CMSIS/Core/Test/{ => src}/revsh.c | 2 +- CMSIS/Core/Test/{ => src}/ror.c | 2 +- CMSIS/Core/Test/{ => src}/rrx.c | 2 +- CMSIS/Core/Test/{ => src}/sat.c | 2 +- CMSIS/Core/Test/src/sev.c | 11 +++++++++++ CMSIS/Core/Test/{ => src}/simd.c | 2 +- CMSIS/Core/Test/{ => src}/sp.c | 2 +- CMSIS/Core/Test/{ => src}/sp_ns.c | 2 +- CMSIS/Core/Test/{ => src}/stl.c | 2 +- CMSIS/Core/Test/{ => src}/stlex.c | 2 +- CMSIS/Core/Test/{ => src}/strex.c | 2 +- CMSIS/Core/Test/{ => src}/strt.c | 2 +- CMSIS/Core/Test/{ => src}/systick.c | 2 +- CMSIS/Core/Test/src/wfi.c | 10 ++++++++++ CMSIS/Core/Test/{ => src}/xpsr.c | 2 +- CMSIS/Core/Test/wfi.c | 10 ---------- 59 files changed, 127 insertions(+), 122 deletions(-) create mode 100644 CMSIS/Core/Test/README.md delete mode 100644 CMSIS/Core/Test/bkpt.c delete mode 100644 CMSIS/Core/Test/dmb.c delete mode 100644 CMSIS/Core/Test/dsb.c delete mode 100644 CMSIS/Core/Test/isb.c delete mode 100644 CMSIS/Core/Test/nop.c delete mode 100644 CMSIS/Core/Test/sev.c rename CMSIS/Core/Test/{ => src}/apsr.c (57%) rename CMSIS/Core/Test/{ => src}/basepri.c (86%) create mode 100644 CMSIS/Core/Test/src/bkpt.c rename CMSIS/Core/Test/{ => src}/clrex.c (50%) rename CMSIS/Core/Test/{ => src}/clz.c (59%) rename CMSIS/Core/Test/{ => src}/control.c (84%) rename CMSIS/Core/Test/{ => src}/cp15.c (97%) rename CMSIS/Core/Test/{ => src}/cpsr.c (82%) create mode 100644 CMSIS/Core/Test/src/dmb.c create mode 100644 CMSIS/Core/Test/src/dsb.c rename CMSIS/Core/Test/{ => src}/fault_irq.c (68%) rename CMSIS/Core/Test/{ => src}/faultmask.c (84%) rename CMSIS/Core/Test/{ => src}/fpexc.c (71%) rename CMSIS/Core/Test/{ => src}/fpexc_nofp.c (72%) rename CMSIS/Core/Test/{ => src}/fpscr.c (71%) rename CMSIS/Core/Test/{ => src}/fpscr_nofp.c (73%) rename CMSIS/Core/Test/{ => src}/ipsr.c (57%) rename CMSIS/Core/Test/{ => src}/irq.c (64%) create mode 100644 CMSIS/Core/Test/src/isb.c rename CMSIS/Core/Test/{ => src}/lda.c (80%) rename CMSIS/Core/Test/{ => src}/ldaex.c (80%) rename CMSIS/Core/Test/{ => src}/ldrex.c (80%) rename CMSIS/Core/Test/{ => src}/ldrt.c (80%) rename CMSIS/Core/Test/{ => src}/msp.c (82%) rename CMSIS/Core/Test/{ => src}/msplim.c (83%) create mode 100644 CMSIS/Core/Test/src/nop.c rename CMSIS/Core/Test/{ => src}/noreturn.c (54%) rename CMSIS/Core/Test/{ => src}/primask.c (83%) rename CMSIS/Core/Test/{ => src}/psp.c (82%) rename CMSIS/Core/Test/{ => src}/psplim.c (83%) rename CMSIS/Core/Test/{ => src}/psplim_baseline.c (85%) rename CMSIS/Core/Test/{ => src}/rbit.c (60%) rename CMSIS/Core/Test/{ => src}/rev.c (57%) rename CMSIS/Core/Test/{ => src}/rev16.c (58%) rename CMSIS/Core/Test/{ => src}/revsh.c (58%) rename CMSIS/Core/Test/{ => src}/ror.c (66%) rename CMSIS/Core/Test/{ => src}/rrx.c (59%) rename CMSIS/Core/Test/{ => src}/sat.c (79%) create mode 100644 CMSIS/Core/Test/src/sev.c rename CMSIS/Core/Test/{ => src}/simd.c (98%) rename CMSIS/Core/Test/{ => src}/sp.c (84%) rename CMSIS/Core/Test/{ => src}/sp_ns.c (73%) rename CMSIS/Core/Test/{ => src}/stl.c (78%) rename CMSIS/Core/Test/{ => src}/stlex.c (81%) rename CMSIS/Core/Test/{ => src}/strex.c (81%) rename CMSIS/Core/Test/{ => src}/strt.c (78%) rename CMSIS/Core/Test/{ => src}/systick.c (68%) create mode 100644 CMSIS/Core/Test/src/wfi.c rename CMSIS/Core/Test/{ => src}/xpsr.c (57%) delete mode 100644 CMSIS/Core/Test/wfi.c diff --git a/CMSIS/Core/Test/README.md b/CMSIS/Core/Test/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/CMSIS/Core/Test/bkpt.c b/CMSIS/Core/Test/bkpt.c deleted file mode 100644 index a0682e110..000000000 --- a/CMSIS/Core/Test/bkpt.c +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s - -#include "cmsis_compiler.h" - -void bkpt() { - // CHECK-LABEL: : - // CHECK: bkpt {{#0x15|#21}} - __BKPT(0x15); - // CHECK: {{(bx lr)|(pop {.*pc})}} -} diff --git a/CMSIS/Core/Test/build.py b/CMSIS/Core/Test/build.py index 67ac8fc97..55d826abd 100755 --- a/CMSIS/Core/Test/build.py +++ b/CMSIS/Core/Test/build.py @@ -59,19 +59,24 @@ class OptimizationAxis(Enum): SIZE = ('size') +def timestamp(): + return datetime.now().strftime('%Y%m%d%H%M%S') + + @matrix_action -def lit(config): +def lit(config, results): """Run tests for the selected configurations using llvm's lit.""" yield run_lit(config.compiler[0], config.device[1], config.optimize[0]) + results[0].test_report.write(f"lit-{config.compiler[0]}-{config.optimize[0]}-{config.device[1]}-{timestamp()}.xunit") def timestamp(): return datetime.now().strftime('%Y%m%d%H%M%S') -@matrix_command() +@matrix_command(test_report=FileReport(f"lit.xml") | JUnitReport()) def run_lit(toolchain, device, optimize): - return ["lit", "--xunit-xml-output", f"lit-{toolchain}-{optimize}-{device}.xunit", "-D", f"toolchain={toolchain}", "-D", f"device={device}", "-D", f"optimize={optimize}", "." ] + return ["lit", "--xunit-xml-output", f"lit.xml", "-D", f"toolchain={toolchain}", "-D", f"device={device}", "-D", f"optimize={optimize}", "src" ] @matrix_filter diff --git a/CMSIS/Core/Test/dmb.c b/CMSIS/Core/Test/dmb.c deleted file mode 100644 index 19167de9f..000000000 --- a/CMSIS/Core/Test/dmb.c +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s - -#include "cmsis_compiler.h" - -void dmb() { - // CHECK-LABEL: : - // CHECK: dmb sy - __DMB(); - // CHECK: {{(bx lr)|(pop {.*pc})}} -} - diff --git a/CMSIS/Core/Test/dsb.c b/CMSIS/Core/Test/dsb.c deleted file mode 100644 index df8ca7403..000000000 --- a/CMSIS/Core/Test/dsb.c +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s - -#include "cmsis_compiler.h" - -void dsb() { - // CHECK-LABEL: : - // CHECK: dsb sy - __DSB(); - // CHECK: {{(bx lr)|(pop {.*pc})}} -} - diff --git a/CMSIS/Core/Test/isb.c b/CMSIS/Core/Test/isb.c deleted file mode 100644 index ebae9d839..000000000 --- a/CMSIS/Core/Test/isb.c +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s - -#include "cmsis_compiler.h" - -void isb() { - // CHECK-LABEL: : - // CHECK: isb sy - __ISB(); - // CHECK: {{(bx lr)|(pop {.*pc})}} -} - diff --git a/CMSIS/Core/Test/lit.cfg.py b/CMSIS/Core/Test/lit.cfg.py index 01fa01654..25d87dcd3 100644 --- a/CMSIS/Core/Test/lit.cfg.py +++ b/CMSIS/Core/Test/lit.cfg.py @@ -681,7 +681,7 @@ def get_cc(self): def get_ccflags(self): ccflags = [ '--target=arm-arm-none-eabi', f'-mcpu={DEVICES[self.device]["mcpu"]}', f'-mfpu={DEVICES[self.device]["mfpu"]}', - self.OPTIMIZE[self.optimize], '-I', '../Include', '-c', '-D', f'CORE_HEADER=\\"{DEVICES[device]["header"]}\\"'] + self.OPTIMIZE[self.optimize], '-I', os.path.abspath('../Include'), '-c', '-D', f'CORE_HEADER=\\"{DEVICES[device]["header"]}\\"'] if device.endswith('S') and not device.endswith('NS'): ccflags += ["-mcmse"] ccflags += list(sum([('-D', f'{define}={value}') for (define, value) in DEVICES[self.device]['defines'].items()], ())) @@ -708,7 +708,7 @@ def get_ccflags(self): floatabi='hard' ccflags = [ f'-mcpu={DEVICES[self.device]["mcpu"]}', f'-mfloat-abi={floatabi}', - self.OPTIMIZE[self.optimize], '-I', '../Include', + self.OPTIMIZE[self.optimize], '-I', os.path.abspath('../Include'), '-D', f'CORE_HEADER=\\"{DEVICES[device]["header"]}\\"', '-c'] if DEVICES[self.device]["mfpu"] != "none": ccflags += [f'-mfpu={DEVICES[self.device]["mfpu"]}'] @@ -765,7 +765,7 @@ def get_ccflags(self): ccflags = [ f'--target={self.TARGET[self.device]}', self.OPTIMIZE[self.optimize], f'-mcpu={DEVICES[self.device]["mcpu"]}', f'-mfpu={DEVICES[self.device]["mfpu"]}', - '-I', '../Include', '-c', '-D', f'CORE_HEADER=\\"{DEVICES[device]["header"]}\\"'] + '-I', os.path.abspath('../Include'), '-c', '-D', f'CORE_HEADER=\\"{DEVICES[device]["header"]}\\"'] if device.endswith('S') and not device.endswith('NS'): ccflags += ["-mcmse"] ccflags += list(sum([('-D', f'{define}={value}') for (define, value) in DEVICES[self.device]['defines'].items()], ())) diff --git a/CMSIS/Core/Test/nop.c b/CMSIS/Core/Test/nop.c deleted file mode 100644 index 33a30efc4..000000000 --- a/CMSIS/Core/Test/nop.c +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s - -#include "cmsis_compiler.h" - -void nop() { - // CHECK-LABEL: : - // CHECK: {{(nop|mov r8, r8)}} - __NOP(); - // CHECK: {{(bx lr)|(pop {.*pc})}} -} diff --git a/CMSIS/Core/Test/sev.c b/CMSIS/Core/Test/sev.c deleted file mode 100644 index f77f48009..000000000 --- a/CMSIS/Core/Test/sev.c +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s - -#include "cmsis_compiler.h" - -void sev() { - // CHECK-LABEL: : - // CHECK: sev - __SEV(); - // CHECK: {{(bx lr)|(pop {.*pc})}} -} - diff --git a/CMSIS/Core/Test/apsr.c b/CMSIS/Core/Test/src/apsr.c similarity index 57% rename from CMSIS/Core/Test/apsr.c rename to CMSIS/Core/Test/src/apsr.c index 7c1683074..028cdb70d 100644 --- a/CMSIS/Core/Test/apsr.c +++ b/CMSIS/Core/Test/src/apsr.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv6m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/basepri.c b/CMSIS/Core/Test/src/basepri.c similarity index 86% rename from CMSIS/Core/Test/basepri.c rename to CMSIS/Core/Test/src/basepri.c index 174ceea7a..a2680d78f 100644 --- a/CMSIS/Core/Test/basepri.c +++ b/CMSIS/Core/Test/src/basepri.c @@ -1,5 +1,5 @@ // REQUIRES: thumb-2, thumbv7m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/src/bkpt.c b/CMSIS/Core/Test/src/bkpt.c new file mode 100644 index 000000000..22ae5e3ff --- /dev/null +++ b/CMSIS/Core/Test/src/bkpt.c @@ -0,0 +1,10 @@ +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s + +#include "cmsis_compiler.h" + +void bkpt() { + // CHECK-LABEL: : + // CHECK: bkpt {{#0x15|#21}} + __BKPT(0x15); + // CHECK: {{(bx lr)|(pop {.*pc})}} +} diff --git a/CMSIS/Core/Test/clrex.c b/CMSIS/Core/Test/src/clrex.c similarity index 50% rename from CMSIS/Core/Test/clrex.c rename to CMSIS/Core/Test/src/clrex.c index d46091025..7c9d0bb0a 100644 --- a/CMSIS/Core/Test/clrex.c +++ b/CMSIS/Core/Test/src/clrex.c @@ -1,5 +1,5 @@ // REQUIRES: ldrex -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/clz.c b/CMSIS/Core/Test/src/clz.c similarity index 59% rename from CMSIS/Core/Test/clz.c rename to CMSIS/Core/Test/src/clz.c index 698e5b8bd..fad4719a8 100644 --- a/CMSIS/Core/Test/clz.c +++ b/CMSIS/Core/Test/src/clz.c @@ -1,5 +1,5 @@ // REQUIRES: clz -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/control.c b/CMSIS/Core/Test/src/control.c similarity index 84% rename from CMSIS/Core/Test/control.c rename to CMSIS/Core/Test/src/control.c index c4cc6f925..e0148dbff 100644 --- a/CMSIS/Core/Test/control.c +++ b/CMSIS/Core/Test/src/control.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv6m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/cp15.c b/CMSIS/Core/Test/src/cp15.c similarity index 97% rename from CMSIS/Core/Test/cp15.c rename to CMSIS/Core/Test/src/cp15.c index 7385a4afe..be272a585 100644 --- a/CMSIS/Core/Test/cp15.c +++ b/CMSIS/Core/Test/src/cp15.c @@ -1,5 +1,5 @@ // REQUIRES: armv7a -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/cpsr.c b/CMSIS/Core/Test/src/cpsr.c similarity index 82% rename from CMSIS/Core/Test/cpsr.c rename to CMSIS/Core/Test/src/cpsr.c index 7e40ff194..931c36683 100644 --- a/CMSIS/Core/Test/cpsr.c +++ b/CMSIS/Core/Test/src/cpsr.c @@ -1,5 +1,5 @@ // REQUIRES: armv7a -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/src/dmb.c b/CMSIS/Core/Test/src/dmb.c new file mode 100644 index 000000000..a86232652 --- /dev/null +++ b/CMSIS/Core/Test/src/dmb.c @@ -0,0 +1,11 @@ +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s + +#include "cmsis_compiler.h" + +void dmb() { + // CHECK-LABEL: : + // CHECK: dmb sy + __DMB(); + // CHECK: {{(bx lr)|(pop {.*pc})}} +} + diff --git a/CMSIS/Core/Test/src/dsb.c b/CMSIS/Core/Test/src/dsb.c new file mode 100644 index 000000000..c46dea7da --- /dev/null +++ b/CMSIS/Core/Test/src/dsb.c @@ -0,0 +1,11 @@ +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s + +#include "cmsis_compiler.h" + +void dsb() { + // CHECK-LABEL: : + // CHECK: dsb sy + __DSB(); + // CHECK: {{(bx lr)|(pop {.*pc})}} +} + diff --git a/CMSIS/Core/Test/fault_irq.c b/CMSIS/Core/Test/src/fault_irq.c similarity index 68% rename from CMSIS/Core/Test/fault_irq.c rename to CMSIS/Core/Test/src/fault_irq.c index a0812d3bd..18923742e 100644 --- a/CMSIS/Core/Test/fault_irq.c +++ b/CMSIS/Core/Test/src/fault_irq.c @@ -1,5 +1,5 @@ // REQUIRES: thumb-2 -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/faultmask.c b/CMSIS/Core/Test/src/faultmask.c similarity index 84% rename from CMSIS/Core/Test/faultmask.c rename to CMSIS/Core/Test/src/faultmask.c index 6c4523738..912cd5930 100644 --- a/CMSIS/Core/Test/faultmask.c +++ b/CMSIS/Core/Test/src/faultmask.c @@ -1,5 +1,5 @@ // REQUIRES: thumb-2, thumbv7m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/fpexc.c b/CMSIS/Core/Test/src/fpexc.c similarity index 71% rename from CMSIS/Core/Test/fpexc.c rename to CMSIS/Core/Test/src/fpexc.c index 4232c6a16..6ae6ca41f 100644 --- a/CMSIS/Core/Test/fpexc.c +++ b/CMSIS/Core/Test/src/fpexc.c @@ -1,5 +1,5 @@ // REQUIRES: armv7a, fpu -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/fpexc_nofp.c b/CMSIS/Core/Test/src/fpexc_nofp.c similarity index 72% rename from CMSIS/Core/Test/fpexc_nofp.c rename to CMSIS/Core/Test/src/fpexc_nofp.c index bd35279d8..063f13092 100644 --- a/CMSIS/Core/Test/fpexc_nofp.c +++ b/CMSIS/Core/Test/src/fpexc_nofp.c @@ -1,6 +1,6 @@ // REQUIRES: armv7a // UNSUPPORTED: fpu -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/fpscr.c b/CMSIS/Core/Test/src/fpscr.c similarity index 71% rename from CMSIS/Core/Test/fpscr.c rename to CMSIS/Core/Test/src/fpscr.c index 5b262fa9c..9d7b1361c 100644 --- a/CMSIS/Core/Test/fpscr.c +++ b/CMSIS/Core/Test/src/fpscr.c @@ -1,5 +1,5 @@ // REQUIRES: fpu -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/fpscr_nofp.c b/CMSIS/Core/Test/src/fpscr_nofp.c similarity index 73% rename from CMSIS/Core/Test/fpscr_nofp.c rename to CMSIS/Core/Test/src/fpscr_nofp.c index 4ceb4cd1f..4fb8c6050 100644 --- a/CMSIS/Core/Test/fpscr_nofp.c +++ b/CMSIS/Core/Test/src/fpscr_nofp.c @@ -1,5 +1,5 @@ // UNSUPPORTED: fpu -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/ipsr.c b/CMSIS/Core/Test/src/ipsr.c similarity index 57% rename from CMSIS/Core/Test/ipsr.c rename to CMSIS/Core/Test/src/ipsr.c index 3e6d9da73..173b3ed08 100644 --- a/CMSIS/Core/Test/ipsr.c +++ b/CMSIS/Core/Test/src/ipsr.c @@ -1,6 +1,6 @@ // REQUIRES: thumbv6m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/irq.c b/CMSIS/Core/Test/src/irq.c similarity index 64% rename from CMSIS/Core/Test/irq.c rename to CMSIS/Core/Test/src/irq.c index e5b79ef37..012962261 100644 --- a/CMSIS/Core/Test/irq.c +++ b/CMSIS/Core/Test/src/irq.c @@ -1,4 +1,4 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/src/isb.c b/CMSIS/Core/Test/src/isb.c new file mode 100644 index 000000000..022360d3e --- /dev/null +++ b/CMSIS/Core/Test/src/isb.c @@ -0,0 +1,11 @@ +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s + +#include "cmsis_compiler.h" + +void isb() { + // CHECK-LABEL: : + // CHECK: isb sy + __ISB(); + // CHECK: {{(bx lr)|(pop {.*pc})}} +} + diff --git a/CMSIS/Core/Test/lda.c b/CMSIS/Core/Test/src/lda.c similarity index 80% rename from CMSIS/Core/Test/lda.c rename to CMSIS/Core/Test/src/lda.c index 0b83047ea..1f4e454db 100644 --- a/CMSIS/Core/Test/lda.c +++ b/CMSIS/Core/Test/src/lda.c @@ -1,5 +1,5 @@ // REQUIRES: armv8m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/ldaex.c b/CMSIS/Core/Test/src/ldaex.c similarity index 80% rename from CMSIS/Core/Test/ldaex.c rename to CMSIS/Core/Test/src/ldaex.c index 77ab4345d..b9d433855 100644 --- a/CMSIS/Core/Test/ldaex.c +++ b/CMSIS/Core/Test/src/ldaex.c @@ -1,5 +1,5 @@ // REQUIRES: armv8m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/ldrex.c b/CMSIS/Core/Test/src/ldrex.c similarity index 80% rename from CMSIS/Core/Test/ldrex.c rename to CMSIS/Core/Test/src/ldrex.c index 52d203bea..d8bdf9ea2 100644 --- a/CMSIS/Core/Test/ldrex.c +++ b/CMSIS/Core/Test/src/ldrex.c @@ -1,5 +1,5 @@ // REQUIRES: ldrex -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/ldrt.c b/CMSIS/Core/Test/src/ldrt.c similarity index 80% rename from CMSIS/Core/Test/ldrt.c rename to CMSIS/Core/Test/src/ldrt.c index 48dffaeb4..0b2979e34 100644 --- a/CMSIS/Core/Test/ldrt.c +++ b/CMSIS/Core/Test/src/ldrt.c @@ -1,6 +1,6 @@ // REQUIRES: thumb-2 -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/msp.c b/CMSIS/Core/Test/src/msp.c similarity index 82% rename from CMSIS/Core/Test/msp.c rename to CMSIS/Core/Test/src/msp.c index 0be59ef4a..94b2b213d 100644 --- a/CMSIS/Core/Test/msp.c +++ b/CMSIS/Core/Test/src/msp.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv6m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/msplim.c b/CMSIS/Core/Test/src/msplim.c similarity index 83% rename from CMSIS/Core/Test/msplim.c rename to CMSIS/Core/Test/src/msplim.c index 9d9678ef7..3a71de82b 100644 --- a/CMSIS/Core/Test/msplim.c +++ b/CMSIS/Core/Test/src/msplim.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv8m.main -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/src/nop.c b/CMSIS/Core/Test/src/nop.c new file mode 100644 index 000000000..a7c19e804 --- /dev/null +++ b/CMSIS/Core/Test/src/nop.c @@ -0,0 +1,10 @@ +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s + +#include "cmsis_compiler.h" + +void nop() { + // CHECK-LABEL: : + // CHECK: {{(nop|mov r8, r8)}} + __NOP(); + // CHECK: {{(bx lr)|(pop {.*pc})}} +} diff --git a/CMSIS/Core/Test/noreturn.c b/CMSIS/Core/Test/src/noreturn.c similarity index 54% rename from CMSIS/Core/Test/noreturn.c rename to CMSIS/Core/Test/src/noreturn.c index c073eb861..024d25786 100644 --- a/CMSIS/Core/Test/noreturn.c +++ b/CMSIS/Core/Test/src/noreturn.c @@ -1,4 +1,4 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/primask.c b/CMSIS/Core/Test/src/primask.c similarity index 83% rename from CMSIS/Core/Test/primask.c rename to CMSIS/Core/Test/src/primask.c index bbad3256d..30a4c030f 100644 --- a/CMSIS/Core/Test/primask.c +++ b/CMSIS/Core/Test/src/primask.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv6m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/psp.c b/CMSIS/Core/Test/src/psp.c similarity index 82% rename from CMSIS/Core/Test/psp.c rename to CMSIS/Core/Test/src/psp.c index b6bf34214..4cc7a18bb 100644 --- a/CMSIS/Core/Test/psp.c +++ b/CMSIS/Core/Test/src/psp.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv6m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/psplim.c b/CMSIS/Core/Test/src/psplim.c similarity index 83% rename from CMSIS/Core/Test/psplim.c rename to CMSIS/Core/Test/src/psplim.c index e1c2a7f99..78c8b1cb7 100644 --- a/CMSIS/Core/Test/psplim.c +++ b/CMSIS/Core/Test/src/psplim.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv8m.main -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/psplim_baseline.c b/CMSIS/Core/Test/src/psplim_baseline.c similarity index 85% rename from CMSIS/Core/Test/psplim_baseline.c rename to CMSIS/Core/Test/src/psplim_baseline.c index 4da007c03..a58b930fa 100644 --- a/CMSIS/Core/Test/psplim_baseline.c +++ b/CMSIS/Core/Test/src/psplim_baseline.c @@ -1,6 +1,6 @@ // REQUIRES: thumbv8m.base // UNSUPPORTED: thumbv8m.main -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/rbit.c b/CMSIS/Core/Test/src/rbit.c similarity index 60% rename from CMSIS/Core/Test/rbit.c rename to CMSIS/Core/Test/src/rbit.c index d0a1648e8..03c5d33a3 100644 --- a/CMSIS/Core/Test/rbit.c +++ b/CMSIS/Core/Test/src/rbit.c @@ -1,5 +1,5 @@ // REQUIRES: thumb-2 -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/rev.c b/CMSIS/Core/Test/src/rev.c similarity index 57% rename from CMSIS/Core/Test/rev.c rename to CMSIS/Core/Test/src/rev.c index 5515f3cda..c5cddc0ba 100644 --- a/CMSIS/Core/Test/rev.c +++ b/CMSIS/Core/Test/src/rev.c @@ -1,4 +1,4 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/rev16.c b/CMSIS/Core/Test/src/rev16.c similarity index 58% rename from CMSIS/Core/Test/rev16.c rename to CMSIS/Core/Test/src/rev16.c index 59d2b53ba..38ac246a5 100644 --- a/CMSIS/Core/Test/rev16.c +++ b/CMSIS/Core/Test/src/rev16.c @@ -1,4 +1,4 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/revsh.c b/CMSIS/Core/Test/src/revsh.c similarity index 58% rename from CMSIS/Core/Test/revsh.c rename to CMSIS/Core/Test/src/revsh.c index d4c8187ef..46ba324ea 100644 --- a/CMSIS/Core/Test/revsh.c +++ b/CMSIS/Core/Test/src/revsh.c @@ -1,4 +1,4 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/ror.c b/CMSIS/Core/Test/src/ror.c similarity index 66% rename from CMSIS/Core/Test/ror.c rename to CMSIS/Core/Test/src/ror.c index b16ddb6be..7f1b80f21 100644 --- a/CMSIS/Core/Test/ror.c +++ b/CMSIS/Core/Test/src/ror.c @@ -1,4 +1,4 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/rrx.c b/CMSIS/Core/Test/src/rrx.c similarity index 59% rename from CMSIS/Core/Test/rrx.c rename to CMSIS/Core/Test/src/rrx.c index fd4991b8c..76efca274 100644 --- a/CMSIS/Core/Test/rrx.c +++ b/CMSIS/Core/Test/src/rrx.c @@ -1,5 +1,5 @@ // REQUIRES: thumb-2 -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/sat.c b/CMSIS/Core/Test/src/sat.c similarity index 79% rename from CMSIS/Core/Test/sat.c rename to CMSIS/Core/Test/src/sat.c index be9f5226a..f8323435f 100644 --- a/CMSIS/Core/Test/sat.c +++ b/CMSIS/Core/Test/src/sat.c @@ -1,5 +1,5 @@ // REQUIRES: sat -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/src/sev.c b/CMSIS/Core/Test/src/sev.c new file mode 100644 index 000000000..6f643d0ef --- /dev/null +++ b/CMSIS/Core/Test/src/sev.c @@ -0,0 +1,11 @@ +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s + +#include "cmsis_compiler.h" + +void sev() { + // CHECK-LABEL: : + // CHECK: sev + __SEV(); + // CHECK: {{(bx lr)|(pop {.*pc})}} +} + diff --git a/CMSIS/Core/Test/simd.c b/CMSIS/Core/Test/src/simd.c similarity index 98% rename from CMSIS/Core/Test/simd.c rename to CMSIS/Core/Test/src/simd.c index 17641aea5..4d6b3a4a2 100644 --- a/CMSIS/Core/Test/simd.c +++ b/CMSIS/Core/Test/src/simd.c @@ -1,5 +1,5 @@ // REQUIRES: dsp -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/sp.c b/CMSIS/Core/Test/src/sp.c similarity index 84% rename from CMSIS/Core/Test/sp.c rename to CMSIS/Core/Test/src/sp.c index 2e2d32070..1dd7364e1 100644 --- a/CMSIS/Core/Test/sp.c +++ b/CMSIS/Core/Test/src/sp.c @@ -1,5 +1,5 @@ // REQUIRES: armv7a -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/sp_ns.c b/CMSIS/Core/Test/src/sp_ns.c similarity index 73% rename from CMSIS/Core/Test/sp_ns.c rename to CMSIS/Core/Test/src/sp_ns.c index 83e1a2c05..3d2c5d6a9 100644 --- a/CMSIS/Core/Test/sp_ns.c +++ b/CMSIS/Core/Test/src/sp_ns.c @@ -1,5 +1,5 @@ // REQUIRES: thumbv8m.base -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/stl.c b/CMSIS/Core/Test/src/stl.c similarity index 78% rename from CMSIS/Core/Test/stl.c rename to CMSIS/Core/Test/src/stl.c index ab8386c22..7beb0948e 100644 --- a/CMSIS/Core/Test/stl.c +++ b/CMSIS/Core/Test/src/stl.c @@ -1,5 +1,5 @@ // REQUIRES: armv8m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/stlex.c b/CMSIS/Core/Test/src/stlex.c similarity index 81% rename from CMSIS/Core/Test/stlex.c rename to CMSIS/Core/Test/src/stlex.c index fc67ca124..caadaec33 100644 --- a/CMSIS/Core/Test/stlex.c +++ b/CMSIS/Core/Test/src/stlex.c @@ -1,5 +1,5 @@ // REQUIRES: armv8m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/strex.c b/CMSIS/Core/Test/src/strex.c similarity index 81% rename from CMSIS/Core/Test/strex.c rename to CMSIS/Core/Test/src/strex.c index 063090751..5b83f6e41 100644 --- a/CMSIS/Core/Test/strex.c +++ b/CMSIS/Core/Test/src/strex.c @@ -1,5 +1,5 @@ // REQUIRES: ldrex -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/strt.c b/CMSIS/Core/Test/src/strt.c similarity index 78% rename from CMSIS/Core/Test/strt.c rename to CMSIS/Core/Test/src/strt.c index 3eda0ae3c..de796663d 100644 --- a/CMSIS/Core/Test/strt.c +++ b/CMSIS/Core/Test/src/strt.c @@ -1,5 +1,5 @@ // REQUIRES: thumb-2 -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/systick.c b/CMSIS/Core/Test/src/systick.c similarity index 68% rename from CMSIS/Core/Test/systick.c rename to CMSIS/Core/Test/src/systick.c index 4f262156f..fd184738f 100644 --- a/CMSIS/Core/Test/systick.c +++ b/CMSIS/Core/Test/src/systick.c @@ -1,5 +1,5 @@ // REQUIRES: unsupported -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include diff --git a/CMSIS/Core/Test/src/wfi.c b/CMSIS/Core/Test/src/wfi.c new file mode 100644 index 000000000..732f23a5e --- /dev/null +++ b/CMSIS/Core/Test/src/wfi.c @@ -0,0 +1,10 @@ +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s + +#include "cmsis_compiler.h" + +void wfi() { + // CHECK-LABEL: : + // CHECK: wfi + __WFI(); + // CHECK: {{(bx lr)|(pop {.*pc})}} +} diff --git a/CMSIS/Core/Test/xpsr.c b/CMSIS/Core/Test/src/xpsr.c similarity index 57% rename from CMSIS/Core/Test/xpsr.c rename to CMSIS/Core/Test/src/xpsr.c index 18116ff22..051373c6e 100644 --- a/CMSIS/Core/Test/xpsr.c +++ b/CMSIS/Core/Test/src/xpsr.c @@ -1,6 +1,6 @@ // REQUIRES: thumbv6m -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s +// RUN: %cc% %ccflags% %ccout% %T/%basename_t.o %s; llvm-objdump --mcpu=%mcpu% -d %T/%basename_t.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s #include "cmsis_compiler.h" diff --git a/CMSIS/Core/Test/wfi.c b/CMSIS/Core/Test/wfi.c deleted file mode 100644 index aef8a5fba..000000000 --- a/CMSIS/Core/Test/wfi.c +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s - -#include "cmsis_compiler.h" - -void wfi() { - // CHECK-LABEL: : - // CHECK: wfi - __WFI(); - // CHECK: {{(bx lr)|(pop {.*pc})}} -}