diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-07-11 15:55:54 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-07-11 16:08:11 +0800 |
commit | 312839653b8295599c63cae90278a87af528edad (patch) | |
tree | bed3ff6d5c31254ffd2cad1a7157039543986896 | |
parent | 104b09005229ef48a79a33511ea192bb3ec3c415 (diff) | |
download | gcc-312839653b8295599c63cae90278a87af528edad.zip gcc-312839653b8295599c63cae90278a87af528edad.tar.gz gcc-312839653b8295599c63cae90278a87af528edad.tar.bz2 |
testsuite: Unbreak pr110557.cc where long is 32-bit
On ports with 32-bit long, the test produced excess errors:
gcc/testsuite/g++.dg/vect/pr110557.cc:12:8: warning: width of
'Item::y' exceeds its type
Reported-by: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
gcc/testsuite/ChangeLog:
* g++.dg/vect/pr110557.cc: Use long long instead of long for
64-bit type.
(test): Remove an unnecessary cast.
-rw-r--r-- | gcc/testsuite/g++.dg/vect/pr110557.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/testsuite/g++.dg/vect/pr110557.cc b/gcc/testsuite/g++.dg/vect/pr110557.cc index e1fbe1c..effb67e 100644 --- a/gcc/testsuite/g++.dg/vect/pr110557.cc +++ b/gcc/testsuite/g++.dg/vect/pr110557.cc @@ -1,7 +1,9 @@ // { dg-additional-options "-mavx" { target { avx_runtime } } } -static inline long -min (long a, long b) +typedef long long i64; + +static inline i64 +min (i64 a, i64 b) { return a < b ? a : b; } @@ -9,16 +11,16 @@ min (long a, long b) struct Item { int x : 8; - long y : 55; + i64 y : 55; bool z : 1; }; -__attribute__ ((noipa)) long +__attribute__ ((noipa)) i64 test (Item *a, int cnt) { - long size = 0; + i64 size = 0; for (int i = 0; i < cnt; i++) - size = min ((long)a[i].y, size); + size = min (a[i].y, size); return size; } |