Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/atomic-op-imm.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=armv8-a+nolse -O2 -mno-outline-atomics" } */
3
4 int v = 0;
5
6 int
7 atomic_fetch_add_RELAXED ()
8 {
9 return __atomic_fetch_add (&v, 4096, __ATOMIC_RELAXED);
10 }
11
12 int
13 atomic_fetch_sub_ACQUIRE ()
14 {
15 return __atomic_fetch_sub (&v, 4096, __ATOMIC_ACQUIRE);
16 }
17
18 int
19 atomic_fetch_add_negative_RELAXED ()
20 {
21 return __atomic_fetch_add (&v, -4096, __ATOMIC_RELAXED);
22 }
23
24 int
25 atomic_fetch_sub_negative_ACQUIRE ()
26 {
27 return __atomic_fetch_sub (&v, -4096, __ATOMIC_ACQUIRE);
28 }
29
30 int
31 atomic_fetch_and_SEQ_CST ()
32 {
33 return __atomic_fetch_and (&v, 4096, __ATOMIC_SEQ_CST);
34 }
35
36 int
37 atomic_fetch_nand_ACQ_REL ()
38 {
39 return __atomic_fetch_nand (&v, 4096, __ATOMIC_ACQ_REL);
40 }
41
42 int
43 atomic_fetch_xor_CONSUME ()
44 {
45 return __atomic_fetch_xor (&v, 4096, __ATOMIC_CONSUME);
46 }
47
48 int
49 atomic_fetch_or_RELAXED ()
50 {
51 return __atomic_fetch_or (&v, 4096, __ATOMIC_RELAXED);
52 }
53
54 int
55 atomic_add_fetch_ACQUIRE ()
56 {
57 return __atomic_add_fetch (&v, 4096, __ATOMIC_ACQUIRE);
58 }
59
60 int
61 atomic_sub_fetch_RELAXED ()
62 {
63 return __atomic_sub_fetch (&v, 4096, __ATOMIC_RELAXED);
64 }
65
66 int
67 atomic_and_fetch_SEQ_CST ()
68 {
69 return __atomic_and_fetch (&v, 4096, __ATOMIC_SEQ_CST);
70 }
71
72 int
73 atomic_nand_fetch_ACQUIRE ()
74 {
75 return __atomic_nand_fetch (&v, 4096, __ATOMIC_ACQUIRE);
76 }
77
78 int
79 atomic_xor_fetch_RELEASE ()
80 {
81 return __atomic_xor_fetch (&v, 4096, __ATOMIC_RELEASE);
82 }
83
84 int
85 atomic_or_fetch_CONSUME ()
86 {
87 return __atomic_or_fetch (&v, 4096, __ATOMIC_CONSUME);
88 }
89
90 /* { dg-final { scan-assembler-times "\tw\[0-9\]+, w\[0-9\]+, #*4096" 14 } } */