[ARM] Fix PR85203: cmse_nonsecure_caller returns wrong result
[official-gcc.git] / gcc / testsuite / gcc.target / frv / all-accs-1.c
blobcb4232b3c3bebdecad27458635b19d9fe50e624a
1 /* Check that ACCs and ACCGs are treated as global variables even if
2 media.h isn't included. */
3 /* { dg-do run } */
4 extern void abort (void);
5 extern void exit (int);
7 void
8 set ()
10 #define SET(X) __MWTACC (X, (X) | 0x100), __MWTACCG (X, X)
11 SET (0);
12 SET (1);
13 SET (2);
14 SET (3);
15 #if defined (__CPU_FR450__)
16 SET (8);
17 SET (9);
18 SET (10);
19 SET (11);
20 #elif __FRV_ACC__ > 4
21 SET (4);
22 SET (5);
23 SET (6);
24 SET (7);
25 #endif
26 #undef SET
29 void
30 check ()
32 int diff1, diff2;
34 diff1 = diff2 = 0;
36 #define CHECK(X) \
37 (diff1 |= (__MRDACC (X) ^ (X | 0x100)), \
38 diff2 |= (__MRDACCG (X) ^ X))
39 CHECK (0);
40 CHECK (1);
41 CHECK (2);
42 CHECK (3);
43 #if defined (__CPU_FR450__)
44 CHECK (8);
45 CHECK (9);
46 CHECK (10);
47 CHECK (11);
48 #elif __FRV_ACC__ > 4
49 CHECK (4);
50 CHECK (5);
51 CHECK (6);
52 CHECK (7);
53 #endif
54 #undef CHECK
55 if ((diff1 | diff2) != 0)
56 abort ();
59 int
60 main ()
62 set ();
63 check ();
64 exit (0);