This is an archive of the discontinued LLVM Phabricator instance.

[test-suite][mips] Deduce using MIPS architecture automatically
ClosedPublic

Authored by atanasyan on Feb 11 2016, 6:33 AM.

Details

Summary

Use check_symbol_exists() to check macros defined by compiler and deduce enabled MIPS features like mips16. If for example mips16 is enabled, define MIPS_IS_MIPS16_ENABLED flag. Then use this flags to include feature specific test cases or disable tests unsupported for the feature.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 47638.Feb 11 2016, 6:33 AM
atanasyan retitled this revision from to [test-suite][mips] Fix MIPS related conditions in the CMakeLists.txt.
atanasyan updated this object.
atanasyan added reviewers: rengolin, dsanders.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a subscriber: llvm-commits.
dsanders edited edge metadata.Feb 15 2016, 8:10 AM

Why not use 'MATCHES'?

if(NOT MIPSARCH MATCHES mips16)

and similar.

Why not use 'MATCHES'?

if(NOT MIPSARCH MATCHES mips16)

and similar.

Is it possible to set MIPSARCH to something like mips16xxx like mips32 and mups32r2? If not, you are right and using MATCHES is the best choice.

My thinking was that they're both substring matches and the shorter version is a bit simpler. Having dug into it a bit more it looks like MIPSARCH has just been transcribed from the Makefile where it was an arbitrary string provided by one of our internal buildbots. 'mips16' is the only MIPS16-related value I can see.

In light of that, we probably shouldn't require the user to provide it and instead figure it out from the CFLAGS/CXXFLAGS by checking for __mips16 with check_symbol_exists(). Similarly for the other checks on MIPSARCH.

we probably shouldn't require the user to provide it and instead figure it out from the CFLAGS/CXXFLAGS by checking for __mips16 with check_symbol_exists(). Similarly for the other checks on MIPSARCH.

Good point. I will rewrite the patch accordingly.

atanasyan updated this revision to Diff 48313.Feb 18 2016, 7:29 AM
atanasyan retitled this revision from [test-suite][mips] Fix MIPS related conditions in the CMakeLists.txt to [test-suite][mips] Deduce using MIPS architecture automatically.
atanasyan updated this object.
atanasyan edited edge metadata.

Use check_symbol_exists to automatically deduce enabled MIPS features, set the corresponding 'flags' and check this flag in CMakeLists.txt files.

dsanders accepted this revision.Feb 19 2016, 4:11 AM
dsanders edited edge metadata.

LGTM

This revision is now accepted and ready to land.Feb 19 2016, 4:11 AM
This revision was automatically updated to reflect the committed changes.