From d4c7c06a399c8e243299c62d10be2cfd3d5afa1f Mon Sep 17 00:00:00 2001
From: Reid Kleckner <reid@kleckner.net>
Date: Fri, 23 Jan 2015 21:11:40 +0000
Subject: [PATCH] lit: Make MCJIT's supported arch check case insensitive

Should make the tests run when using CMake on systems where 'uname -p'
reports "amd64", such as FreeBSD.

Should fix PR21559.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226937 91177308-0d34-0410-b5e6-96231b3b80d8
---
 cmake/modules/AddLLVM.cmake              | 1 -
 test/ExecutionEngine/MCJIT/lit.local.cfg | 4 ++--
 test/lit.site.cfg.in                     | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index ee55c52df6e..97f2aba3ba9 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -696,7 +696,6 @@ function(configure_lit_site_cfg input output)
     set(ENABLE_ASSERTIONS "0")
   endif()
 
-  set(HOST_OS ${CMAKE_SYSTEM_NAME})
   set(HOST_ARCH ${CMAKE_SYSTEM_PROCESSOR})
 
   set(HOST_CC "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
diff --git a/test/ExecutionEngine/MCJIT/lit.local.cfg b/test/ExecutionEngine/MCJIT/lit.local.cfg
index f9814035773..229f9e50085 100644
--- a/test/ExecutionEngine/MCJIT/lit.local.cfg
+++ b/test/ExecutionEngine/MCJIT/lit.local.cfg
@@ -8,8 +8,8 @@ else:
 
 # FIXME: autoconf and cmake produce different arch names. We should normalize
 # them before getting here.
-if root.host_arch not in ['i386', 'x86', 'x86_64', 'AMD64',
-                          'AArch64', 'ARM', 'Mips', 'PowerPC', 'ppc64', 'SystemZ']:
+if root.host_arch.lower() not in ['i386', 'x86', 'x86_64', 'amd64', 'aarch64',
+                                  'arm', 'mips', 'powerpc', 'ppc64', 'systemz']:
     config.unsupported = True
 
 if 'armv7' in root.host_arch:
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 64ad0c39842..0045306106b 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -22,7 +22,6 @@ config.enable_shared = @ENABLE_SHARED@
 config.enable_assertions = @ENABLE_ASSERTIONS@
 config.targets_to_build = "@TARGETS_TO_BUILD@"
 config.llvm_bindings = "@LLVM_BINDINGS@".split(' ')
-config.host_os = "@HOST_OS@"
 config.host_arch = "@HOST_ARCH@"
 config.host_cc = "@HOST_CC@"
 config.host_cxx = "@HOST_CXX@"