1 // REQUIRES: armv8m
2 // 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
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 
stlexb()10 void stlexb() {
11     // CHECK-LABEL: <stlexb>:
12     // CHECK: stlexb {{r[0-9]+}}, {{r[0-9]+}}, [{{r[0-9]+}}]
13     volatile uint32_t result = __STLEXB(0x7u, &v8);
14     // CHECK: {{(bx lr)|(pop {.*pc})}}
15 }
16 
stlexh()17 void stlexh() {
18     // CHECK-LABEL: <stlexh>:
19     // CHECK: stlexh {{r[0-9]+}}, {{r[0-9]+}}, [{{r[0-9]+}}]
20     volatile uint32_t result = __STLEXH(0x7u, &v16);
21     // CHECK: {{(bx lr)|(pop {.*pc})}}
22 }
23 
stlex()24 void stlex() {
25     // CHECK-LABEL: <stlex>:
26     // CHECK: stlex {{r[0-9]+}}, {{r[0-9]+}}, [{{r[0-9]+}}]
27     volatile uint32_t result = __STLEX(0x7u, &v32);
28     // CHECK: {{(bx lr)|(pop {.*pc})}}
29 }
30