summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/r10k-cache-barrier-2.c
blob: 3d06d0ddb6e9382b344bf50b2df64b16e06f65a4 (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
/* { dg-options "-O2 -mabi=64 -mr10k-cache-barrier=store" } */

/* Test that stores to constant cached addresses are protected
   by cache barriers.  */

#define TEST(ADDR)					\
  NOMIPS16 void						\
  test_##ADDR (int n)					\
  {							\
    *(volatile int *) (0x##ADDR##UL) = 1;		\
  }

TEST (8ffffffffffffffc)
TEST (9000010000000000)

TEST (91fffffffffffffc)
TEST (9200010000000000)

TEST (93fffffffffffffc)
TEST (9500010000000000)

TEST (95fffffffffffffc)
TEST (9600010000000000)

TEST (b7fffffffffffffc)
TEST (b800010000000000)

TEST (b9fffffffffffffc)
TEST (ba00010000000000)

TEST (bbfffffffffffffc)
TEST (bc00010000000000)

TEST (bdfffffffffffffc)
TEST (be00010000000000)

TEST (ffffffff9ffffffc)
TEST (ffffffffc0000000)

/* { dg-final { scan-assembler-times "\tcache\t" 18 } } */