[PATCH] D144611: [PowerPC] Adding test coverage for vector compatibility warning

2023-03-20 Thread Maryam Moghadas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG60b117aa8149: [PowerPC] Adding test coverage for vector 
compatibility warning (authored by maryammo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144611/new/

https://reviews.llvm.org/D144611

Files:
  clang/test/Parser/lax-conv.cpp


Index: clang/test/Parser/lax-conv.cpp
===
--- clang/test/Parser/lax-conv.cpp
+++ clang/test/Parser/lax-conv.cpp
@@ -2,6 +2,20 @@
 // RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature 
+altivec -target-feature +vsx -target-cpu pwr8 -fsyntax-only 
-verify=expected,novsx %s
 // RUN: %clang_cc1 -triple=powerpc64-ibm-aix -target-feature +altivec 
-target-feature +vsx -target-cpu pwr8 -fsyntax-only -verify=expected,aix %s
 
+vector bool short vbs;
+vector signed short vss;
+vector unsigned short vus;
+vector bool int vbi;
+vector signed int vsi;
+vector unsigned int vui;
+vector bool long long vbl;
+vector signed long long vsl;
+vector unsigned long long vul;
+vector bool char vbc;
+vector signed char vsc;
+vector unsigned char vuc;
+vector pixel vp;
+
 void dummy(vector unsigned int a);
 template  VEC __attribute__((noinline)) test(vector unsigned 
char a, vector unsigned char b) {
 return (VEC)(a * b);
@@ -65,3 +79,34 @@
   return dummy((vector unsigned int)(ArgExplicitConvAddSame1Full +
  ArgExplicitConvAddSame2Full));
 }
+void test_bool_compat(void) {
+  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.}}
+  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.}}
+
+  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.}}
+  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.}}
+
+  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.}}
+  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.}}
+
+  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.}}
+  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.}}
+}
+
+void test_pixel_compat(void) {
+  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.}}
+  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.}}
+  vp = vus; // expected-warning {{Implicit conversion between vector types 
(''__vector unsigned short' (vector of 8 'unsigned short' values)' 

[PATCH] D144611: [PowerPC] Adding test coverage for vector compatibility warning

2023-03-13 Thread Lei Huang via Phabricator via cfe-commits
lei accepted this revision as: lei.
lei added a comment.
This revision is now accepted and ready to land.

thx for the added coverage.
LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144611/new/

https://reviews.llvm.org/D144611

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144611: [PowerPC] Adding test coverage for vector compatibility warning

2023-02-22 Thread Maryam Moghadas via Phabricator via cfe-commits
maryammo created this revision.
Herald added subscribers: shchenz, nemanjai.
Herald added a project: All.
maryammo requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This is to test D143210  patch to have the 
same vector
compatibility logic for error and warning diagnostics.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144611

Files:
  clang/test/Parser/lax-conv.cpp


Index: clang/test/Parser/lax-conv.cpp
===
--- clang/test/Parser/lax-conv.cpp
+++ clang/test/Parser/lax-conv.cpp
@@ -2,6 +2,20 @@
 // RUN: %clang_cc1 -triple=powerpc64le-unknown-linux-gnu -target-feature 
+altivec -target-feature +vsx -target-cpu pwr8 -fsyntax-only 
-verify=expected,novsx %s
 // RUN: %clang_cc1 -triple=powerpc64-ibm-aix -target-feature +altivec 
-target-feature +vsx -target-cpu pwr8 -fsyntax-only -verify=expected,aix %s
 
+vector bool short vbs;
+vector signed short vss;
+vector unsigned short vus;
+vector bool int vbi;
+vector signed int vsi;
+vector unsigned int vui;
+vector bool long long vbl;
+vector signed long long vsl;
+vector unsigned long long vul;
+vector bool char vbc;
+vector signed char vsc;
+vector unsigned char vuc;
+vector pixel vp;
+
 void dummy(vector unsigned int a);
 template  VEC __attribute__((noinline)) test(vector unsigned 
char a, vector unsigned char b) {
 return (VEC)(a * b);
@@ -65,3 +79,34 @@
   return dummy((vector unsigned int)(ArgExplicitConvAddSame1Full +
  ArgExplicitConvAddSame2Full));
 }
+void test_bool_compat(void) {
+  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.}}
+  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.}}
+
+  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.}}
+  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.}}
+
+  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.}}
+  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.}}
+
+  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.}}
+  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.}}
+}
+
+void test_pixel_compat(void) {
+  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.}}
+  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.}}
+  vp = vus; // expected-warning