This is an archive of the discontinued LLVM Phabricator instance.

Skip MCJIT unit tests if LLVM is not configured for native compilation
ClosedPublic

Authored by broadwaylamb on Sep 3 2019, 2:52 AM.

Details

Summary

When running MCJIT unit test, ensure that the host target is something LLVM can generate code for.

Without this change, the tests could fail if LLVM was configured for cross-compilation e. g. from x86 to ARM.

Diff Detail

Repository
rL LLVM

Event Timeline

broadwaylamb created this revision.Sep 3 2019, 2:52 AM
broadwaylamb marked an inline comment as done.Sep 3 2019, 3:01 AM
broadwaylamb added inline comments.
llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
39 ↗(On Diff #218417)

This was not in the upstream. I tried to fix these tests by changing this line to sys::getProcessTriple() and committed it to my local git repo, and now reverted it, so Arcanist has caught this change.

The upstream uses sys::getProcessTriple(), so please ignore this change.

broadwaylamb marked an inline comment as done.Sep 3 2019, 3:03 AM
broadwaylamb added inline comments.
llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
39 ↗(On Diff #218417)

Correction: I tried to fix these tests by changing this line to sys::getDefaultTargetTriple(), and here reverted it back to sys::getProcessTriple().

Replaced an accidental tab with spaces

dblaikie added inline comments.Sep 3 2019, 11:31 AM
llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
58 ↗(On Diff #218426)

Please use 'nullptr' rather than '0' for a null pointer constant.

Use nullptr instead of 0

dblaikie accepted this revision.Sep 3 2019, 11:42 AM

Seems reasonable to me - do you need me to commit this for you?

This revision is now accepted and ready to land.Sep 3 2019, 11:42 AM
broadwaylamb marked an inline comment as done.Sep 3 2019, 11:46 AM
broadwaylamb added inline comments.
llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
58 ↗(On Diff #218426)

I'm not sure I understand how Phabricator works: does the most recent diff get composed with the older one, or rather replaces it?

Seems reasonable to me - do you need me to commit this for you?

I don't have commit access, so yes