OSDN Git Service

Backport from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / powerpc / 20030218-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
3 /* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
4
5 /* Test vectors that can interconvert without a cast.  */
6
7 __ev64_opaque__ opp;
8 int vint   __attribute__((vector_size (8)));
9 short vshort __attribute__((vector_size (8)));
10 float vfloat __attribute__((vector_size (8)));
11
12 int
13 main (void)
14 {
15   __ev64_opaque__ george = { 1, 2 }; /* { dg-error "opaque vector types cannot be initialized" } */
16
17   opp = vfloat;
18   vshort = opp;
19   vfloat = vshort; /* { dg-error "incompatible types when assigning" } */
20
21   /* Just because this is a V2SI, it doesn't make it an opaque.  */
22   vint = vshort; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
23   /* { dg-error "incompatible types when assigning" "" { target *-*-* } 22 } */
24
25   return 0;
26 }