head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.1
	netbsd-11-0-RC3:1.1.1.1
	netbsd-11-0-RC2:1.1.1.1
	netbsd-11-0-RC1:1.1.1.1
	perseant-exfatfs-base-20250801:1.1.1.1
	netbsd-11:1.1.1.1.0.42
	netbsd-11-base:1.1.1.1
	netbsd-10-1-RELEASE:1.1.1.1
	perseant-exfatfs-base-20240630:1.1.1.1
	perseant-exfatfs:1.1.1.1.0.40
	perseant-exfatfs-base:1.1.1.1
	netbsd-9-4-RELEASE:1.1.1.1
	netbsd-10-0-RELEASE:1.1.1.1
	netbsd-10-0-RC6:1.1.1.1
	netbsd-10-0-RC5:1.1.1.1
	netbsd-10-0-RC4:1.1.1.1
	netbsd-10-0-RC3:1.1.1.1
	netbsd-10-0-RC2:1.1.1.1
	thorpej-ifq:1.1.1.1.0.38
	thorpej-ifq-base:1.1.1.1
	thorpej-altq-separation:1.1.1.1.0.36
	thorpej-altq-separation-base:1.1.1.1
	netbsd-10-0-RC1:1.1.1.1
	netbsd-10:1.1.1.1.0.34
	netbsd-10-base:1.1.1.1
	bouyer-sunxi-drm:1.1.1.1.0.32
	bouyer-sunxi-drm-base:1.1.1.1
	netbsd-9-3-RELEASE:1.1.1.1
	thorpej-i2c-spi-conf2:1.1.1.1.0.30
	thorpej-i2c-spi-conf2-base:1.1.1.1
	thorpej-futex2:1.1.1.1.0.28
	thorpej-futex2-base:1.1.1.1
	thorpej-cfargs2:1.1.1.1.0.26
	thorpej-cfargs2-base:1.1.1.1
	cjep_sun2x-base1:1.1.1.1
	cjep_sun2x:1.1.1.1.0.24
	cjep_sun2x-base:1.1.1.1
	cjep_staticlib_x-base1:1.1.1.1
	netbsd-9-2-RELEASE:1.1.1.1
	cjep_staticlib_x:1.1.1.1.0.22
	cjep_staticlib_x-base:1.1.1.1
	thorpej-i2c-spi-conf:1.1.1.1.0.20
	thorpej-i2c-spi-conf-base:1.1.1.1
	thorpej-cfargs:1.1.1.1.0.18
	thorpej-cfargs-base:1.1.1.1
	thorpej-futex:1.1.1.1.0.16
	thorpej-futex-base:1.1.1.1
	netbsd-9-1-RELEASE:1.1.1.1
	bouyer-xenpvh-base2:1.1.1.1
	phil-wifi-20200421:1.1.1.1
	bouyer-xenpvh-base1:1.1.1.1
	phil-wifi-20200411:1.1.1.1
	bouyer-xenpvh:1.1.1.1.0.14
	bouyer-xenpvh-base:1.1.1.1
	is-mlppp:1.1.1.1.0.12
	is-mlppp-base:1.1.1.1
	phil-wifi-20200406:1.1.1.1
	ad-namecache-base3:1.1.1.1
	netbsd-9-0-RELEASE:1.1.1.1
	netbsd-9-0-RC2:1.1.1.1
	ad-namecache-base2:1.1.1.1
	ad-namecache-base1:1.1.1.1
	ad-namecache:1.1.1.1.0.10
	ad-namecache-base:1.1.1.1
	netbsd-9-0-RC1:1.1.1.1
	phil-wifi-20191119:1.1.1.1
	netbsd-9:1.1.1.1.0.8
	netbsd-9-base:1.1.1.1
	phil-wifi:1.1.1.1.0.6
	phil-wifi-20190609:1.1.1.1
	isaki-audio2:1.1.1.1.0.4
	isaki-audio2-base:1.1.1.1
	pgoyette-compat-merge-20190127:1.1.1.1.2.2
	pgoyette-compat-20190127:1.1.1.1
	pgoyette-compat:1.1.1.1.0.2
	pgoyette-compat-20190118:1.1.1.1
	compiler-rt-350590:1.1.1.1
	LLVM:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2019.01.08.05.40.32;	author kamil;	state Exp;
