@@ -369,6 +369,38 @@ CTEST(dsdot,dsdot_n_1)
369
369
370
370
}
371
371
372
+ #if defined(BUILD_DOUBLE )
373
+ CTEST (dnrm2 ,dnrm2_inf )
374
+ {
375
+ #ifndef INFINITY
376
+ #define INFINITY HUGE_VAL
377
+ #endif
378
+ int i ;
379
+ double x [29 ];
380
+ blasint incx = 1 ;
381
+ blasint n = 28 ;
382
+ double res1 = 0.0f , res2 = INFINITY ;
383
+
384
+ for (i = 0 ;i < n ;i ++ )x [i ]= 0.0f ;
385
+ x [10 ]= - INFINITY ;
386
+ res1 = BLASFUNC (dnrm2 )(& n , x , & incx );
387
+ ASSERT_DBL_NEAR_TOL (res2 , res1 , DOUBLE_EPS );
388
+
389
+ }
390
+ CTEST (dnrm2 ,dnrm2_tiny )
391
+ {
392
+ int i ;
393
+ double x [29 ];
394
+ blasint incx = 1 ;
395
+ blasint n = 28 ;
396
+ double res1 = 0.0f , res2 = 0.0f ;
397
+
398
+ for (i = 0 ;i < n ;i ++ )x [i ]= 7.457008414e-310 ;
399
+ res1 = BLASFUNC (dnrm2 )(& n , x , & incx );
400
+ ASSERT_DBL_NEAR_TOL (res2 , res1 , DOUBLE_EPS );
401
+ }
402
+ #endif
403
+
372
404
CTEST (rot ,drot_inc_0 )
373
405
{
374
406
blasint i = 0 ;
@@ -606,6 +638,7 @@ int main(int argc, const char ** argv){
606
638
CTEST_ADD (zdotu ,zdotu_n_1 );
607
639
CTEST_ADD (zdotu ,zdotu_offset_1 );
608
640
CTEST_ADD (dsdot ,dsdot_n_1 );
641
+ CTEST_ADD (dnrm2 ,dnrm2_inf );
609
642
CTEST_ADD (dnrm2 ,dnrm2_tiny );
610
643
CTEST_ADD (rot ,drot_inc_0 );
611
644
CTEST_ADD (rot ,zdrot_inc_0 );
0 commit comments