]> begriffs open source - cmsis/blob - CMSIS/Core/Test/ldrex.c
Add LLVM LIT/FileCheck tests for Core files
[cmsis] / CMSIS / Core / Test / ldrex.c
1 // REQUIRES: ldrex
2 // RUN: %cc% %ccflags% %ccout% %s.o %s; llvm-objdump --mcpu=%mcpu% -d %s.o | FileCheck --allow-unused-prefixes --check-prefixes %prefixes% %s
3
4 #include "cmsis_compiler.h"
5
6 static volatile uint8_t v8 = 0x7u;
7 static volatile uint16_t v16 = 0x7u;
8 static volatile uint32_t v32 = 0x7u;
9
10 void ldrexb() {
11     // CHECK-LABEL: <ldrexb>:
12     // CHECK: ldrexb {{r[0-9]+}}, [{{r[0-9]+}}]
13     volatile uint8_t result = __LDREXB(&v8);
14     // CHECK: {{(bx lr)|(pop {.*pc})}}
15 }
16
17 void ldrexh() {
18     // CHECK-LABEL: <ldrexh>:
19     // CHECK: ldrexh {{r[0-9]+}}, [{{r[0-9]+}}]
20     volatile uint16_t result = __LDREXH(&v16);
21     // CHECK: {{(bx lr)|(pop {.*pc})}}
22 }
23
24 void ldrexw() {
25     // CHECK-LABEL: <ldrexw>:
26     // CHECK: ldrex {{r[0-9]+}}, [{{r[0-9]+}}]
27     volatile uint32_t result = __LDREXW(&v32);
28     // CHECK: {{(bx lr)|(pop {.*pc})}}
29 }