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/] [20000703-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
void abort(void);
2
void exit(int);
3
struct baz
4
{
5
  char a[17];
6
  char b[3];
7
  unsigned int c;
8
  unsigned int d;
9
};
10
 
11
void foo(struct baz *p, unsigned int c, unsigned int d)
12
{
13
  __builtin_memcpy (p->b, "abc", 3);
14
  p->c = c;
15
  p->d = d;
16
}
17
 
18
void bar(struct baz *p, unsigned int c, unsigned int d)
19
{
20
  ({ void *s = (p);
21
     __builtin_memset (s, '\0', sizeof (struct baz));
22
     s; });
23
  __builtin_memcpy (p->a, "01234567890123456", 17);
24
  __builtin_memcpy (p->b, "abc", 3);
25
  p->c = c;
26
  p->d = d;
27
}
28
 
29
int main()
30
{
31
  struct baz p;
32
  foo(&p, 71, 18);
33
  if (p.c != 71 || p.d != 18)
34
    abort();
35
  bar(&p, 59, 26);
36
  if (p.c != 59 || p.d != 26)
37
    abort();
38
  exit(0);
39
}

powered by: WebSVN 2.1.0

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