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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [frv/] [all-read-write-1.c] - Blame information for rev 708

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
extern void abort (void);
3
extern void exit (int);
4
 
5
volatile unsigned long long x[2];
6
 
7
int main ()
8
{
9
  volatile char *addr = (volatile char *) &x[0];
10
 
11
  x[0] = ~0ULL;
12
  x[1] = ~0ULL;
13
  __builtin_write64 (addr, 0x1122334455667788ULL);
14
  __builtin_write32 (addr + 8, 0x12345678);
15
  __builtin_write16 (addr + 12, 0xaabb);
16
  __builtin_write8 (addr + 14, 0xcc);
17
 
18
  if (x[0] != 0x1122334455667788ULL
19
      || x[1] != 0x12345678aabbccffULL
20
      || __builtin_read8 (addr) != 0x11
21
      || __builtin_read16 (addr + 2) != 0x3344
22
      || __builtin_read32 (addr + 4) != 0x55667788
23
      || __builtin_read64 (addr + 8) != 0x12345678aabbccffULL)
24
    abort ();
25
 
26
  __builtin_write64 (addr, 0);
27
  __builtin_write32 (addr + 8, 0);
28
  __builtin_write16 (addr + 12, 0);
29
  __builtin_write8 (addr + 14, 0);
30
  if (x[0] != 0 || x[1] != 0xff)
31
    abort ();
32
 
33
  exit (0);
34
}

powered by: WebSVN 2.1.0

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