OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [frv/] [all-accs-1.c] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* 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);
6
 
7
void
8
set ()
9
{
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
27
}
28
 
29
void
30
check ()
31
{
32
  int diff1, diff2;
33
 
34
  diff1 = diff2 = 0;
35
 
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 ();
57
}
58
 
59
int
60
main ()
61
{
62
  set ();
63
  check ();
64
  exit (0);
65
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.