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/] [20081218-1.c] - Blame information for rev 301

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

Line No. Rev Author Line
1 297 jeremybenn
struct A { int i, j; char pad[512]; } a;
2
 
3
int __attribute__((noinline))
4
foo (void)
5
{
6
  __builtin_memset (&a, 0x26, sizeof a);
7
  return a.i;
8
}
9
 
10
void __attribute__((noinline))
11
bar (void)
12
{
13
  __builtin_memset (&a, 0x36, sizeof a);
14
  a.i = 0x36363636;
15
  a.j = 0x36373636;
16
}
17
 
18
int
19
main (void)
20
{
21
  int i;
22
  if (sizeof (int) != 4 || __CHAR_BIT__ != 8)
23
    return 0;
24
 
25
  if (foo () != 0x26262626)
26
    __builtin_abort ();
27
  for (i = 0; i < sizeof a; i++)
28
    if (((char *)&a)[i] != 0x26)
29
      __builtin_abort ();
30
 
31
  bar ();
32
  if (a.j != 0x36373636)
33
    __builtin_abort ();
34
  a.j = 0x36363636;
35
  for (i = 0; i < sizeof a; i++)
36
    if (((char *)&a)[i] != 0x36)
37
      __builtin_abort ();
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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