Skip to content

Commit 8174e5a

Browse files
committed
TEST: Ported integration_tests/pass_array_by_data_08.f90 from LFortran
1 parent d5121d1 commit 8174e5a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

integration_tests/array_25.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <iostream>
2+
#include <cmath>
3+
#include <xtensor/xtensor.hpp>
4+
#include <xtensor/xfixed.hpp>
5+
#include "xtensor/xio.hpp"
6+
7+
void fill_array(xt::xtensor<int, 1>& aa);
8+
9+
int main() {
10+
xt::xtensor<int, 1> a = xt::empty<int>({10});
11+
xt::xtensor_fixed<int, xt::xshape<10>> ae = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
12+
13+
fill_array(a);
14+
std::cout << a << std::endl;
15+
if( xt::any(xt::not_equal(a, ae)) ) {
16+
exit(2);
17+
}
18+
}
19+
20+
void fill_array(xt::xtensor<int, 1>& a) {
21+
int i;
22+
for( i = 0; i < 10; i++ ) {
23+
a[i] = i;
24+
}
25+
}

0 commit comments

Comments
 (0)