branches
	1.1.1.1;
next	;
commitid	JxKaWKiFa0y4nW6B;

1.1.1.1
date	2019.01.08.05.40.32;	author kamil;	state Exp;
branches
	1.1.1.1.2.1
	1.1.1.1.6.1;
next	;
commitid	JxKaWKiFa0y4nW6B;

1.1.1.1.2.1
date	2019.01.08.05.40.32;	author pgoyette;	state dead;
branches;
next	1.1.1.1.2.2;
commitid	Lmlzg3OVT2cd6f8B;

1.1.1.1.2.2
date	2019.01.18.08.50.50;	author pgoyette;	state Exp;
branches;
next	;
commitid	Lmlzg3OVT2cd6f8B;

1.1.1.1.6.1
date	2019.01.08.05.40.32;	author christos;	state dead;
branches;
next	1.1.1.1.6.2;
commitid	jtc8rnCzWiEEHGqB;

1.1.1.1.6.2
date	2019.06.10.22.07.48;	author christos;	state Exp;
branches;
next	;
commitid	jtc8rnCzWiEEHGqB;


desc
@@


1.1
log
@Initial revision
@
text
@include(CompilerRTCompile)

filter_available_targets(INTERCEPTION_UNITTEST_SUPPORTED_ARCH x86_64 i386 mips64 mips64el)

set(INTERCEPTION_UNITTESTS
  interception_linux_test.cc
  interception_test_main.cc
  interception_win_test.cc
)

set(INTERCEPTION_TEST_HEADERS)

set(INTERCEPTION_TEST_CFLAGS_COMMON
  ${COMPILER_RT_UNITTEST_CFLAGS}
  ${COMPILER_RT_GTEST_CFLAGS}
  -I${COMPILER_RT_SOURCE_DIR}/include
  -I${COMPILER_RT_SOURCE_DIR}/lib
  -I${COMPILER_RT_SOURCE_DIR}/lib/interception
  -fno-rtti
  -O2
  -Werror=sign-compare
  -Wno-non-virtual-dtor)

# -gline-tables-only must be enough for these tests, so use it if possible.
if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang")
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -gline-tables-only)
else()
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -g)
endif()
if(MSVC)
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -gcodeview)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -Wl,-largeaddressaware)
endif()
list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -g)

if(NOT MSVC)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON --driver-mode=g++)
endif()

if(ANDROID)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -pie)
endif()

set(INTERCEPTION_TEST_LINK_LIBS)
append_list_if(COMPILER_RT_HAS_LIBLOG log INTERCEPTION_TEST_LINK_LIBS)
# NDK r10 requires -latomic almost always.
append_list_if(ANDROID atomic INTERCEPTION_TEST_LINK_LIBS)

append_list_if(COMPILER_RT_HAS_LIBDL -ldl INTERCEPTION_TEST_LINK_FLAGS_COMMON)
append_list_if(COMPILER_RT_HAS_LIBRT -lrt INTERCEPTION_TEST_LINK_FLAGS_COMMON)
append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread INTERCEPTION_TEST_LINK_FLAGS_COMMON)
# x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests. Also,
# 'libm' shall be specified explicitly to build i386 tests.
if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON "-lc++ -lm")
endif()

include_directories(..)
include_directories(../..)

# Adds static library which contains interception object file
# (universal binary on Mac and arch-specific object files on Linux).
macro(add_interceptor_lib library)
  add_library(${library} STATIC ${ARGN})
  set_target_properties(${library} PROPERTIES
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    FOLDER "Compiler-RT Runtime tests")
endmacro()

