OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / arm / neon / polytypes.c
1 /* Check that NEON polynomial vector types are suitably incompatible with
2    integer vector types of the same layout.  */
3
4 /* { dg-do compile } */
5 /* { dg-require-effective-target arm_neon_ok } */
6 /* { dg-options "-mfpu=neon -mfloat-abi=softfp" } */
7
8 #include <arm_neon.h>
9
10 void s64_8 (int8x8_t a) {}
11 void u64_8 (uint8x8_t a) {}
12 void p64_8 (poly8x8_t a) {}
13 void s64_16 (int16x4_t a) {}
14 void u64_16 (uint16x4_t a) {}
15 void p64_16 (poly16x4_t a) {}
16
17 void s128_8 (int8x16_t a) {}
18 void u128_8 (uint8x16_t a) {}
19 void p128_8 (poly8x16_t a) {}
20 void s128_16 (int16x8_t a) {}
21 void u128_16 (uint16x8_t a) {}
22 void p128_16 (poly16x8_t a) {}
23
24 void foo ()
25 {
26   poly8x8_t v64_8;
27   poly16x4_t v64_16;
28   poly8x16_t v128_8;
29   poly16x8_t v128_16;
30
31   s64_8 (v64_8); /* { dg-error "use -flax-vector-conversions.*incompatible type for argument 1 of 's64_8'" } */
32   u64_8 (v64_8); /* { dg-error "incompatible type for argument 1 of 'u64_8'" } */
33   p64_8 (v64_8);
34
35   s64_16 (v64_16); /* { dg-error "incompatible type for argument 1 of 's64_16'" } */
36   u64_16 (v64_16); /* { dg-error "incompatible type for argument 1 of 'u64_16'" } */
37   p64_16 (v64_16);
38
39   s128_8 (v128_8); /* { dg-error "incompatible type for argument 1 of 's128_8'" } */
40   u128_8 (v128_8); /* { dg-error "incompatible type for argument 1 of 'u128_8'" } */
41   p128_8 (v128_8);
42
43   s128_16 (v128_16); /* { dg-error "incompatible type for argument 1 of 's128_16'" } */
44   u128_16 (v128_16); /* { dg-error "incompatible type for argument 1 of 'u128_16'" } */
45   p128_16 (v128_16);
46 }
47