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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr16104-1.c] - Blame information for rev 298

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

Line No. Rev Author Line
1 298 jeremybenn
/* PR rtl-optimization/16104 */
2
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
3
/* { dg-options "-msse2" } */
4
/* { dg-require-effective-target sse2 } */
5
/* { dg-require-effective-target sse2_runtime } */
6
 
7
extern void abort (void);
8
 
9
typedef int V2SI __attribute__ ((vector_size (8)));
10
typedef unsigned int V2USI __attribute__ ((vector_size (8)));
11
typedef short V2HI __attribute__ ((vector_size (4)));
12
typedef unsigned int V2UHI __attribute__ ((vector_size (4)));
13
 
14
int
15
test1 (void)
16
{
17
  return (long long) (V2SI) 0LL;
18
}
19
 
20
int
21
test2 (V2SI x)
22
{
23
  return (long long) x;
24
}
25
 
26
V2SI
27
test3 (void)
28
{
29
  return (V2SI) (long long) (int) (V2HI) 0;
30
}
31
 
32
V2SI
33
test4 (V2HI x)
34
{
35
  return (V2SI) (long long) (int) x;
36
}
37
 
38
V2SI
39
test5 (V2USI x)
40
{
41
  return (V2SI) x;
42
}
43
 
44
void
45
__attribute__ ((noinline))
46
do_test (void)
47
{
48
  if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8)
49
    return;
50
 
51
  if (test1 () != 0)
52
    abort ();
53
 
54
  V2SI x = { 2, 2 };
55
  if (test2 (x) != 2)
56
    abort ();
57
 
58
  union { V2SI x; int y[2]; V2USI z; long long l; } u;
59
  u.x = test3 ();
60
  if (u.y[0] != 0 || u.y[1] != 0)
61
    abort ();
62
 
63
  V2HI y = { 4, 4 };
64
  union { V2SI x; long long y; } v;
65
  v.x = test4 (y);
66
  if (v.y != 0x40004)
67
    abort ();
68
 
69
  V2USI z = { 6, 6 };
70
  u.x = test5 (z);
71
  if (u.y[0] != 6 || u.y[1] != 6)
72
    abort ();
73
}
74
 
75
int
76
main (void)
77
{
78
  do_test ();
79
  return 0;
80
}

powered by: WebSVN 2.1.0

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