function(get_interception_lib_for_arch arch lib)
  if(APPLE)
    set(tgt_name "RTInterception.test.osx")
  else()
    set(tgt_name "RTInterception.test.${arch}")
  endif()
  set(${lib} "${tgt_name}" PARENT_SCOPE)
endfunction()

# Interception unit tests testsuite.
add_custom_target(InterceptionUnitTests)
set_target_properties(InterceptionUnitTests PROPERTIES
  FOLDER "Compiler-RT Tests")

# Adds interception tests for architecture.
macro(add_interception_tests_for_arch arch)
  set(INTERCEPTION_TEST_OBJECTS)
  get_interception_lib_for_arch(${arch} INTERCEPTION_COMMON_LIB)
  generate_compiler_rt_tests(INTERCEPTION_TEST_OBJECTS
    InterceptionUnitTests "Interception-${arch}-Test" ${arch}
    RUNTIME ${INTERCEPTION_COMMON_LIB}
    SOURCES ${INTERCEPTION_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE}
    COMPILE_DEPS ${INTERCEPTION_TEST_HEADERS}
    DEPS gtest
    CFLAGS ${INTERCEPTION_TEST_CFLAGS_COMMON}
    LINK_FLAGS ${INTERCEPTION_TEST_LINK_FLAGS_COMMON})
endmacro()

if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID AND NOT APPLE)
  # We use just-built clang to build interception unittests, so we must
  # be sure that produced binaries would work.
  if(APPLE)
    add_interceptor_lib("RTInterception.test.osx"
                        $<TARGET_OBJECTS:RTInterception.osx>)
  else()
    foreach(arch ${INTERCEPTION_UNITTEST_SUPPORTED_ARCH})
      add_interceptor_lib("RTInterception.test.${arch}"
                          $<TARGET_OBJECTS:RTInterception.${arch}>)
    endforeach()
  endif()
  foreach(arch ${INTERCEPTION_UNITTEST_SUPPORTED_ARCH})
    add_interception_tests_for_arch(${arch})
  endforeach()
endif()
@


1.1.1.1
log
@Import compiler-rt r350590. LLVM sanitizers on top of unmodified files from compiler-rt-259194.
@
text
@@


1.1.1.1.6.1
log
@file CMakeLists.txt was added on branch phil-wifi on 2019-06-10 22:07:48 +0000
@
text
@d1 113
@


1.1.1.1.6.2
log
@Sync with HEAD
@
text
@a0 113
include(CompilerRTCompile)

filter_available_targets(INTERCEPTION_UNITTEST_SUPPORTED_ARCH x86_64 i386 mips64 mips64el)

set(INTERCEPTION_UNITTESTS
  interception_linux_test.cc
  interception_test_main.cc
  interception_win_test.cc
)

set(INTERCEPTION_TEST_HEADERS)

set(INTERCEPTION_TEST_CFLAGS_COMMON
  ${COMPILER_RT_UNITTEST_CFLAGS}
  ${COMPILER_RT_GTEST_CFLAGS}
  -I${COMPILER_RT_SOURCE_DIR}/include
  -I${COMPILER_RT_SOURCE_DIR}/lib
  -I${COMPILER_RT_SOURCE_DIR}/lib/interception
  -fno-rtti
  -O2
  -Werror=sign-compare
  -Wno-non-virtual-dtor)

# -gline-tables-only must be enough for these tests, so use it if possible.
if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang")
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -gline-tables-only)
else()
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -g)
endif()
if(MSVC)
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -gcodeview)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -Wl,-largeaddressaware)
endif()
list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -g)

if(NOT MSVC)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON --driver-mode=g++)
endif()

if(ANDROID)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -pie)
endif()

set(INTERCEPTION_TEST_LINK_LIBS)
append_list_if(COMPILER_RT_HAS_LIBLOG log INTERCEPTION_TEST_LINK_LIBS)
# NDK r10 requires -latomic almost always.
append_list_if(ANDROID atomic INTERCEPTION_TEST_LINK_LIBS)

