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/] [20050604-1.c] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
/* PR regression/21897 */
2
 
3
extern void abort (void);
4
 
5
typedef short v4hi __attribute__ ((vector_size (8)));
6
typedef float v4sf __attribute__ ((vector_size (16)));
7
 
8
union
9
{
10
  v4hi v;
11
  short s[4];
12
} u;
13
 
14
union
15
{
16
  v4sf v;
17
  float f[4];
18
} v;
19
 
20
void
21
foo (void)
22
{
23
  unsigned int i;
24
  for (i = 0; i < 2; i++)
25
    u.v += (v4hi) { 12, 14 };
26
  for (i = 0; i < 2; i++)
27
    v.v += (v4sf) { 18.0, 20.0, 22 };
28
}
29
 
30
int
31
main (void)
32
{
33
  foo ();
34
  if (u.s[0] != 24 || u.s[1] != 28 || u.s[2] || u.s[3])
35
    abort ();
36
  if (v.f[0] != 36.0 || v.f[1] != 40.0 || v.f[2] != 44.0 || v.f[3] != 0.0)
37
    abort ();
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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