blob: a50b2860e8b8e76c45c5faed9d14da34666386f8 [file] [log] [blame]
/* { dg-do compile { target c++14 } } */
/* { dg-options "-Wsign-conversion" } */
// Ignore warning on some powerpc-linux configurations.
// { dg-prune-output "non-standard ABI extension" }
// Ignore warning on Linux/x86
// { dg-prune-output "changes the ABI" }
typedef double vecd __attribute__((vector_size(4*sizeof(double))));
typedef float vecf __attribute__((vector_size(8*sizeof(float))));
typedef long vecl __attribute__((vector_size(4*sizeof(long))));
typedef short vecs __attribute__((vector_size(8*sizeof(short))));
typedef char vecc __attribute__((vector_size(16*sizeof(char))));
auto f(vecf*a,float d,long long i){
return (*a<0)?d:i; // { dg-error "truncation" }
}
auto g(vecc*a){
return (*a<0)?3LL:42UL; // { dg-error "inferred scalar type" }
}
auto h(vecd*a){
return (*a<0)?'a':'c'; // { dg-error "inferred scalar type \[^\\n\]*double" }
}
auto i(vecc*a){
return (*a<0)?1:0.; // { dg-error "inferred scalar type" }
}
auto j(vecl*a,long i,unsigned long k){
return (*a<0)?i:k; // { dg-warning "may change the sign" }
}