append_list_if(COMPILER_RT_HAS_LIBDL -ldl INTERCEPTION_TEST_LINK_FLAGS_COMMON)
append_list_if(COMPILER_RT_HAS_LIBRT -lrt INTERCEPTION_TEST_LINK_FLAGS_COMMON)
append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread INTERCEPTION_TEST_LINK_FLAGS_COMMON)
# x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests. Also,
# 'libm' shall be specified explicitly to build i386 tests.
if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON "-lc++ -lm")
endif()

include_directories(..)
include_directories(../..)

# Adds static library which contains interception object file
# (universal binary on Mac and arch-specific object files on Linux).
macro(add_interceptor_lib library)
  add_library(${library} STATIC ${ARGN})
  set_target_properties(${library} PROPERTIES
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    FOLDER "Compiler-RT Runtime tests")
endmacro()

function(get_interception_lib_for_arch arch lib)
  if(APPLE)
    set(tgt_name "RTInterception.test.osx")
  else()
    set(tgt_name "RTInterception.test.${arch}")
  endif()
  set(${lib} "${tgt_name}" PARENT_SCOPE)
endfunction()

# Interception unit tests testsuite.
add_custom_target(InterceptionUnitTests)
set_target_properties(InterceptionUnitTests PROPERTIES
  FOLDER "Compiler-RT Tests")

# Adds interception tests for architecture.
macro(add_interception_tests_for_arch arch)
  set(INTERCEPTION_TEST_OBJECTS)
  get_interception_lib_for_arch(${arch} INTERCEPTION_COMMON_LIB)
  generate_compiler_rt_tests(INTERCEPTION_TEST_OBJECTS
    InterceptionUnitTests "Interception-${arch}-Test" ${arch}
    RUNTIME ${INTERCEPTION_COMMON_LIB}
    SOURCES ${INTERCEPTION_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE}
    COMPILE_DEPS ${INTERCEPTION_TEST_HEADERS}
    DEPS gtest
    CFLAGS ${INTERCEPTION_TEST_CFLAGS_COMMON}
    LINK_FLAGS ${INTERCEPTION_TEST_LINK_FLAGS_COMMON})
endmacro()

if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID AND NOT APPLE)
  # We use just-built clang to build interception unittests, so we must
  # be sure that produced binaries would work.
  if(APPLE)
    add_interceptor_lib("RTInterception.test.osx"
                        $<TARGET_OBJECTS:RTInterception.osx>)
  else()
    foreach(arch ${INTERCEPTION_UNITTEST_SUPPORTED_ARCH})
      add_interceptor_lib("RTInterception.test.${arch}"
                          $<TARGET_OBJECTS:RTInterception.${arch}>)
    endforeach()
  endif()
  foreach(arch ${INTERCEPTION_UNITTEST_SUPPORTED_ARCH})
    add_interception_tests_for_arch(${arch})
  endforeach()
endif()
@


1.1.1.1.2.1
log
@file CMakeLists.txt was added on branch pgoyette-compat on 2019-01-18 08:50:50 +0000
@
text
@d1 113
@


1.1.1.1.2.2
log
@Synch with HEAD
@
text
@a0 113
include(CompilerRTCompile)

filter_available_targets(INTERCEPTION_UNITTEST_SUPPORTED_ARCH x86_64 i386 mips64 mips64el)

set(INTERCEPTION_UNITTESTS
  interception_linux_test.cc
  interception_test_main.cc
  interception_win_test.cc
)

set(INTERCEPTION_TEST_HEADERS)

set(INTERCEPTION_TEST_CFLAGS_COMMON
  ${COMPILER_RT_UNITTEST_CFLAGS}
  ${COMPILER_RT_GTEST_CFLAGS}
  -I${COMPILER_RT_SOURCE_DIR}/include
  -I${COMPILER_RT_SOURCE_DIR}/lib
  -I${COMPILER_RT_SOURCE_DIR}/lib/interception
  -fno-rtti
  -O2
  -Werror=sign-compare
  -Wno-non-virtual-dtor)

# -gline-tables-only must be enough for these tests, so use it if possible.
if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang")
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -gline-tables-only)
else()
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -g)
endif()
if(MSVC)
  list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -gcodeview)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -Wl,-largeaddressaware)
endif()
list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -g)

if(NOT MSVC)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON --driver-mode=g++)
endif()

if(ANDROID)
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON -pie)
endif()

set(INTERCEPTION_TEST_LINK_LIBS)
append_list_if(COMPILER_RT_HAS_LIBLOG log INTERCEPTION_TEST_LINK_LIBS)
# NDK r10 requires -latomic almost always.
append_list_if(ANDROID atomic INTERCEPTION_TEST_LINK_LIBS)

append_list_if(COMPILER_RT_HAS_LIBDL -ldl INTERCEPTION_TEST_LINK_FLAGS_COMMON)
append_list_if(COMPILER_RT_HAS_LIBRT -lrt INTERCEPTION_TEST_LINK_FLAGS_COMMON)
append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread INTERCEPTION_TEST_LINK_FLAGS_COMMON)
# x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests. Also,
# 'libm' shall be specified explicitly to build i386 tests.
if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
  list(APPEND INTERCEPTION_TEST_LINK_FLAGS_COMMON "-lc++ -lm")
endif()

include_directories(..)
include_directories(../..)

# Adds static library which contains interception object file
# (universal binary on Mac and arch-specific object files on Linux).
macro(add_interceptor_lib library)
  add_library(${library} STATIC ${ARGN})
  set_target_properties(${library} PROPERTIES
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    FOLDER "Compiler-RT Runtime tests")
endmacro()

function(get_interception_lib_for_arch arch lib)
  if(APPLE)
    set(tgt_name "RTInterception.test.osx")
  else()
    set(tgt_name "RTInterception.test.${arch}")
  endif()
  set(${lib} "${tgt_name}" PARENT_SCOPE)
endfunction()

# Interception unit tests testsuite.
add_custom_target(InterceptionUnitTests)
set_target_properties(InterceptionUnitTests PROPERTIES
  FOLDER "Compiler-RT Tests")

# Adds interception tests for architecture.
macro(add_interception_tests_for_arch arch)
  set(INTERCEPTION_TEST_OBJECTS)
  get_interception_lib_for_arch(${arch} INTERCEPTION_COMMON_LIB)
  generate_compiler_rt_tests(INTERCEPTION_TEST_OBJECTS
    InterceptionUnitTests "Interception-${arch}-Test" ${arch}
    RUNTIME ${INTERCEPTION_COMMON_LIB}
    SOURCES ${INTERCEPTION_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE}
    COMPILE_DEPS ${INTERCEPTION_TEST_HEADERS}
    DEPS gtest
    CFLAGS ${INTERCEPTION_TEST_CFLAGS_COMMON}
    LINK_FLAGS ${INTERCEPTION_TEST_LINK_FLAGS_COMMON})
endmacro()

if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID AND NOT APPLE)
  # We use just-built clang to build interception unittests, so we must
  # be sure that produced binaries would work.
  if(APPLE)
    add_interceptor_lib("RTInterception.test.osx"
                        $<TARGET_OBJECTS:RTInterception.osx>)
  else()
    foreach(arch ${INTERCEPTION_UNITTEST_SUPPORTED_ARCH})
      add_interceptor_lib("RTInterception.test.${arch}"
                          $<TARGET_OBJECTS:RTInterception.${arch}>)
    endforeach()
  endif()
  foreach(arch ${INTERCEPTION_UNITTEST_SUPPORTED_ARCH})
    add_interception_tests_for_arch(${arch})
  endforeach()
endif()
@


