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

Grep check for LTO Test #600

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Grep check for LTO Test #600

wants to merge 4 commits into from

Conversation

Anon258
Copy link

@Anon258 Anon258 commented Jan 15, 2025

Fixes #591

Copy link
Contributor

@antoyo antoyo left a comment

Choose a reason for hiding this comment

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

Thanks. Here are a few suggestions.

# TODO: grep the asm output for "call my_func" and fail if it is found.
asm=$(objdump -dj .text tests/hello-world/target/release/hello_world)
if echo asm | grep -q "call .*mylib.*my_func" ; then
echo "call my_func found in asm"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add in this string something saying that it should not be found because LTO should have removed it and that this tests LTO.

Comment on lines 79 to 80
asm=$(objdump -dj .text tests/hello-world/target/release/hello_world)
if echo asm | grep -q "call .*mylib.*my_func" ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably more efficient to do:

Suggested change
asm=$(objdump -dj .text tests/hello-world/target/release/hello_world)
if echo asm | grep -q "call .*mylib.*my_func" ; then
call_found=$(objdump -dj .text tests/hello-world/target/release/hello_world | grep -q "call .*mylib.*my_func")
if call_found then

Comment on lines 83 to 84
else
echo "success"
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to print this.

Suggested change
else
echo "success"

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.

Grep for call my_func in the LTO test
2 participants