Skip to content
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

Remove duplication in test emcc_args. NFC. #7457

Closed
wants to merge 1 commit into from
Closed

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 5, 2018

-s and -O flags were appearing twice in emcc arguments

@@ -7937,6 +7937,10 @@ def make_run(name, emcc_args, env=None):
if env is None:
env = {}

# Filter out the opt level
opt_level = [a for a in emcc_args if a.startswith('-O')]
emcc_args = [a for a in emcc_args if not a.startswith('-O')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there may be tests that look at -O? in self.emcc_args, and this might break them?

Building.COMPILER_TEST_OPTS.append(arg) # so bitcode is optimized too, this is for cpp to ll
# so bitcode is optimized too, this is for cpp to ll
if opt_level:
Building.COMPILER_TEST_OPTS.append(opt_level[-1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read this wrong the first time, thinking opt_level would have to be '-O2' say, and opt_level[-1] would return '2'. Can we canonicalize opt_level = opt_level[-1] if opt_level else None earlier on?

@sbc100 sbc100 closed this Jul 12, 2019
@sbc100 sbc100 deleted the cleanup_test_args branch July 12, 2019 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants