brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · 4c2108d Raw
117 lines · c
1// RUN: %clang_cc1 %s -triple=powerpc64le-unknown-linux -target-feature +altivec \2// RUN:  -target-feature +vsx -verify -verify-ignore-unexpected=note -pedantic -fsyntax-only3// RUN: %clang_cc1 %s -triple=powerpc64le-unknown-linux -target-feature +altivec \4// RUN:  -target-feature +vsx -verify -verify-ignore-unexpected=note -pedantic -fsyntax-only \5// RUN:  -target-cpu pwr86 7typedef signed char __v16sc __attribute__((__vector_size__(16)));8typedef unsigned char __v16uc __attribute__((__vector_size__(16)));9typedef signed short __v8ss __attribute__((__vector_size__(16)));10typedef unsigned short __v8us __attribute__((__vector_size__(16)));11typedef signed int __v4si __attribute__((__vector_size__(16)));12typedef unsigned int __v4ui __attribute__((__vector_size__(16)));13typedef signed long long __v2sll __attribute__((__vector_size__(16)));14typedef unsigned long long __v2ull __attribute__((__vector_size__(16)));15typedef signed __int128 __v1slll __attribute__((__vector_size__(16)));16typedef unsigned __int128 __v1ulll __attribute__((__vector_size__(16)));17typedef float __v4f __attribute__((__vector_size__(16)));18typedef double __v2d __attribute__((__vector_size__(16)));19 20__v16sc *__attribute__((__overloadable__)) convert1(vector signed char);21__v16uc *__attribute__((__overloadable__)) convert1(vector unsigned char);22__v8ss *__attribute__((__overloadable__)) convert1(vector signed short);23__v8us *__attribute__((__overloadable__)) convert1(vector unsigned short);24__v4si *__attribute__((__overloadable__)) convert1(vector signed int);25__v4ui *__attribute__((__overloadable__)) convert1(vector unsigned int);26__v2sll *__attribute__((__overloadable__)) convert1(vector signed long long);27__v4f *__attribute__((__overloadable__)) convert1(vector float);28__v2d *__attribute__((__overloadable__)) convert1(vector double);29void __attribute__((__overloadable__)) convert1(vector bool int);30void __attribute__((__overloadable__)) convert1(vector pixel short);31 32vector signed char *__attribute__((__overloadable__)) convert2(__v16sc);33vector unsigned char *__attribute__((__overloadable__)) convert2(__v16uc);34vector signed short *__attribute__((__overloadable__)) convert2(__v8ss);35vector unsigned short *__attribute__((__overloadable__)) convert2(__v8us);36vector signed int *__attribute__((__overloadable__)) convert2(__v4si);37vector unsigned int *__attribute__((__overloadable__)) convert2(__v4ui);38vector signed long long *__attribute__((__overloadable__)) convert2(__v2sll);39vector unsigned long long *__attribute__((__overloadable__)) convert2(__v2ull);40vector float *__attribute__((__overloadable__)) convert2(__v4f);41vector double *__attribute__((__overloadable__)) convert2(__v2d);42 43#ifdef __POWER8_VECTOR__44__v1slll *__attribute__((__overloadable__)) convert1(vector signed __int128);45__v1ulll *__attribute__((__overloadable__)) convert1(vector unsigned __int128);46__v2ull *__attribute__((__overloadable__)) convert1(vector unsigned long long);47vector signed __int128 *__attribute__((__overloadable__)) convert2(__v1slll);48vector unsigned __int128 *__attribute__((__overloadable__)) convert2(__v1ulll);49#endif50 51void test(void) {52  __v16sc gv1;53  __v16uc gv2;54  __v8ss gv3;55  __v8us gv4;56  __v4si gv5;57  __v4ui gv6;58  __v2sll gv7;59  __v4f gv11;60  __v2d gv12;61 62#ifdef __POWER8_VECTOR__63  __v2ull gv8;64  __v1slll gv9;65  __v1ulll gv10;66#endif67 68  vector signed char av1;69  vector unsigned char av2;70  vector signed short av3;71  vector unsigned short av4;72  vector signed int av5;73  vector unsigned int av6;74  vector signed long long av7;75  vector unsigned long long av8;76#ifdef __POWER8_VECTOR__77  vector signed __int128 av9;78  vector unsigned __int128 av10;79#endif80  vector float av11;81  vector double av12;82  vector bool int av13;83  vector pixel short av14;84 85  __v16sc *gv1_p = convert1(gv1);86  __v16uc *gv2_p = convert1(gv2);87  __v8ss *gv3_p = convert1(gv3);88  __v8us *gv4_p = convert1(gv4);89  __v4si *gv5_p = convert1(gv5);90  __v4ui *gv6_p = convert1(gv6);91  __v2sll *gv7_p = convert1(gv7);92#ifdef __POWER8_VECTOR__93  __v2ull *gv8_p = convert1(gv8);94  __v1slll *gv9_p = convert1(gv9);95  __v1ulll *gv10_p = convert1(gv10);96#endif97  __v4f *gv11_p = convert1(gv11);98  __v2d *gv12_p = convert1(gv12);99 100  vector signed char *av1_p = convert2(av1);101  vector unsigned char *av2_p = convert2(av2);102  vector signed short *av3_p = convert2(av3);103  vector unsigned short *av4_p = convert2(av4);104  vector signed int *av5_p = convert2(av5);105  vector unsigned int *av6_p = convert2(av6);106  vector signed long long *av7_p = convert2(av7);107  vector unsigned long long *av8_p = convert2(av8);108#ifdef __POWER8_VECTOR__109  vector signed __int128 *av9_p = convert2(av9);110  vector unsigned __int128 *av10_p = convert2(av10);111#endif112  vector float *av11_p = convert2(av11);113  vector double *av12_p = convert2(av12);114  convert2(av13); // expected-error {{call to 'convert2' is ambiguous}}115  convert2(av14); // expected-error {{call to 'convert2' is ambiguous}}116}117