Index: test/CMakeLists.txt =================================================================== --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -15,36 +15,40 @@ string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) endif() -# Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below. -set(LLDB_TEST_ARGS - -C - ${LLDB_TEST_COMPILER} - CACHE STRING "Specify compiler(s) and architecture(s) with which run LLDB tests. For example: '-C gcc -C clang -A i386 -A x86_64'" - ) -string(REPLACE " " ";" LLDB_TEST_ARGS ${LLDB_TEST_ARGS}) - -set(LLDB_TRACE_DIR "${CMAKE_BINARY_DIR}/lldb-test-traces" - CACHE STRING "Set directory to output LLDB test traces (for tests that do not pass.)" - ) - -set(LLDB_COMMON_TEST_ARGS +# The default architecture with which to compile test executables is the architecture that LLDB +# itself was built with. +string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH) +if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" ) + string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE}) +endif () + +# Allow the user to override the default by setting LLDB_TEST_ARCH +set(LLDB_TEST_ARCH + ${LLDB_DEFAULT_TEST_ARCH} + CACHED STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") + +# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script +set(LLDB_TEST_USER_ARGS + -C ${LLDB_TEST_COMPILER} + CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") + +set(LLDB_TEST_COMMON_ARGS + --arch=${LLDB_TEST_ARCH} --executable ${CMAKE_BINARY_DIR}/bin/lldb${CMAKE_EXECUTABLE_SUFFIX} -s - ${LLDB_TRACE_DIR} + ${CMAKE_BINARY_DIR}/lldb-test-traces -u CXXFLAGS -u CFLAGS ) add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py - "${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}" - "Testing LLDB with args: ${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}" + "${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" + "Testing LLDB with args: ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" ) -set(LLDB_DOSEP_ARGS - -o;\"-q;${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}\" - ) +set(LLDB_DOSEP_ARGS -o;\"-q;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}\") # If tests crash cause LLDB to crash, or things are otherwise unstable, or if machine-parsable # output is desired (i.e. in continuous integration contexts) check-lldb-sep is a better target. Index: test/dotest.py =================================================================== --- test/dotest.py +++ test/dotest.py @@ -578,10 +578,7 @@ if arch.startswith('arm') and platform_system == 'Darwin': os.environ['SDKROOT'] = commands.getoutput('xcodebuild -version -sdk iphoneos.internal Path') else: - if (platform_system == 'Darwin' or (platform_system == 'Linux' and compilers == ['clang'])) and platform_machine == 'x86_64': - archs = ['x86_64', 'i386'] - else: - archs = [platform_machine] + archs = [platform_machine] if args.categoriesList: categoriesList = set(validate_categories(args.categoriesList)) Index: test/make/Makefile.rules =================================================================== --- test/make/Makefile.rules +++ test/make/Makefile.rules @@ -73,15 +73,22 @@ # On non-Apple platforms, -arch becomes -m ARCHFLAG := -m - # i386 becomes 32, and amd64 or x86_64 becomes 64 + # i386,i686 -> 32 + # amd64, x86_64, x64 -> 64 ifeq "$(ARCH)" "amd64" - override ARCH := $(subst amd64,64,$(ARCH)) + override ARCH := $(subst amd64,64,$(ARCH)) endif ifeq "$(ARCH)" "x86_64" - override ARCH := $(subst x86_64,64,$(ARCH)) + override ARCH := $(subst x86_64,64,$(ARCH)) + endif + ifeq "$(ARCH)" "x64" + override ARCH := $(subst x64,64,$(ARCH)) endif ifeq "$(ARCH)" "i386" - override ARCH := $(subst i386,32,$(ARCH)) + override ARCH := $(subst i386,32,$(ARCH)) + endif + ifeq "$(ARCH)" "i686" + override ARCH := $(subst i686,32,$(ARCH)) endif ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"