]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Clean up testsuite for multi-lib testing [NFC]
authorKito Cheng <kito.cheng@sifive.com>
Fri, 5 Jan 2024 07:30:52 +0000 (15:30 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Fri, 5 Jan 2024 08:36:08 +0000 (16:36 +0800)
- Drop unnecessary including for stdlib.h and math.h
- Drop assert.h / assert, use __builtin_abort instead.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h:
Use __builtin_abort instead of assert.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c: Drop math.h.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h: Use
__builtin_abort instead of assert.
* gcc.target/riscv/rvv/autovec/pr112694-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h: Ditto.
* gcc.target/riscv/rvv/autovec/unop/abs-template.h: Drop stdlib.h.
* gcc.target/riscv/rvv/autovec/unop/vneg-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/unop/vnot-template.h: Ditto.

23 files changed:
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h

index 8d1cefdca85a076f4890a2cf03d77c88cafe8ce4..2cf645af26ed2918e9b39fb7251fc421b6d2a8f3 100644 (file)
@@ -3,7 +3,6 @@
 /* { dg-additional-options "-std=c99 --param=riscv-autovec-preference=scalable -fno-vect-cost-model --save-temps" } */
 
 #include <stdint-gcc.h>
-#include <assert.h>
 
 #define SHIFTL(TYPE,VAL)                               \
   __attribute__ ((noipa))                               \
@@ -64,7 +63,7 @@ TEST_ALL()
     a##TYPE##VAL[i] = 2;               \
   vsll_##TYPE_##VAL (a##TYPE##VAL, SZ);        \
   for (int i = 0; i < SZ; i++)         \
-    assert (a##TYPE##VAL[i] == (2ll << VAL));
+    if (a##TYPE##VAL[i] != (2ll << VAL)) __builtin_abort ();
 
 __attribute__((noipa))
 void vsllvx (uint32_t *dst, int val, int n)
@@ -79,7 +78,7 @@ void vsllvx (uint32_t *dst, int val, int n)
     a[i] = 2;          \
   vsllvx (a, 17, SZ);  \
   for (int i = 0; i < SZ; i++)         \
-    assert (a[i] == (2 << 17));
+    if (a[i] != (2 << 17)) __builtin_abort ();
 
 int main ()
 {
index 25c35cf060793e3c3fdc78b44ebce3f17717335c..fedee13aab8631a41e7bafe7624fdace1794d9ff 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index 17f86238b0f970f85205bfc5b8e6baa9d5fae03b..76f69e44f2c0def032d34f73fc18e49ce4ce588b 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index 9a29b52de3d7cdb5e899962f5ee3930e4b179dd1..bb8d1ae61f104194fc4e7952ea7a1a9222123bb8 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index cba6cdf2a0fea8d574b0f8096d9edd7e1192efe2..e4bb3838cb7042d9b2eb527d4252bb9130a4abb1 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index c6929a7c1017bec24c61b9595c35fcfa27935665..1afa2f2a6db68b79578c8fe22f2639ec9b8dc830 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index b8a184161f937ac0e5a86c7f026fc20b8e56bd11..23762b799c49a3aa23d7c717fa8df0d9dd0ac262 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index af06f11b99db587332c8b432267920bac1ccfd7b..1837fda24145804914048955d5e0f361bf79ca90 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index e6a5a76ca46b0b00a3caaae3ad2c2bd660fa34cb..766e42cab2e6f6611d7fae75023d2c776c6027c8 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
index 2c8fbfb0c9e804c7ec8a2d8b1443ce5b62e6cd9d..59b22dbc8cf78ef18918adf39cc362ca84104132 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-1.c"
index fe0455412ba3edd6e9109021212583c4853f79ad..500c4bcf5265c5dc00cd0f24a556683de9e7e10b 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-2.c"
index e76361c94ba0667b0753692c7cc38f4c2dfa952f..85b9238cee9163715fbc4529adb97b137361cd7c 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-3.c"
index 9399a4027ffc43ecb1e4575ee3675267320d3deb..5ec7fd7a023ba277ccb4be446d90a5e3a6f92000 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-4.c"
index 77bc6e7a77e3a74fc4f33715a76c0763148d1b5c..a839dc3a1d36fb6048f7b144827b6c372a00e89c 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-1.c"
index 8e330afac83d381d840a3665dda95d08e4651521..7a3fca2614626c6986129307dda1ff80e056c247 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-2.c"
index 5caeac9b4e1f801e50a7cab4b5553a606439ce8a..ed0493691f71aaa2ba4d9c3d366ad90490695499 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-3.c"
index 8281dc688e743630937f91eec5ced09b0c6142f6..3ba72d29095fb03031d0ee526bc408aae0d6fd58 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-4.c"
index a94f3eb0f0610b3a290f69c97d5417cb77b3770d..a3c529572efa5566124ed9fda54e0f80732f1f7a 100644 (file)
@@ -1,4 +1,3 @@
-#include <assert.h>
 #include <stdint-gcc.h>
 
 #define N 777
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond_##TYPE[i] && i < 8)                                             \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+         if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+       }                                                                      \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+         if (b_##TYPE[i] == 0) __builtin_abort();                             \
+       }                                                                      \
     }
 
 #define TEST_ALL(T)                                                            \
index e60e0b1ae33584bc8fc81e21b8421dae67989d2d..604e90480559fe1c92d9edf5b2123c8c03b5da0c 100644 (file)
@@ -1,4 +1,3 @@
-#include <assert.h>
 #include <stdint-gcc.h>
 
 #define N 777
@@ -22,9 +21,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 5)                                                    \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define run_2(TYPE)                                                            \
@@ -34,9 +37,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 17)                                                   \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define run_3(TYPE)                                                            \
@@ -46,9 +53,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 32)                                                   \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define run_4(TYPE)                                                            \
@@ -58,9 +69,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 128)                                                  \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define run_5(TYPE)                                                            \
@@ -70,9 +85,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 177)                                                  \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define run_6(TYPE)                                                            \
@@ -82,7 +101,9 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 255)                                                  \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
        assert (b_##TYPE[i] == 0);                                             \
     }
