1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-Ofast -mlow-precision-sqrt" } */
3 
4 #include "rsqrt_1.c"
5 
6 #define N 77
7 
8 #define TEST_LOOP(TYPE, FN)					\
9   {								\
10     TYPE a[N];							\
11     for (int i = 0; i < N; ++i)					\
12       a[i] = i + 1;						\
13     test_##TYPE (a, N);						\
14     for (int i = 0; i < N; ++i)					\
15       {								\
16 	double diff = a[i] - 1.0 / __builtin_sqrt (i + 1);	\
17 	if (__builtin_fabs (diff) > 0x1.0p-8)			\
18 	  __builtin_abort ();					\
19       }								\
20   }
21 
22 int
main(void)23 main (void)
24 {
25   TEST_ALL (TEST_LOOP);
26   return 0;
27 }
28