aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c')
-rw-r--r--gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c b/gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c
new file mode 100644
index 00000000000..bdbcbc0316a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c
@@ -0,0 +1,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;
+}