Skip to content

WASM_X86: Support printing negative integers #1311

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

Merged
merged 4 commits into from
Nov 19, 2022

Conversation

ubaidsk
Copy link
Collaborator

@ubaidsk ubaidsk commented Nov 17, 2022

towards #1222

Example:

def main0():
    x: i32
    x = (2+3)* (-5)
    y: i32 = 100
    z: i32 = 2147483647
    w: i32 = -2147483648
    print(x)
    print(y)
    print(z)
    print(w)

main0()

Output:

(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ lpython examples/expr2.py --backend x86 -o test
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ ./test
-25
100
2147483647
-2147483648
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ lpython examples/expr2.py --backend wasm_x86 -o test
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ ./test
-25
100
2147483647
-2147483648
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ 

@ubaidsk ubaidsk force-pushed the wasm_x86_print_neg_ints branch from 4a86a8b to 08617ae Compare November 17, 2022 21:20
@ubaidsk ubaidsk mentioned this pull request Nov 18, 2022
@ubaidsk ubaidsk added ready for review PRs that are ready for review wasm_x86 labels Nov 18, 2022
Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

Looks good.

@ubaidsk ubaidsk merged commit df11263 into lcompilers:main Nov 19, 2022
@ubaidsk ubaidsk deleted the wasm_x86_print_neg_ints branch November 19, 2022 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review PRs that are ready for review wasm_x86
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants