aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/apple-altivec-8.c
blob: 3357ccbe00c270c6bcbc52e52c1cc31c0f78ee3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-options "-maltivec -O2 -faltivec" } */

/* ICEs at -O1 or more */

extern void abort();

int main()
{

  const static vector float vINF = 
     ( vector float ) ( ( vector unsigned int ) ( 0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000 ) );

  unsigned int af[4] = {
                       (unsigned int)0x7F800000,
                       (unsigned int)0x7F800000,
                       (unsigned int)0x7F800000,
                       (unsigned int)0x7F800000};

 union u {
          vector float vf;
          unsigned int   ai[4];
 }vu;

 int i;

 vu.vf = vINF;

 for (i=0; i < 4; i++)
    if (af[i] != vu.ai[i])
      abort();

 return 0;
}