File tree Expand file tree Collapse file tree 4 files changed +25
-21
lines changed Expand file tree Collapse file tree 4 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -1927,9 +1927,8 @@ R"(#include <stdio.h>
1927
1927
gotoid2name[x.m_target_id ] = std::string (x.m_name );
1928
1928
}
1929
1929
1930
- void visit_GoToTarget (const ASR::GoToTarget_t & /* x */ ) {
1931
- // Ignore for now
1932
- src = " " ;
1930
+ void visit_GoToTarget (const ASR::GoToTarget_t &x) {
1931
+ src = std::string (x.m_name ) + " :\n " ;
1933
1932
}
1934
1933
1935
1934
void visit_Stop (const ASR::Stop_t &x) {
Original file line number Diff line number Diff line change @@ -200,7 +200,8 @@ namespace LCompilers {
200
200
// appropriately in C backend.
201
201
_c_skip_passes = {
202
202
" pass_list_expr" ,
203
- " print_list_tuple"
203
+ " print_list_tuple" ,
204
+ " do_loops"
204
205
};
205
206
_user_defined_passes.clear ();
206
207
}
Original file line number Diff line number Diff line change 6
6
"outfile" : null ,
7
7
"outfile_hash" : null ,
8
8
"stdout" : " c-expr_01-28f449f.stdout" ,
9
- "stdout_hash" : " 0225fdec50673f9edc47db50d6269f15ccdc41d87057ba70c89a6748 " ,
9
+ "stdout_hash" : " d7b5564f134e5f2ffaa2a3c502198f6270739d1e30d7a781862b09a5 " ,
10
10
"stderr" : null ,
11
11
"stderr_hash" : null ,
12
12
"returncode" : 0
Original file line number Diff line number Diff line change @@ -36,30 +36,34 @@ struct dimension_descriptor
36
36
};
37
37
38
38
// Implementations
39
- inline __attribute__((always_inline)) int32_t add(int32_t x, int32_t y)
40
- {
41
- int32_t _lpython_return_variable;
42
- _lpython_return_variable = x + y;
43
- return _lpython_return_variable;
44
- }
45
-
46
- inline __attribute__((always_inline)) int32_t and_op(int32_t x, int32_t y)
47
- {
48
- int32_t _lpython_return_variable;
49
- _lpython_return_variable = x&y;
50
- return _lpython_return_variable;
51
- }
52
-
53
39
void main0()
54
40
{
41
+ int32_t _lpython_return_variable_add;
42
+ int32_t _lpython_return_variable_and_op;
55
43
int32_t x;
44
+ int32_t x_add;
45
+ int32_t x_and_op;
56
46
int32_t y;
47
+ int32_t y_add;
48
+ int32_t y_and_op;
57
49
int32_t z;
58
50
x = (2 + 3)*5;
59
- y = add(x, 2)*2;
51
+ x_add = x;
52
+ y_add = 2;
53
+ _lpython_return_variable_add = x_add + y_add;
54
+ goto __1;
55
+ __1: {
56
+ }
57
+ y = _lpython_return_variable_add*2;
60
58
ASSERT(x == 25);
61
59
ASSERT(y == 54);
62
- z = and_op(x, y);
60
+ x_and_op = x;
61
+ y_and_op = y;
62
+ _lpython_return_variable_and_op = x_and_op&y_and_op;
63
+ goto __2;
64
+ __2: {
65
+ }
66
+ z = _lpython_return_variable_and_op;
63
67
ASSERT(z == 16);
64
68
}
65
69
You can’t perform that action at this time.
0 commit comments