aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c
blob: bdbcbc0316a7e49524c35a5f23ea40e5735a7ca5 (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
34
35
36
37
/* { dg-do run } */
/* { dg-options "-O1 -ftree-slp-vectorize -funroll-loops" } */

#include <stdio.h>
#include <stdlib.h>
#define N 4
volatile float f[N];
int x[N] __attribute__((aligned(8)));
int main() {
  int i;
  x[0] = -1;
  x[1] = 2;
  x[2] = -2;
  x[3] = 2;

  for (i=0;i<N;++i){
    f[i] = x[i];
  }

  if (f[0] != -1.0f) {
    abort();
  }

  if (f[1] != 2.0f) {
    abort();
  }

  if (f[2] != -2.0f) {
    abort();
  }

  if (f[3] != 2.0f) {
    abort();
  }

  return 0;
}