Skip to content

Commit

Permalink
Merge pull request OpenMathLib#4442 from pbo-linaro/fix-utest-compila…
Browse files Browse the repository at this point in the history
…tion

Fix utest compilation
  • Loading branch information
martin-frbg authored Jan 18, 2024
2 parents 6f0e0e4 + a4992e0 commit 500442c
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions utest/utest_main2.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CTEST_SEGFAULT
#define CTEST_ADD_TESTS_MANUALLY

#include "cblas.h"
#include "openblas_utest.h"

CTEST(amax, samax){
Expand Down Expand Up @@ -623,43 +624,43 @@ CTEST(zscal, i_nan)
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 };
double nan[] = {NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0};
cblas_zscal(9, i, &nan, 1);
ASSERT(isnan(nan[0]);
ASSERT(isnan(nan[1]);
ASSERT(isnan(nan[16]);
ASSERT(isnan(nan[17]);
ASSERT_TRUE(isnan(nan[0]));
ASSERT_TRUE(isnan(nan[1]));
ASSERT_TRUE(isnan(nan[16]));
ASSERT_TRUE(isnan(nan[17]));
}

CTEST(zscal, nan_i)
{
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 };
double nan[] = {NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0};
cblas_zscal(9, &nan, &i, 1);
ASSERT(isnan(i[0]);
ASSERT(isnan(i[1]);
ASSERT(isnan(i[16]);
ASSERT(isnan(i[17]);
ASSERT_TRUE(isnan(i[0]));
ASSERT_TRUE(isnan(i[1]));
ASSERT_TRUE(isnan(i[16]));
ASSERT_TRUE(isnan(i[17]));
}

CTEST(zscal, i_inf)
{
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 };
double inf[] = {INFINITY, 0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0};
cblas_zscal(9, i, &inf, 1);
ASSERT(isnan(inf[0]);
ASSERT(isinf(inf[1]);
ASSERT(isnan(inf[16]);
ASSERT(isinf(inf[17]);
ASSERT_TRUE(isnan(inf[0]));
ASSERT_TRUE(isinf(inf[1]));
ASSERT_TRUE(isnan(inf[16]));
ASSERT_TRUE(isinf(inf[17]));
}

CTEST(zscal, inf_i)
{
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 };
double inf[] = {INFINITY, 0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0};
cblas_zscal(9, &inf, &i, 1);
ASSERT(isnan(i[0]);
ASSERT(isinf(i[1]);
ASSERT(isnan(i[16]);
ASSERT(isinf(i[17]);
ASSERT_TRUE(isnan(i[0]));
ASSERT_TRUE(isinf(i[1]));
ASSERT_TRUE(isnan(i[16]));
ASSERT_TRUE(isinf(i[17]));
}

int main(int argc, const char ** argv){
Expand Down

0 comments on commit 500442c

Please sign in to comment.