1 // REQUIRES: ldrex
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 
strexb()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 
strexh()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 
strexw()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 }
30