aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h')
-rw-r--r--unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h b/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
index 8160a18..7b6e39f 100644
--- a/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
+++ b/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
@@ -49,11 +49,23 @@ protected:
/// Returns true if the host architecture is known to support MCJIT
bool ArchSupportsMCJIT() {
Triple Host(HostTriple);
+ // If ARCH is not supported, bail
if (std::find(SupportedArchs.begin(), SupportedArchs.end(), Host.getArch())
- == SupportedArchs.end()) {
+ == SupportedArchs.end())
return false;
- }
- return true;
+
+ // If ARCH is supported and has no specific sub-arch support
+ if (std::find(HasSubArchs.begin(), HasSubArchs.end(), Host.getArch())
+ == HasSubArchs.end())
+ return true;
+
+ // If ARCH has sub-arch support, find it
+ SmallVectorImpl<std::string>::const_iterator I = SupportedSubArchs.begin();
+ for(; I != SupportedSubArchs.end(); ++I)
+ if (Host.getArchName().startswith(I->c_str()))
+ return true;
+
+ return false;
}
/// Returns true if the host OS is known to support MCJIT
@@ -68,6 +80,8 @@ protected:
std::string HostTriple;
SmallVector<Triple::ArchType, 4> SupportedArchs;
+ SmallVector<Triple::ArchType, 1> HasSubArchs;
+ SmallVector<std::string, 2> SupportedSubArchs; // We need to own the memory
SmallVector<Triple::OSType, 4> UnsupportedOSs;
};