@@ -94,9 +115,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 333)                                                  \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define run_8(TYPE)                                                            \
@@ -106,9 +131,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 512)                                                  \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define run_9(TYPE)                                                            \
@@ -118,7 +147,9 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 637)                                                  \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
        assert (b_##TYPE[i] == 0);                                             \
     }
@@ -130,9 +161,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 777)                                                  \
-       assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }                                                                     \
       else                                                                     \
-       assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }                                                                     \
     }
 
 #define TEST_ALL(T)                                                            \
index 8c7f7a980e4f9a82c8bfe9726200ed656ba7cac4..f50df658a9a059e14363b578dcacd89238c0decb 100644 (file)
@@ -16,8 +16,6 @@
 
 TEST_ALL()
 
-#include <assert.h>
-
 #define SZ 512
 
 #define RUN(TYPE, VAL)                                                         \
@@ -30,7 +28,7 @@ TEST_ALL()
     }                                                                          \
   vmul_##TYPE (a##TYPE, a##TYPE, b##TYPE, SZ);                                 \
   for (int i = 0; i < SZ; i++)                                                 \
-    assert (a##TYPE[i] == 2 * VAL);
+    if (a##TYPE[i] != 2 * VAL) __builtin_abort ();
 
 #define RUN_ALL()      \
  RUN(_Float16, 4)      \
index 08bd5b3629c26966299c59a5e57c6e9fb00838ff..851515ef6d76e39ec4b80289eaaf7b0667619171 100644 (file)
@@ -1,4 +1,3 @@
-#include <stdlib.h>
 #include <stdint-gcc.h>
 
 #define TEST_TYPE(TYPE)                                \
index 892d9d72c38aea1dce5252133c7b7dc65ad42319..e4e5e71ef2ff705ba3c285740642f44f610336ad 100644 (file)
@@ -1,4 +1,3 @@
-#include <stdlib.h>
 #include <stdint-gcc.h>
 
 #define TEST_TYPE(TYPE)                                \
index 747375ead805ccc85c1bd595b448a58e32781da2..1eedcc0b55954ab1787983a8e57367810a32f075 100644 (file)
@@ -1,4 +1,3 @@
-#include <stdlib.h>
 #include <stdint-gcc.h>
 
 #define TEST_TYPE(TYPE)                                \