Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-u8-u32.c
blobbcfbe198a3ff92bc24ed1f7a5b591403eed000d5
1 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-additional-options "-mlasx" { target loongarch*-*-* } } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 64
10 unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11 unsigned char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 unsigned int result[N];
14 /* unsigned char-> unsigned int widening-mult. */
15 __attribute__ ((noinline)) int
16 foo (int len) {
17 int i;
19 for (i=0; i<len; i++) {
20 result[i] = X[i] * Y[i];
24 int main (void)
26 int i;
28 check_vect ();
30 for (i=0; i<N; i++) {
31 X[i] = i;
32 Y[i] = 64-i;
33 __asm__ volatile ("");
36 foo (N);
38 #pragma GCC novector
39 for (i=0; i<N; i++) {
40 if (result[i] != X[i] * Y[i])
41 abort ();
44 return 0;
47 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
48 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_qi_to_hi_pattern } } } */
49 /* { dg-final { scan-tree-dump-times "widen_mult pattern recognized" 1 "vect" { target vect_widen_mult_qi_to_hi_pattern } } } */