1 /* { dg-do compile } */
2 /* { dg-options "-O2 -std=c99" } */
3 /* { dg-final { check-function-bodies "**" "" "" } } */
4 #include <stdatomic.h>
5
6 #pragma GCC target "+rcpc"
7
8 atomic_ullong u64;
9 atomic_llong s64;
10 atomic_uint u32;
11 atomic_int s32;
12 atomic_ushort u16;
13 atomic_short s16;
14 atomic_uchar u8;
15 atomic_schar s8;
16
17 #define TEST(name, ldsize, rettype) \
18 rettype \
19 test_##name (void) \
20 { \
21 return atomic_load_explicit (&ldsize, memory_order_acquire); \
22 }
23
24 /*
25 **test_u8_u64:
26 **...
27 ** ldaprb w0, \[x[0-9]+\]
28 ** ret
29 */
30
31 TEST(u8_u64, u8, unsigned long long)
32
33 /*
34 **test_u16_u64:
35 **...
36 ** ldaprh w0, \[x[0-9]+\]
37 ** ret
38 */
39
40 TEST(u16_u64, u16, unsigned long long)
41
42 /*
43 **test_u32_u64:
44 **...
45 ** ldapr w0, \[x[0-9]+\]
46 ** ret
47 */
48
49 TEST(u32_u64, u32, unsigned long long)
50
51 /*
52 **test_u8_u32:
53 **...
54 ** ldaprb w0, \[x[0-9]+\]
55 ** ret
56 */
57
58 TEST(u8_u32, u8, unsigned)
59
60 /*
61 **test_u16_u32:
62 **...
63 ** ldaprh w0, \[x[0-9]+\]
64 ** ret
65 */
66 TEST(u16_u32, u16, unsigned)
67