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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20020619-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
static int ref(void)
2
{
3
  union {
4
    char c[5];
5
    int i;
6
  } u;
7
 
8
  __builtin_memset (&u, 0, sizeof(u));
9
  u.c[0] = 1;
10
  u.c[1] = 2;
11
  u.c[2] = 3;
12
  u.c[3] = 4;
13
 
14
  return u.i;
15
}
16
 
17
#define MAX(a,b)  (a < b ? b : a)
18
 
19
static int test(void)
20
{
21
  char c[MAX(5, sizeof(int))] __attribute__((aligned)) = { 1, 2, 3, 4 };
22
  return *(int *)c;
23
}
24
 
25
int main()
26
{
27
  int a = test();
28
  int b = ref();
29
  if (a != b)
30
    abort ();
31
  return 0;
32
}

powered by: WebSVN 2.1.0

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