Skip to content

Commit d3dc6a8

Browse files
committed
TEST: Ported integration_tests/associate_04.f90 from LFortran
1 parent 2318961 commit d3dc6a8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

integration_tests/pointer_03.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <iostream>
2+
#include <cmath>
3+
4+
int main() {
5+
6+
float myreal, x, y, theta, a;
7+
x = 0.42;
8+
y = 0.35;
9+
myreal = 9.1;
10+
theta = 1.5;
11+
a = 0.4;
12+
13+
{
14+
#define z -(x*2 + y*2) * cos(theta)
15+
float *v;
16+
v = &myreal;
17+
std::cout << a + z << " " << a - z << " " << *v << std::endl;
18+
*v = *v * 4.6;
19+
}
20+
21+
std::cout << myreal << std::endl;
22+
23+
if (abs(myreal - 41.86) > 1e-5) {
24+
exit(2);
25+
}
26+
27+
return 0;
28+
29+
}

0 commit comments

Comments
 (0)