Zi Xuan Wu | 64d85a2 | 2018-11-16 03:00:00 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple=powerpc64le-unknown-linux -target-feature +altivec -target-feature +vsx -verify -verify-ignore-unexpected=note -pedantic -fsyntax-only |
| 2 | |
| 3 | typedef signed char __v16sc __attribute__((__vector_size__(16))); |
| 4 | typedef unsigned char __v16uc __attribute__((__vector_size__(16))); |
| 5 | typedef signed short __v8ss __attribute__((__vector_size__(16))); |
| 6 | typedef unsigned short __v8us __attribute__((__vector_size__(16))); |
| 7 | typedef signed int __v4si __attribute__((__vector_size__(16))); |
| 8 | typedef unsigned int __v4ui __attribute__((__vector_size__(16))); |
| 9 | typedef signed long long __v2sll __attribute__((__vector_size__(16))); |
| 10 | typedef unsigned long long __v2ull __attribute__((__vector_size__(16))); |
| 11 | typedef signed __int128 __v1slll __attribute__((__vector_size__(16))); |
| 12 | typedef unsigned __int128 __v1ulll __attribute__((__vector_size__(16))); |
| 13 | typedef float __v4f __attribute__((__vector_size__(16))); |
| 14 | typedef double __v2d __attribute__((__vector_size__(16))); |
| 15 | |
| 16 | __v16sc *__attribute__((__overloadable__)) convert1(vector signed char); |
| 17 | __v16uc *__attribute__((__overloadable__)) convert1(vector unsigned char); |
| 18 | __v8ss *__attribute__((__overloadable__)) convert1(vector signed short); |
| 19 | __v8us *__attribute__((__overloadable__)) convert1(vector unsigned short); |
| 20 | __v4si *__attribute__((__overloadable__)) convert1(vector signed int); |
| 21 | __v4ui *__attribute__((__overloadable__)) convert1(vector unsigned int); |
| 22 | __v2sll *__attribute__((__overloadable__)) convert1(vector signed long long); |
| 23 | __v2ull *__attribute__((__overloadable__)) convert1(vector unsigned long long); |
| 24 | __v1slll *__attribute__((__overloadable__)) convert1(vector signed __int128); |
| 25 | __v1ulll *__attribute__((__overloadable__)) convert1(vector unsigned __int128); |
| 26 | __v4f *__attribute__((__overloadable__)) convert1(vector float); |
| 27 | __v2d *__attribute__((__overloadable__)) convert1(vector double); |
| 28 | void __attribute__((__overloadable__)) convert1(vector bool int); |
| 29 | void __attribute__((__overloadable__)) convert1(vector pixel short); |
| 30 | |
| 31 | vector signed char *__attribute__((__overloadable__)) convert2(__v16sc); |
| 32 | vector unsigned char *__attribute__((__overloadable__)) convert2(__v16uc); |
| 33 | vector signed short *__attribute__((__overloadable__)) convert2(__v8ss); |
| 34 | vector unsigned short *__attribute__((__overloadable__)) convert2(__v8us); |
| 35 | vector signed int *__attribute__((__overloadable__)) convert2(__v4si); |
| 36 | vector unsigned int *__attribute__((__overloadable__)) convert2(__v4ui); |
| 37 | vector signed long long *__attribute__((__overloadable__)) convert2(__v2sll); |
| 38 | vector unsigned long long *__attribute__((__overloadable__)) convert2(__v2ull); |
| 39 | vector signed __int128 *__attribute__((__overloadable__)) convert2(__v1slll); |
| 40 | vector unsigned __int128 *__attribute__((__overloadable__)) convert2(__v1ulll); |
| 41 | vector float *__attribute__((__overloadable__)) convert2(__v4f); |
| 42 | vector double *__attribute__((__overloadable__)) convert2(__v2d); |
| 43 | |
| 44 | void test() { |
| 45 | __v16sc gv1; |
| 46 | __v16uc gv2; |
| 47 | __v8ss gv3; |
| 48 | __v8us gv4; |
| 49 | __v4si gv5; |
| 50 | __v4ui gv6; |
| 51 | __v2sll gv7; |
| 52 | __v2ull gv8; |
| 53 | __v1slll gv9; |
| 54 | __v1ulll gv10; |
| 55 | __v4f gv11; |
| 56 | __v2d gv12; |
| 57 | |
| 58 | vector signed char av1; |
| 59 | vector unsigned char av2; |
| 60 | vector signed short av3; |
| 61 | vector unsigned short av4; |
| 62 | vector signed int av5; |
| 63 | vector unsigned int av6; |
| 64 | vector signed long long av7; |
| 65 | vector unsigned long long av8; |
| 66 | vector signed __int128 av9; |
| 67 | vector unsigned __int128 av10; |
| 68 | vector float av11; |
| 69 | vector double av12; |
| 70 | vector bool int av13; |
| 71 | vector pixel short av14; |
| 72 | |
| 73 | __v16sc *gv1_p = convert1(gv1); |
| 74 | __v16uc *gv2_p = convert1(gv2); |
| 75 | __v8ss *gv3_p = convert1(gv3); |
| 76 | __v8us *gv4_p = convert1(gv4); |
| 77 | __v4si *gv5_p = convert1(gv5); |
| 78 | __v4ui *gv6_p = convert1(gv6); |
| 79 | __v2sll *gv7_p = convert1(gv7); |
| 80 | __v2ull *gv8_p = convert1(gv8); |
| 81 | __v1slll *gv9_p = convert1(gv9); |
| 82 | __v1ulll *gv10_p = convert1(gv10); |
| 83 | __v4f *gv11_p = convert1(gv11); |
| 84 | __v2d *gv12_p = convert1(gv12); |
| 85 | |
| 86 | vector signed char *av1_p = convert2(av1); |
| 87 | vector unsigned char *av2_p = convert2(av2); |
| 88 | vector signed short *av3_p = convert2(av3); |
| 89 | vector unsigned short *av4_p = convert2(av4); |
| 90 | vector signed int *av5_p = convert2(av5); |
| 91 | vector unsigned int *av6_p = convert2(av6); |
| 92 | vector signed long long *av7_p = convert2(av7); |
| 93 | vector unsigned long long *av8_p = convert2(av8); |
| 94 | vector signed __int128 *av9_p = convert2(av9); |
| 95 | vector unsigned __int128 *av10_p = convert2(av10); |
| 96 | vector float *av11_p = convert2(av11); |
| 97 | vector double *av12_p = convert2(av12); |
| 98 | convert2(av13); // expected-error {{call to 'convert2' is ambiguous}} |
| 99 | convert2(av14); // expected-error {{call to 'convert2' is ambiguous}} |
| 100 | } |