Index: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/CMakeLists.txt =================================================================== --- projects/clang400-import/contrib/compiler-rt/lib/xray/tests/CMakeLists.txt (revision 311697) +++ projects/clang400-import/contrib/compiler-rt/lib/xray/tests/CMakeLists.txt (nonexistent) @@ -1,59 +0,0 @@ -include_directories(..) - -add_custom_target(XRayUnitTests) -set_target_properties(XRayUnitTests PROPERTIES FOLDER "XRay unittests") - -set(XRAY_UNITTEST_CFLAGS - ${XRAY_CFLAGS} - ${COMPILER_RT_UNITTEST_CFLAGS} - ${COMPILER_RT_GTEST_CFLAGS} - -I${COMPILER_RT_SOURCE_DIR}/include - -I${COMPILER_RT_SOURCE_DIR}/lib/xray) - -macro(xray_compile obj_list source arch) - get_filename_component(basename ${source} NAME) - set(output_obj "${basename}.${arch}.o") - get_target_flags_for_arch(${arch} TARGET_CFLAGS) - if(NOT COMPILER_RT_STANDALONE_BUILD) - list(APPEND COMPILE_DEPS gtest_main xray-fdr) - endif() - clang_compile(${output_obj} ${source} - CFLAGS ${XRAY_UNITTEST_CFLAGS} ${TARGET_CFLAGS} - DEPS ${COMPILE_DEPS}) - list(APPEND ${obj_list} ${output_obj}) -endmacro() - -macro(add_xray_unittest testname) - set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH}) - if (APPLE) - darwin_filter_host_archs(XRAY_SUPPORTED_ARCH) - endif() - if(UNIX) - foreach(arch ${XRAY_TEST_ARCH}) - cmake_parse_arguments(TEST "" "" "SOURCES;HEADERS" ${ARGN}) - set(TEST_OBJECTS) - foreach(SOURCE ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}) - xray_compile(TEST_OBJECTS ${SOURCE} ${arch} ${TEST_HEADERS}) - endforeach() - get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS) - set(TEST_DEPS ${TEST_OBJECTS}) - if(NOT COMPILER_RT_STANDALONE_BUILD) - list(APPEND TEST_DEPS gtest_main xray-fdr) - endif() - if(NOT APPLE) - add_compiler_rt_test(XRayUnitTests ${testname} - OBJECTS ${TEST_OBJECTS} - DEPS ${TEST_DEPS} - LINK_FLAGS ${TARGET_LINK_FLAGS} - -lstdc++ -lm ${CMAKE_THREAD_LIBS_INIT} - -lpthread - -L${COMPILER_RT_LIBRARY_OUTPUT_DIR} -lclang_rt.xray-fdr-${arch}) - endif() - # FIXME: Figure out how to run even just the unit tests on APPLE. - endforeach() - endif() -endmacro() - -if(COMPILER_RT_CAN_EXECUTE_TESTS) - add_subdirectory(unit) -endif() Property changes on: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/CMakeLists.txt ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/CMakeLists.txt =================================================================== --- projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/CMakeLists.txt (revision 311697) +++ projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/CMakeLists.txt (nonexistent) @@ -1,2 +0,0 @@ -add_xray_unittest(XRayBufferQueueTest SOURCES - buffer_queue_test.cc xray_unit_test_main.cc) Property changes on: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/CMakeLists.txt ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/xray_unit_test_main.cc =================================================================== --- projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/xray_unit_test_main.cc (revision 311697) +++ projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/xray_unit_test_main.cc (nonexistent) @@ -1,18 +0,0 @@ -//===-- xray_unit_test_main.cc --------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file is a part of XRay, a function call tracing system. -// -//===----------------------------------------------------------------------===// -#include "gtest/gtest.h" - -int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} Property changes on: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/xray_unit_test_main.cc ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/buffer_queue_test.cc =================================================================== --- projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/buffer_queue_test.cc (revision 311697) +++ projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/buffer_queue_test.cc (nonexistent) @@ -1,81 +0,0 @@ -//===-- buffer_queue_test.cc ----------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file is a part of XRay, a function call tracing system. -// -//===----------------------------------------------------------------------===// -#include "xray_buffer_queue.h" -#include "gtest/gtest.h" - -#include -#include -#include - -namespace __xray { - -static constexpr size_t kSize = 4096; - -TEST(BufferQueueTest, API) { BufferQueue Buffers(kSize, 1); } - -TEST(BufferQueueTest, GetAndRelease) { - BufferQueue Buffers(kSize, 1); - BufferQueue::Buffer Buf; - ASSERT_EQ(Buffers.getBuffer(Buf), std::error_code()); - ASSERT_NE(nullptr, Buf.Buffer); - ASSERT_EQ(Buffers.releaseBuffer(Buf), std::error_code()); - ASSERT_EQ(nullptr, Buf.Buffer); -} - -TEST(BufferQueueTest, GetUntilFailed) { - BufferQueue Buffers(kSize, 1); - BufferQueue::Buffer Buf0; - EXPECT_EQ(Buffers.getBuffer(Buf0), std::error_code()); - BufferQueue::Buffer Buf1; - EXPECT_EQ(std::errc::not_enough_memory, Buffers.getBuffer(Buf1)); - EXPECT_EQ(Buffers.releaseBuffer(Buf0), std::error_code()); -} - -TEST(BufferQueueTest, ReleaseUnknown) { - BufferQueue Buffers(kSize, 1); - BufferQueue::Buffer Buf; - Buf.Buffer = reinterpret_cast(0xdeadbeef); - Buf.Size = kSize; - EXPECT_EQ(std::errc::argument_out_of_domain, Buffers.releaseBuffer(Buf)); -} - -TEST(BufferQueueTest, ErrorsWhenFinalising) { - BufferQueue Buffers(kSize, 2); - BufferQueue::Buffer Buf; - ASSERT_EQ(Buffers.getBuffer(Buf), std::error_code()); - ASSERT_NE(nullptr, Buf.Buffer); - ASSERT_EQ(Buffers.finalize(), std::error_code()); - BufferQueue::Buffer OtherBuf; - ASSERT_EQ(std::errc::state_not_recoverable, Buffers.getBuffer(OtherBuf)); - ASSERT_EQ(std::errc::state_not_recoverable, Buffers.finalize()); - ASSERT_EQ(Buffers.releaseBuffer(Buf), std::error_code()); -} - -TEST(BufferQueueTest, MultiThreaded) { - BufferQueue Buffers(kSize, 100); - auto F = [&] { - BufferQueue::Buffer B; - while (!Buffers.getBuffer(B)) { - Buffers.releaseBuffer(B); - } - }; - auto T0 = std::async(std::launch::async, F); - auto T1 = std::async(std::launch::async, F); - auto T2 = std::async(std::launch::async, [&] { - while (!Buffers.finalize()) - ; - }); - F(); -} - -} // namespace __xray Property changes on: projects/clang400-import/contrib/compiler-rt/lib/xray/tests/unit/buffer_queue_test.cc ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: projects/clang400-import/contrib/compiler-rt/lib/xray/CMakeLists.txt =================================================================== --- projects/clang400-import/contrib/compiler-rt/lib/xray/CMakeLists.txt (revision 311697) +++ projects/clang400-import/contrib/compiler-rt/lib/xray/CMakeLists.txt (nonexistent) @@ -1,79 +0,0 @@ -# Build for the XRay runtime support library. - -# Core XRay runtime library implementation files. -set(XRAY_SOURCES - xray_init.cc - xray_interface.cc - xray_flags.cc - xray_inmemory_log.cc) - -# XRay flight data recorder (FDR) implementation files. -set(XRAY_FDR_SOURCES - xray_buffer_queue.cc) - -set(x86_64_SOURCES - xray_x86_64.cc - xray_trampoline_x86_64.S - ${XRAY_SOURCES}) - -set(arm_SOURCES - xray_arm.cc - xray_trampoline_arm.S - ${XRAY_SOURCES}) - -set(armhf_SOURCES ${arm_SOURCES}) - -set(aarch64_SOURCES - xray_AArch64.cc - xray_trampoline_AArch64.S - ${XRAY_SOURCES}) - -include_directories(..) -include_directories(../../include) - -set(XRAY_CFLAGS ${SANITIZER_COMMON_CFLAGS}) -set(XRAY_COMMON_DEFINITIONS XRAY_HAS_EXCEPTIONS=1) -append_list_if( - COMPILER_RT_HAS_XRAY_COMPILER_FLAG XRAY_SUPPORTED=1 XRAY_COMMON_DEFINITIONS) - -add_compiler_rt_object_libraries(RTXray - ARCHS ${XRAY_SUPPORTED_ARCH} - SOURCES ${XRAY_SOURCES} CFLAGS ${XRAY_CFLAGS} - DEFS ${XRAY_COMMON_DEFINITIONS}) - -add_compiler_rt_object_libraries(RTXrayFDR - ARCHS ${XRAY_SUPPORTED_ARCH} - SOURCES ${XRAY_FDR_SOURCES} CFLAGS ${XRAY_CFLAGS} - DEFS ${XRAY_COMMON_DEFINITIONS}) - -add_compiler_rt_component(xray) -add_compiler_rt_component(xray-fdr) - -set(XRAY_COMMON_RUNTIME_OBJECT_LIBS - RTSanitizerCommon - RTSanitizerCommonLibc) - -foreach(arch ${XRAY_SUPPORTED_ARCH}) - if(CAN_TARGET_${arch}) - add_compiler_rt_runtime(clang_rt.xray - STATIC - ARCHS ${arch} - SOURCES ${${arch}_SOURCES} - CFLAGS ${XRAY_CFLAGS} - DEFS ${XRAY_COMMON_DEFINITIONS} - OBJECT_LIBS ${XRAY_COMMON_RUNTIME_OBJECT_LIBS} - PARENT_TARGET xray) - add_compiler_rt_runtime(clang_rt.xray-fdr - STATIC - ARCHS ${arch} - SOURCES ${XRAY_FDR_SOURCES} - CFLAGS ${XRAY_CFLAGS} - DEFS ${XRAY_COMMON_DEFINITIONS} - OBJECT_LIBS ${XRAY_COMMON_RUNTIME_OBJECT_LIBS} - PARENT_TARGET xray-fdr) - endif() -endforeach() - -if(COMPILER_RT_INCLUDE_TESTS) - add_subdirectory(tests) -endif() Property changes on: projects/clang400-import/contrib/compiler-rt/lib/xray/CMakeLists.txt ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property