15b4ed490SMaryam Moghadas // RUN: %clang_cc1 -triple=powerpc64-unknown-linux-gnu -target-feature +altivec -target-feature +vsx -target-cpu pwr8 -fsyntax-only -verify=expected,nonaix %s
25b4ed490SMaryam Moghadas // RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature +altivec -target-feature +vsx -target-cpu pwr8 -fsyntax-only -verify=expected,novsx %s
35b4ed490SMaryam Moghadas // RUN: %clang_cc1 -triple=powerpc64-ibm-aix -target-feature +altivec -target-feature +vsx -target-cpu pwr8 -fsyntax-only -verify=expected,aix %s
45b4ed490SMaryam Moghadas
560b117aaSMaryam Moghadas vector bool short vbs;
660b117aaSMaryam Moghadas vector signed short vss;
760b117aaSMaryam Moghadas vector unsigned short vus;
860b117aaSMaryam Moghadas vector bool int vbi;
960b117aaSMaryam Moghadas vector signed int vsi;
1060b117aaSMaryam Moghadas vector unsigned int vui;
1160b117aaSMaryam Moghadas vector bool long long vbl;
1260b117aaSMaryam Moghadas vector signed long long vsl;
1360b117aaSMaryam Moghadas vector unsigned long long vul;
1460b117aaSMaryam Moghadas vector bool char vbc;
1560b117aaSMaryam Moghadas vector signed char vsc;
1660b117aaSMaryam Moghadas vector unsigned char vuc;
1760b117aaSMaryam Moghadas vector pixel vp;
1860b117aaSMaryam Moghadas
195b4ed490SMaryam Moghadas void dummy(vector unsigned int a);
test(vector unsigned char a,vector unsigned char b)205b4ed490SMaryam Moghadas template <typename VEC> VEC __attribute__((noinline)) test(vector unsigned char a, vector unsigned char b) {
215b4ed490SMaryam Moghadas return (VEC)(a * b);
225b4ed490SMaryam Moghadas }
test1(vector unsigned char RetImplicitConv)235b4ed490SMaryam Moghadas vector unsigned int test1(vector unsigned char RetImplicitConv) {
24*87a6865dSAaron Ballman return RetImplicitConv; // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
255b4ed490SMaryam Moghadas }
test2(vector unsigned char RetImplicitConvAddConst)265b4ed490SMaryam Moghadas vector unsigned int test2(vector unsigned char RetImplicitConvAddConst) {
27*87a6865dSAaron Ballman return RetImplicitConvAddConst + 5; // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
285b4ed490SMaryam Moghadas }
test3(vector unsigned char RetExplicitConv)295b4ed490SMaryam Moghadas vector unsigned int test3(vector unsigned char RetExplicitConv) {
305b4ed490SMaryam Moghadas return (vector unsigned int)RetExplicitConv;
315b4ed490SMaryam Moghadas }
test4(vector unsigned char RetExplicitConvAddConst)325b4ed490SMaryam Moghadas vector unsigned int test4(vector unsigned char RetExplicitConvAddConst) {
335b4ed490SMaryam Moghadas return (vector unsigned int)RetExplicitConvAddConst + 5;
345b4ed490SMaryam Moghadas }
test5(vector unsigned char RetImplicitConvAddSame1,vector unsigned char RetImplicitConvAddSame2)355b4ed490SMaryam Moghadas vector unsigned int test5(vector unsigned char RetImplicitConvAddSame1,
365b4ed490SMaryam Moghadas vector unsigned char RetImplicitConvAddSame2) {
37*87a6865dSAaron Ballman return RetImplicitConvAddSame1 + RetImplicitConvAddSame2; // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
385b4ed490SMaryam Moghadas }
test6(vector unsigned char RetExplicitConvAddSame1,vector unsigned char RetExplicitConvAddSame2)395b4ed490SMaryam Moghadas vector unsigned int test6(vector unsigned char RetExplicitConvAddSame1,
405b4ed490SMaryam Moghadas vector unsigned char RetExplicitConvAddSame2) {
415b4ed490SMaryam Moghadas return (vector unsigned int)RetExplicitConvAddSame1 +
425b4ed490SMaryam Moghadas (vector unsigned int)RetExplicitConvAddSame2;
435b4ed490SMaryam Moghadas }
test7(vector unsigned char RetExplicitConvAddSame1Full,vector unsigned char RetExplicitConvAddSame2Full)445b4ed490SMaryam Moghadas vector unsigned int test7(vector unsigned char RetExplicitConvAddSame1Full,
455b4ed490SMaryam Moghadas vector unsigned char RetExplicitConvAddSame2Full) {
465b4ed490SMaryam Moghadas return (vector unsigned int)(RetExplicitConvAddSame1Full +
475b4ed490SMaryam Moghadas RetExplicitConvAddSame2Full);
485b4ed490SMaryam Moghadas }
test8(vector unsigned char a,vector unsigned char b)495b4ed490SMaryam Moghadas vector unsigned char test8(vector unsigned char a, vector unsigned char b) {
505b4ed490SMaryam Moghadas return test<vector unsigned char>(a, b);
515b4ed490SMaryam Moghadas }
525b4ed490SMaryam Moghadas
test9(vector unsigned char a,vector unsigned char b)535b4ed490SMaryam Moghadas vector unsigned long long test9(vector unsigned char a, vector unsigned char b) {
545b4ed490SMaryam Moghadas return test<vector unsigned long long>(a, b);
555b4ed490SMaryam Moghadas }
test1a(vector unsigned char ArgImplicitConv)565b4ed490SMaryam Moghadas void test1a(vector unsigned char ArgImplicitConv) {
57*87a6865dSAaron Ballman return dummy(ArgImplicitConv); // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
585b4ed490SMaryam Moghadas }
test2a(vector unsigned char ArgImplicitConvAddConst)595b4ed490SMaryam Moghadas void test2a(vector unsigned char ArgImplicitConvAddConst) {
60*87a6865dSAaron Ballman return dummy(ArgImplicitConvAddConst + 5); // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
615b4ed490SMaryam Moghadas }
test3a(vector unsigned char ArgExplicitConv)625b4ed490SMaryam Moghadas void test3a(vector unsigned char ArgExplicitConv) {
635b4ed490SMaryam Moghadas return dummy((vector unsigned int)ArgExplicitConv);
645b4ed490SMaryam Moghadas }
test4a(vector unsigned char ArgExplicitConvAddConst)655b4ed490SMaryam Moghadas void test4a(vector unsigned char ArgExplicitConvAddConst) {
665b4ed490SMaryam Moghadas return dummy((vector unsigned int)ArgExplicitConvAddConst + 5);
675b4ed490SMaryam Moghadas }
test5a(vector unsigned char ArgImplicitConvAddSame1,vector unsigned char ArgImplicitConvAddSame2)685b4ed490SMaryam Moghadas void test5a(vector unsigned char ArgImplicitConvAddSame1,
695b4ed490SMaryam Moghadas vector unsigned char ArgImplicitConvAddSame2) {
70*87a6865dSAaron Ballman return dummy(ArgImplicitConvAddSame1 + ArgImplicitConvAddSame2); // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
715b4ed490SMaryam Moghadas }
test6a(vector unsigned char ArgExplicitConvAddSame1,vector unsigned char ArgExplicitConvAddSame2)725b4ed490SMaryam Moghadas void test6a(vector unsigned char ArgExplicitConvAddSame1,
735b4ed490SMaryam Moghadas vector unsigned char ArgExplicitConvAddSame2) {
745b4ed490SMaryam Moghadas return dummy((vector unsigned int)ArgExplicitConvAddSame1 +
755b4ed490SMaryam Moghadas (vector unsigned int)ArgExplicitConvAddSame2);
765b4ed490SMaryam Moghadas }
test7a(vector unsigned char ArgExplicitConvAddSame1Full,vector unsigned char ArgExplicitConvAddSame2Full)775b4ed490SMaryam Moghadas void test7a(vector unsigned char ArgExplicitConvAddSame1Full,
785b4ed490SMaryam Moghadas vector unsigned char ArgExplicitConvAddSame2Full) {
795b4ed490SMaryam Moghadas return dummy((vector unsigned int)(ArgExplicitConvAddSame1Full +
805b4ed490SMaryam Moghadas ArgExplicitConvAddSame2Full));
815b4ed490SMaryam Moghadas }
test_bool_compat(void)8260b117aaSMaryam Moghadas void test_bool_compat(void) {
83*87a6865dSAaron Ballman vbs = vss; // expected-warning {{implicit conversion between vector types (''__vector short' (vector of 8 'short' values)' and ''__vector __bool unsigned short' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
84*87a6865dSAaron Ballman vbs = vus; // expected-warning {{implicit conversion between vector types (''__vector unsigned short' (vector of 8 'unsigned short' values)' and ''__vector __bool unsigned short' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
8560b117aaSMaryam Moghadas
86*87a6865dSAaron Ballman vbi = vsi; // expected-warning {{implicit conversion between vector types (''__vector int' (vector of 4 'int' values)' and ''__vector __bool unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
87*87a6865dSAaron Ballman vbi = vui; // expected-warning {{implicit conversion between vector types (''__vector unsigned int' (vector of 4 'unsigned int' values)' and ''__vector __bool unsigned int' (vector of 4 'unsigned int' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
8860b117aaSMaryam Moghadas
89*87a6865dSAaron Ballman vbl = vsl; // expected-warning {{implicit conversion between vector types (''__vector long long' (vector of 2 'long long' values)' and ''__vector __bool unsigned long long' (vector of 2 'unsigned long long' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
90*87a6865dSAaron Ballman vbl = vul; // expected-warning {{implicit conversion between vector types (''__vector unsigned long long' (vector of 2 'unsigned long long' values)' and ''__vector __bool unsigned long long' (vector of 2 'unsigned long long' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
9160b117aaSMaryam Moghadas
92*87a6865dSAaron Ballman vbc = vsc; // expected-warning {{implicit conversion between vector types (''__vector signed char' (vector of 16 'signed char' values)' and ''__vector __bool unsigned char' (vector of 16 'unsigned char' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
93*87a6865dSAaron Ballman vbc = vuc; // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector __bool unsigned char' (vector of 16 'unsigned char' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
9460b117aaSMaryam Moghadas }
9560b117aaSMaryam Moghadas
test_pixel_compat(void)9660b117aaSMaryam Moghadas void test_pixel_compat(void) {
97*87a6865dSAaron Ballman vp = vbs; // expected-warning {{implicit conversion between vector types (''__vector __bool unsigned short' (vector of 8 'unsigned short' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
98*87a6865dSAaron Ballman vp = vss; // expected-warning {{implicit conversion between vector types (''__vector short' (vector of 8 'short' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
99*87a6865dSAaron Ballman vp = vus; // expected-warning {{implicit conversion between vector types (''__vector unsigned short' (vector of 8 'unsigned short' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
10060b117aaSMaryam Moghadas
101*87a6865dSAaron Ballman vp = vbi; // expected-warning {{implicit conversion between vector types (''__vector __bool unsigned int' (vector of 4 'unsigned int' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
102*87a6865dSAaron Ballman vp = vsi; // expected-warning {{implicit conversion between vector types (''__vector int' (vector of 4 'int' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
103*87a6865dSAaron Ballman vp = vui; // expected-warning {{implicit conversion between vector types (''__vector unsigned int' (vector of 4 'unsigned int' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
10460b117aaSMaryam Moghadas
105*87a6865dSAaron Ballman vp = vbl; // expected-warning {{implicit conversion between vector types (''__vector __bool unsigned long long' (vector of 2 'unsigned long long' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
106*87a6865dSAaron Ballman vp = vsl; // expected-warning {{implicit conversion between vector types (''__vector long long' (vector of 2 'long long' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
107*87a6865dSAaron Ballman vp = vul; // expected-warning {{implicit conversion between vector types (''__vector unsigned long long' (vector of 2 'unsigned long long' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
10860b117aaSMaryam Moghadas
109*87a6865dSAaron Ballman vp = vbc; // expected-warning {{implicit conversion between vector types (''__vector __bool unsigned char' (vector of 16 'unsigned char' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
110*87a6865dSAaron Ballman vp = vsc; // expected-warning {{implicit conversion between vector types (''__vector signed char' (vector of 16 'signed char' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
111*87a6865dSAaron Ballman vp = vuc; // expected-warning {{implicit conversion between vector types (''__vector unsigned char' (vector of 16 'unsigned char' values)' and ''__vector __pixel ' (vector of 8 'unsigned short' values)') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be the default}}
11260b117aaSMaryam Moghadas }
113