Skip to content

Commit

Permalink
Fix a few lit things.
Browse files Browse the repository at this point in the history
  • Loading branch information
brycelelbach committed Apr 23, 2011
1 parent c69f8b4 commit 0eceb03
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
9 changes: 5 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ endmacro()
include(FindPythonInterp)
if (PYTHONINTERP_FOUND)
if (NOT CLANG_BOOTSTRAPPING)
set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to llvm-lit.")
else()
set(LIT_EXECUTABLE "${LLVM_SOURCE_DIR}/utils/lit/lit.py" "" CACHE FILEPATH "Path to LLVM's lit.py")
set(LIT_EXECUTABLE "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/llvm-lit"
CACHE FILEPATH "Path to llvm-lit.")
endif()

set(LIT_ARGS_DEFAULT "-sv")
Expand All @@ -29,8 +30,8 @@ if (PYTHONINTERP_FOUND)
set(LIBCXX_COMPILER ${CLANG_BOOTSTRAP_CXX_DRIVER})
endif()

set(LIBCXX_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(LIBCXX_BINARY_DIR ${CMAKE_BINARY_DIR})
set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../)
set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../)
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
pythonize_bool(LIBCXX_ENABLE_SHARED)
pythonize_bool(LIBCXX_HAS_STDCXX0X_FLAG)
Expand Down
51 changes: 25 additions & 26 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ class LibcxxTestFormat(lit.formats.FileBasedTest):
report += "\n\nExpected compilation to fail!"
return lit.Test.FAIL, report
else:
exec_file = tempfile.NamedTemporaryFile(suffix="exe", delete=False)
exec_path = exec_file.name
exec_file.close()
import uuid
exec_path = "/tmp/%s" % uuid.uuid4()

try:
compile_cmd = [self.cxx_under_test, '-o', exec_path,
Expand Down Expand Up @@ -119,36 +118,36 @@ if cxx_under_test is None:
if cxx_under_test is None:
lit.fatal('must specify user parameter cxx_under_test '
'(e.g., --param=cxx_under_test=clang++)')
include_paths = []
library_paths = []
#include_paths = []
#library_paths = []

libcxx_src_root = getattr(config, 'libcxx_src_root', None)
if libcxx_src_root is not None:
include_paths += ['-I' + libcxx_src_root + '/include']
else:
include_paths += ['-I/usr/include/c++/v1']
#libcxx_src_root = getattr(config, 'libcxx_src_root', None)
#if libcxx_src_root is not None:
# include_paths += ['-I' + libcxx_src_root + '/include']
#else:
# include_paths += ['-I/usr/include/c++/v1']

libcxx_obj_root = getattr(config, 'libcxx_obj_root', None)
if libcxx_obj_root is not None:
library_paths += ['-L' + libcxx_obj_root + '/lib']
else:
libcxx_obj_root = "/usr"
#libcxx_obj_root = getattr(config, 'libcxx_obj_root', None)
#if libcxx_obj_root is not None:
# library_paths += ['-L' + libcxx_obj_root + '/lib']
#else:
# libcxx_obj_root = "/usr"

# Configure extra compiler flags.
compile_flags = []
if getattr(config, 'cxx_has_stdcxx0x_flag', False):
compile_flags += ['-std=c++0x']
#compile_flags = []
#if getattr(config, 'cxx_has_stdcxx0x_flag', False):
# compile_flags += ['-std=c++0x']

# Configure extra libraries.
libraries = []
if sys.platform == 'darwin':
libraries += ['-lSystem']
if sys.platform == 'linux2':
libraries += ['-lgcc_eh', '-lsupc++', '-lc', '-lm', '-lrt', '-lgcc_s']
libraries += ['-Wl,-R', libcxx_obj_root + '/lib']
#libraries = []
#if sys.platform == 'darwin':
# libraries += ['-lSystem']
#if sys.platform == 'linux2':
# libraries += ['-lgcc_eh', '-lsupc++', '-lc', '-lm', '-lrt', '-lgcc_s']
# libraries += ['-Wl,-R', libcxx_obj_root + '/lib']

config.test_format = LibcxxTestFormat(cxx_under_test,
cpp_flags = ['-nostdinc++'] + compile_flags + include_paths,
ld_flags = ['-nodefaultlibs'] + library_paths + ['-lc++'] + libraries)
cpp_flags = ['-std=c++0x'],
ld_flags = [])

config.target_triple = None

0 comments on commit 0eceb03

Please sign in to comment.