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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libmudflap/] [testsuite/] [libmudflap.c/] [pass64-frag.c] - Blame information for rev 738

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 738 jeremybenn
/* PR libmudflap/36397 */
2
/* { dg-do run } */
3
/* { dg-options "-O -fmudflap -fno-strict-aliasing -lmudflap" } */
4
 
5
struct A
6
{
7
  int a[2];
8
};
9
 
10
long long int x;
11
 
12
int __attribute__ ((noinline))
13
baz (long long int *x)
14
{
15
  return *x;
16
}
17
 
18
int __attribute__ ((noinline))
19
foo (int i)
20
{
21
  if (i > 10)
22
    return baz (&x);
23
  return ((struct A *) &x)->a[i];
24
}
25
 
26
int
27
main (void)
28
{
29
  if (sizeof (long long) == 2 * sizeof (int)
30
      && sizeof (long long) == sizeof (struct A))
31
    {
32
      struct A a = { .a[0] = 10, .a[1] = 20 };
33
      __builtin_memcpy (&x, &a, sizeof (x));
34
      if (foo (0) != 10 || foo (1) != 20)
35
        __builtin_abort ();
36
    }
37
  return 0;
38
}

powered by: WebSVN 2.1.0

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