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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr40668.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
#if (__SIZEOF_INT__ == 2)
2
#define TESTVALUE 0x1234
3
#else
4
#define TESTVALUE 0x12345678
5
#endif
6
static void
7
foo (unsigned int x, void *p)
8
{
9
  __builtin_memcpy (p, &x, sizeof x);
10
}
11
 
12
void
13
bar (int type, void *number)
14
{
15
  switch (type)
16
    {
17
    case 1:
18
      foo (TESTVALUE, number);
19
      break;
20
    case 7:
21
      foo (0, number);
22
      break;
23
    case 8:
24
      foo (0, number);
25
      break;
26
    case 9:
27
      foo (0, number);
28
      break;
29
    }
30
}
31
 
32
int
33
main (void)
34
{
35
  unsigned int x;
36
  bar (1, &x);
37
  if (x != TESTVALUE)
38
    __builtin_abort ();
39
  return 0;
40
}

powered by: WebSVN 2.1.0

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