summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/sve_unpack_fcvt_unsigned_1_run.c
blob: 1c31e18c410feaebe77929a89af1a267623b7e34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* { dg-do run { target aarch64_sve_hw } } */
/* { dg-options "-O2 -ftree-vectorize -fno-inline -march=armv8-a+sve" } */

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#include "sve_unpack_fcvt_unsigned_1.c"

#define ARRAY_SIZE 153

#define VAL1 ((unsigned int) ((i * 345435) - (21 * 345435)))

int __attribute__ ((optimize (1)))
main (void)
{
  double array_dest[ARRAY_SIZE];
  unsigned int array_source[ARRAY_SIZE];

  for (int i = 0; i < ARRAY_SIZE; i++)
    array_source[i] = VAL1;

  unpack_double_int_plus9 (array_dest, array_source, ARRAY_SIZE);
  for (int i = 0; i < ARRAY_SIZE; i++)
    if (array_dest[i] != (double) (VAL1 + 9))
      {
	fprintf (stderr,"%d: %lf != %lf\n", i, array_dest[i],
		 (double) (VAL1 + 9));
	exit (1);
      }

  return 0;
}