-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine global_init
and global_stmts
functions into global_stmts
#2696
Combine global_init
and global_stmts
functions into global_stmts
#2696
Conversation
c5cda5a
to
ff9e6db
Compare
if (!global_init.empty()) { | ||
for (auto t: global_init) { | ||
if (t) { | ||
items.push_back(al, t); | ||
global_init.erase(t); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be simplified to
if (!global_init.empty()) { | |
for (auto t: global_init) { | |
if (t) { | |
items.push_back(al, t); | |
global_init.erase(t); | |
} | |
} | |
} | |
for (auto t: global_init) { | |
if (t) { | |
items.push_back(al, t); | |
} | |
} | |
global_init.n = 0; |
Please add the test case in #2573 (comment) as integration test. Please ensure you add assert and print before the assert appropriately. |
Please mark this PR as "Ready for Review" when ready. |
integration_tests/CMakeLists.txt
Outdated
@@ -508,6 +508,8 @@ RUN(NAME expr_02u LABELS cpython llvm llvm_jit c NOFAST) | |||
RUN(NAME expr_03u LABELS cpython llvm llvm_jit c NOFAST) | |||
RUN(NAME expr_04u LABELS cpython llvm llvm_jit c) | |||
|
|||
RUN(NAME list_01 LABELS cpython llvm llvm_jit c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this test fails withc
backend at the CI. So let's remove it.
RUN(NAME list_01 LABELS cpython llvm llvm_jit c) | |
RUN(NAME list_01 LABELS cpython llvm llvm_jit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good. Thanks!
Fixes: #2573