OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pr32912-2.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -w" } */
3
 
4
extern void abort (void);
5
 
6
#if(__SIZEOF_INT__ >= 4)
7
typedef int __m128i __attribute__ ((__vector_size__ (16)));
8
#else
9
typedef long __m128i __attribute__ ((__vector_size__ (16)));
10
#endif
11
__m128i
12
foo (void)
13
{
14
  __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
15
  return x;
16
}
17
 
18
__m128i
19
bar (void)
20
{
21
  __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
22
  return ~x;
23
}
24
 
25
int
26
main (void)
27
{
28
#if(__SIZEOF_INT__ >= 4)
29
  union { __m128i v; int i[sizeof (__m128i) / sizeof (int)]; } u, v;
30
#else
31
  union { __m128i v; long i[sizeof (__m128i) / sizeof (long)]; } u, v;
32
#endif
33
  int i;
34
 
35
  u.v = foo ();
36
  v.v = bar ();
37
  for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++)
38
    {
39
      if (u.i[i] != ~v.i[i])
40
        abort ();
41
      if (i < 3)
42
        {
43
          if (u.i[i] != (0x11111111 << i))
44
            abort ();
45
        }
46
      else if (u.i[i])
47
        abort ();
48
    }
49
  return 0;
50
}

powered by: WebSVN 2.1.0

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