aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/aarch64/atomic-op-imm.c
blob: 6c6f7e16dfefa92027cd678e4eb8df7849bd7cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* { dg-do compile } */
/* { dg-options "-O2" } */

int v = 0;

int
atomic_fetch_add_RELAXED ()
{
  return __atomic_fetch_add (&v, 4096, __ATOMIC_RELAXED);
}

int
atomic_fetch_sub_ACQUIRE ()
{
  return __atomic_fetch_sub (&v, 4096, __ATOMIC_ACQUIRE);
}

int
atomic_fetch_and_SEQ_CST ()
{
  return __atomic_fetch_and (&v, 4096, __ATOMIC_SEQ_CST);
}

int
atomic_fetch_nand_ACQ_REL ()
{
  return __atomic_fetch_nand (&v, 4096, __ATOMIC_ACQ_REL);
}

int
atomic_fetch_xor_CONSUME ()
{
  return __atomic_fetch_xor (&v, 4096, __ATOMIC_CONSUME);
}

int
atomic_fetch_or_RELAXED ()
{
  return __atomic_fetch_or (&v, 4096, __ATOMIC_RELAXED);
}

int
atomic_add_fetch_ACQUIRE ()
{
  return __atomic_add_fetch (&v, 4096, __ATOMIC_ACQUIRE);
}

int
atomic_sub_fetch_RELAXED ()
{
  return __atomic_sub_fetch (&v, 4096, __ATOMIC_RELAXED);
}

int
atomic_and_fetch_SEQ_CST ()
{
  return __atomic_and_fetch (&v, 4096, __ATOMIC_SEQ_CST);
}

int
atomic_nand_fetch_ACQUIRE ()
{
  return __atomic_nand_fetch (&v, 4096, __ATOMIC_ACQUIRE);
}

int
atomic_xor_fetch_RELEASE ()
{
  return __atomic_xor_fetch (&v, 4096, __ATOMIC_RELEASE);
}

int
atomic_or_fetch_CONSUME ()
{
  return __atomic_or_fetch (&v, 4096, __ATOMIC_CONSUME);
}

/* { dg-final { scan-assembler-times "\tw\[0-9\]+, w\[0-9\]+, #*4096" 12 } } */