Skip to content

Commit a6e16a0

Browse files
authored
Add a test for dnrm(..., incx=-1)
1 parent 4a6025a commit a6e16a0

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

utest/test_dnrm2.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
3030
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131
3232
**********************************************************************************/
33-
33+
#include <math.h>
3434
#include "openblas_utest.h"
3535
#if defined(BUILD_DOUBLE)
3636

@@ -64,4 +64,17 @@ CTEST(dnrm2,dnrm2_tiny)
6464
res1=BLASFUNC(dnrm2)(&n, x, &incx);
6565
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
6666
}
67+
CTEST(dnrm2,dnrm2_neg_incx)
68+
{
69+
int i;
70+
double x[5];
71+
blasint incx=-1;
72+
blasint n=5;
73+
double res1, res2;
74+
75+
for (i=0;i<n;i++)x[i]=10.0
76+
res1=BLASFUNC(dnrm2)(&n, x, &incx);
77+
res2 = sqrt(500.0);
78+
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
79+
}
6780
#endif

0 commit comments

Comments
 (0)