Skip to content

Commit 72a3f88

Browse files
committed
TEST: Ported integration_tests/arrays_intrin_01.f90 from LFortran
1 parent a598de5 commit 72a3f88

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

integration_tests/array_21.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include <iostream>
2+
#include <cmath>
3+
#include <xtensor/xtensor.hpp>
4+
#include <xtensor/xfixed.hpp>
5+
#include "xtensor/xio.hpp"
6+
7+
int main() {
8+
9+
xt::xtensor_fixed<int, xt::xshape<11>> nums_int = {5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5};
10+
xt::xtensor_fixed<double, xt::xshape<5>> nums_real = {1.5, -3.2, 4.5, 0.9, 7.2};
11+
12+
if (xt::amin(nums_int)() != -5) {
13+
exit(2);
14+
}
15+
if (xt::amax(nums_int)() != 5) {
16+
exit(2);
17+
}
18+
if (xt::amin(nums_real)() != -3.2) {
19+
exit(2);
20+
}
21+
if (xt::amax(nums_real)() != 7.2) {
22+
exit(2);
23+
}
24+
25+
std::cout << xt::amin(nums_int)() << " " << xt::amax(nums_int)() << std::endl;
26+
std::cout << xt::amin(nums_real)() << " " << xt::amax(nums_real)() << std::endl;
27+
28+
return 0;
29+
30+
}

0 commit comments

Comments
 (0)