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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr32912-2.c] - Blame information for rev 801

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

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

powered by: WebSVN 2.1.0

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