]> begriffs open source - cmsis/blob - CMSIS/Core/Test/strex.c
Add LLVM LIT/FileCheck tests for Core files
[cmsis] / CMSIS / Core / Test / strex.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;
7 static volatile uint16_t v16;
8 static volatile uint32_t v32;
9
10 void strexb() {
11     // CHECK-LABEL: <strexb>:
12     // CHECK: strexb {{r[0-9]+}}, {{r[0-9]+}}, [{{r[0-9]+}}]
13     volatile uint32_t result = __STREXB(0x7u, &v8);
14     // CHECK: {{(bx lr)|(pop {.*pc})}}
15 }
16
17 void strexh() {
18     // CHECK-LABEL: <strexh>:
19     // CHECK: strexh {{r[0-9]+}}, {{r[0-9]+}}, [{{r[0-9]+}}]
20     volatile uint32_t result = __STREXH(0x7u, &v16);
21     // CHECK: {{(bx lr)|(pop {.*pc})}}
22 }
23
24 void strexw() {
25     // CHECK-LABEL: <strexw>:
26     // CHECK: strex {{r[0-9]+}}, {{r[0-9]+}}, [{{r[0-9]+}}]
27     volatile uint32_t result = __STREXW(0x7u, &v32);
28     // CHECK: {{(bx lr)|(pop {.*pc})}}
29 }