diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-reduc-1.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-reduc-2.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c | 22 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c | 19 |
6 files changed, 49 insertions, 59 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c index bc87a5c62c8..a5825799380 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c @@ -8,14 +8,14 @@ /* Test vectorization of reduction of unsigned-int. */ -int main1 (unsigned int x, unsigned int max_result) +void main1 (unsigned int x, unsigned int max_result, unsigned int min_result) { int i; - unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned int udiff = 2; unsigned int umax = x; - unsigned int umin = 10; + unsigned int umin = x; /* Summation. */ for (i = 0; i < N; i++) { @@ -37,18 +37,17 @@ int main1 (unsigned int x, unsigned int max_result) abort (); if (umax != max_result) abort (); - if (umin != 0) + if (umin != min_result) abort (); - - return 0; } int main (void) { check_vect (); - main1 (100, 100); - main1 (0, 15); + main1 (100, 100, 1); + main1 (0, 15, 0); + return 0; } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c index e85fa4a20c0..418687dd23b 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c @@ -6,14 +6,15 @@ #define N 16 #define DIFF 242 -int main1 (unsigned char x, unsigned char max_result) +void +main1 (unsigned char x, unsigned char max_result, unsigned char min_result) { int i; - unsigned char ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char udiff = 2; unsigned char umax = x; - unsigned char umin = 10; + unsigned char umin = x; for (i = 0; i < N; i++) { udiff += (unsigned char)(ub[i] - uc[i]); @@ -32,18 +33,16 @@ int main1 (unsigned char x, unsigned char max_result) abort (); if (umax != max_result) abort (); - if (umin != 0) + if (umin != min_result) abort (); - - return 0; } int main (void) { check_vect (); - main1 (100, 100); - main1 (0, 15); + main1 (100, 100, 1); + main1 (0, 15, 0); return 0; } diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c index 6212f4cfdcd..91d7abd1275 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c @@ -6,14 +6,15 @@ #define N 16 #define DIFF 242 -int main1 (unsigned short x, unsigned short max_result) +void +main1 (unsigned short x, unsigned short max_result, unsigned short min_result) { int i; - unsigned short ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned short uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned short udiff = 2; unsigned short umax = x; - unsigned short umin = 10; + unsigned short umin = x; for (i = 0; i < N; i++) { udiff += (unsigned short)(ub[i] - uc[i]); @@ -32,18 +33,16 @@ int main1 (unsigned short x, unsigned short max_result) abort (); if (umax != max_result) abort (); - if (umin != 0) + if (umin != min_result) abort (); - - return 0; } int main (void) { check_vect (); - main1 (100, 100); - main1 (0, 15); + main1 (100, 100, 1); + main1 (0, 15, 0); return 0; } diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c index ca1a3da07e3..ef4499f761d 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c @@ -8,14 +8,14 @@ /* Test vectorization of reduction of signed-int. */ -int main1 (int x, int max_result) +void main1 (int x, int max_result, int min_result) { int i; - int b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - int c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; int diff = 0; int max = x; - int min = 10; + int min = x; for (i = 0; i < N; i++) { diff += (b[i] - c[i]); @@ -34,18 +34,16 @@ int main1 (int x, int max_result) abort (); if (max != max_result) abort (); - if (min != 0) + if (min != min_result) abort (); - - return 0; } int main (void) { check_vect (); - main1 (100, 100); - main1 (0, 15); + main1 (100, 100, 1); + main1 (0, 15, 0); return 0; } diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c index cd8b1304956..f8a7b96fbc9 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c @@ -6,17 +6,17 @@ #define N 16 #define DIFF 121 -int main1 (char x, char max_result) +void main1 (signed char x, signed char max_result, signed char min_result) { int i; - char b[N] = {0,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30}; - char c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30}; + signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; signed char diff = 2; - char max = x; - char min = 10; + signed char max = x; + signed char min = x; for (i = 0; i < N; i++) { - diff += (b[i] - c[i]); + diff += (signed char)(b[i] - c[i]); } for (i = 0; i < N; i++) { @@ -32,19 +32,17 @@ int main1 (char x, char max_result) abort (); if (max != max_result) abort (); - if (min != 0) + if (min != min_result) abort (); - - return 0; } int main (void) { check_vect (); - main1 (100, 100); - main1 (0, 15); - return 0 ; + main1 (100, 100, 1); + main1 (0, 15, 0); + return 0; } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c index f0880aab12a..d4ac128563c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c @@ -1,23 +1,22 @@ /* { dg-require-effective-target vect_int } */ #include <stdarg.h> -#include <stdio.h> #include "tree-vect.h" #define N 16 #define DIFF 242 -int main1 (short x, short max_result) +void main1 (short x, short max_result, short min_result) { int i; - short b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - short c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; short diff = 2; short max = x; - short min = 10; + short min = x; for (i = 0; i < N; i++) { - diff += (b[i] - c[i]); + diff += (short)(b[i] - c[i]); } for (i = 0; i < N; i++) { max = max < c[i] ? c[i] : max; @@ -32,18 +31,16 @@ int main1 (short x, short max_result) abort (); if (max != max_result) abort (); - if (min != 0) + if (min != min_result) abort (); - - return 0; } int main (void) { check_vect (); - main1 (100, 100); - main1 (0, 15); + main1 (100, 100, 1); + main1 (0, 15, 0); return 0; } |