| 1 |
/* { dg-require-effective-target stdint_types } */ |
| 2 |
#include <stdint.h> |
| 3 |
|
| 4 |
void abort (void); |
| 5 |
|
| 6 |
typedef int32_t __attribute__((vector_size(8))) v2si; |
| 7 |
int64_t s64; |
| 8 |
|
| 9 |
static inline int64_t |
| 10 |
__ev_convert_s64 (v2si a) |
| 11 |
{ |
| 12 |
return (int64_t) a; |
| 13 |
} |
| 14 |
|
| 15 |
int main() |
| 16 |
{ |
| 17 |
union { int64_t ll; int32_t i[2]; } endianness_test; |
| 18 |
endianness_test.ll = 1; |
| 19 |
int32_t little_endian = endianness_test.i[0]; |
| 20 |
s64 = __ev_convert_s64 ((v2si){1,0xffffffff}); |
| 21 |
if (s64 != (little_endian ? 0xffffffff00000001LL : 0x1ffffffffLL)) |
| 22 |
abort (); |
| 23 |
return 0; |
| 24 |
} |