This is an archive of the discontinued LLVM Phabricator instance.

[flang]Fix build failure in tests

Authored by Leporacanthicus on Nov 3 2022, 6:28 AM.



After submitting the DataLayout fix, some tests fail when they didn't
before. This has to do with the target essentially being ignored when
these tests were run earlier, as the --target x86-unknown-linux-gnu
only has to be correctly formed to be accepted.

Now the target triple is actually being used to get the targetmachine
earlier - before MLIR is generated - so the test that has a valid target
but not available on the platform fails.

Fix is to require x86 registered target when running those tests.

Diff Detail

Event Timeline

Leporacanthicus created this revision.Nov 3 2022, 6:28 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 3 2022, 6:28 AM
Leporacanthicus requested review of this revision.Nov 3 2022, 6:28 AM
tblah added a comment.Nov 3 2022, 6:36 AM
This comment was removed by tblah.

What if you remove --target=x86_64-unknown-linux-gnu instead and make the tests target agnostic?

Update to correct typos.

Instead of requiring x86, remove target in tests. This will allow
testing on a wider range of targets, rather than a smaller range.

tblah added inline comments.Nov 3 2022, 7:22 AM

Why does this test require x86 now that the --target flag is removed?

awarzynski accepted this revision.Nov 3 2022, 7:26 AM

LGTM, thanks! Please wait for the pre-commit to be on the safe side :)

This revision is now accepted and ready to land.Nov 3 2022, 7:26 AM

What if you remove --target=x86_64-unknown-linux-gnu instead and make the tests target agnostic?

Yeah, that is likely working too.

Try again, this time without requires line


It doesn't. Too much haste, not enough speed! :)

This revision was automatically updated to reflect the committed changes.