Skip to content

Commit c49b589

Browse files
committed
TEST: Update reference tests
1 parent 80c4d36 commit c49b589

26 files changed

Lines changed: 67 additions & 67 deletions

tests/reference/c-c_interop1-e215531.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "c-c_interop1-e215531.stdout",
9-
"stdout_hash": "31d7d540adfef1263741e1b9709e4a2a73c6208147d735906dbf233e",
9+
"stdout_hash": "fe3380db9ce7fb4c09af6a51480a8bca0eb036019395350d809aad6a",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/c-c_interop1-e215531.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void g(double a, float b, int64_t c, int32_t d);
1515
double h(double x)
1616
{
1717
double _lpython_return_variable;
18-
_lpython_return_variable = x + 1.00000000000000000e+00;
18+
_lpython_return_variable = (double)(x + 1.00000000000000000e+00);
1919
return _lpython_return_variable;
2020
}
2121

tests/reference/c-expr_01-28f449f.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "c-expr_01-28f449f.stdout",
9-
"stdout_hash": "27d18ec3d9fae80b3aed0a2538eaf9bf40fe3fc64b53939cb85936c6",
9+
"stdout_hash": "552795f789e9daadfa0faf25f97906652f2075b64617ea18c5e23cc5",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/c-expr_01-28f449f.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
inline __attribute__((always_inline)) int32_t add(int32_t x, int32_t y)
1212
{
1313
int32_t _lpython_return_variable;
14-
_lpython_return_variable = x + y;
14+
_lpython_return_variable = (int32_t)(x + y);
1515
return _lpython_return_variable;
1616
}
1717

1818
inline __attribute__((always_inline)) int32_t and_op(int32_t x, int32_t y)
1919
{
2020
int32_t _lpython_return_variable;
21-
_lpython_return_variable = x&y;
21+
_lpython_return_variable = (int32_t)(x&y);
2222
return _lpython_return_variable;
2323
}
2424

@@ -27,8 +27,8 @@ void main0()
2727
int32_t x;
2828
int32_t y;
2929
int32_t z;
30-
x = (2 + 3)*5;
31-
y = add(x, 2)*2;
30+
x = (int32_t)(((int32_t)(2 + 3))*5);
31+
y = (int32_t)(add(x, 2)*2);
3232
ASSERT(x == 25);
3333
ASSERT(y == 54);
3434
z = and_op(x, y);

tests/reference/c-func_static_01-fc146ec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "c-func_static_01-fc146ec.stdout",
9-
"stdout_hash": "ee73e20d3f4c9117a215ec15624d204af6284a433f8ddd02b6fbe632",
9+
"stdout_hash": "a1a70cc9ad426609f07b9cdd15894e3d0d26f5dcd9b030ab4c30eff3",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/c-func_static_01-fc146ec.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static int64_t fib(int64_t n)
1515
_lpython_return_variable = n;
1616
return _lpython_return_variable;
1717
}
18-
_lpython_return_variable = fib(n - 1) + fib(n - 2);
18+
_lpython_return_variable = (int64_t)(fib((int64_t)(n - 1)) + fib((int64_t)(n - 2)));
1919
return _lpython_return_variable;
2020
}
2121

tests/reference/c-loop1-3e341c7.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "c-loop1-3e341c7.stdout",
9-
"stdout_hash": "1c1acc00042d59c8ef5baa8a43e7256e0e4da753a439826b725b4f46",
9+
"stdout_hash": "63e0ecc2207e4bf34dd11997d041b401fd33a05a399684dc4a9fce0c",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/c-loop1-3e341c7.stdout

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ int32_t test_factorial_1(int32_t x)
1818
}
1919
result = 1;
2020
while (x > 0) {
21-
result = result*x;
22-
x = x - 1;
21+
result = (int32_t)(result*x);
22+
x = (int32_t)(x - 1);
2323
}
2424
_lpython_return_variable = result;
2525
return _lpython_return_variable;
@@ -31,8 +31,8 @@ int32_t test_factorial_2(int32_t x)
3131
int32_t i;
3232
int32_t result;
3333
result = 1;
34-
for (i=1; i<=x + 1 - 1; i++) {
35-
result = result*i;
34+
for (i=1; i<=(int32_t)((int32_t)(x + 1) - 1); i++) {
35+
result = (int32_t)(result*i);
3636
}
3737
_lpython_return_variable = result;
3838
return _lpython_return_variable;
@@ -49,8 +49,8 @@ int64_t test_factorial_3(int32_t x)
4949
}
5050
result = 1;
5151
while (x > 0) {
52-
result = result*x;
53-
x = x - 1;
52+
result = (int64_t)(result*x);
53+
x = (int32_t)(x - 1);
5454
}
5555
_lpython_return_variable = result;
5656
return _lpython_return_variable;

tests/reference/c-loop4-eec10d3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "c-loop4-eec10d3.stdout",
9-
"stdout_hash": "7b29698050aa02e58f3a31a1343caca208e402e20530e5c0da04d35a",
9+
"stdout_hash": "28a3c559043ff0b6bcc05f375c57a4fc8459db35cf290d6fb1b0cd7d",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/c-loop4-eec10d3.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
void test_for()
1212
{
1313
int32_t i;
14-
for (i=0; i<=10 - 1; i++) {
14+
for (i=0; i<=(int32_t)(10 - 1); i++) {
1515
if (i == 0) {
1616
continue;
1717
}

0 commit comments

Comments
 (0)