Skip to content

Fix asm.rs test #304

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

Closed
wants to merge 1 commit into from
Closed

Fix asm.rs test #304

wants to merge 1 commit into from

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Jul 12, 2023

add 1, %rax in AT&T syntax gets interpreted as add rax, qword ptr [1]. Use $ to make it explicit that it is a constant rather than an address.

`add 1, %rax` in AT&T syntax gets interpreted as `add rax, qword ptr [1]`. Use `$` to make it explicit that it is a constant rather than an address.
@bjorn3
Copy link
Member Author

bjorn3 commented Jul 12, 2023

I don't know how this didn't result in a crash for cg_gcc (maybe GCC adds the $ for you?), but both LLVM and GAS (as used by Cranelift) produce code that crashes.

@antoyo
Copy link
Contributor

antoyo commented Sep 9, 2023

Thanks for finding this. I fixed it in #330.

cg_gcc added $ manually.

@antoyo antoyo closed this Sep 9, 2023
@bjorn3 bjorn3 deleted the patch-1 branch September 9, 2023 22:13
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.

2 participants