Skip to content

Commit

Permalink
Merge pull request OpenMathLib#4554 from ev-br/patch-1
Browse files Browse the repository at this point in the history
Add a test for dnrm(..., incx=-1)
  • Loading branch information
martin-frbg authored Mar 12, 2024
2 parents 42584b4 + 07dddde commit 161ac17
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion utest/test_dnrm2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/

#include <math.h>
#include "openblas_utest.h"
#if defined(BUILD_DOUBLE)

Expand Down Expand Up @@ -64,4 +64,17 @@ CTEST(dnrm2,dnrm2_tiny)
res1=BLASFUNC(dnrm2)(&n, x, &incx);
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
}
CTEST(dnrm2,dnrm2_neg_incx)
{
int i;
double x[5];
blasint incx=-1;
blasint n=5;
double res1, res2;

for (i=0;i<n;i++)x[i]=10.0;
res1=BLASFUNC(dnrm2)(&n, x, &incx);
res2 = sqrt(500.0);
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
}
#endif

0 comments on commit 161ac17

Please sign in to comment.