File tree Expand file tree Collapse file tree 5 files changed +94
-0
lines changed Expand file tree Collapse file tree 5 files changed +94
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
92
92
if (COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE )
93
93
compiler_rt_test_runtime (profile )
94
94
endif ()
95
+ if (COMPILER_RT_BUILD_CTX_PROFILE )
96
+ compiler_rt_test_runtime (ctx_profile )
97
+ endif ()
95
98
if (COMPILER_RT_BUILD_MEMPROF )
96
99
compiler_rt_test_runtime (memprof )
97
100
endif ()
Original file line number Diff line number Diff line change
1
+ set (CTX_PROFILE_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
2
+
3
+ set (CTX_PROFILE_TESTSUITES )
4
+
5
+ # Add unit tests.
6
+ if (COMPILER_RT_INCLUDE_TESTS )
7
+ foreach (arch ${CTX_PROFILE_SUPPORTED_ARCH} )
8
+ string (TOUPPER ${arch} ARCH_UPPER_CASE )
9
+ set (CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME} Config )
10
+ configure_lit_site_cfg (
11
+ ${CMAKE_CURRENT_SOURCE_DIR} /Unit/lit.site.cfg.py.in
12
+ ${CMAKE_CURRENT_BINARY_DIR} /Unit/${CONFIG_NAME}/lit.site.cfg.py )
13
+ list (APPEND CTX_PROFILE_TEST_DEPS CtxProfileUnitTests )
14
+ list (APPEND CTX_PROFILE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR} /Unit/${CONFIG_NAME} )
15
+ endforeach ()
16
+ endif ()
17
+
18
+ add_lit_testsuite (check-ctx_profile "Running the Contextual Profiler tests"
19
+ ${CTX_PROFILE_TESTSUITES}
20
+ DEPENDS ${CTX_PROFILE_TEST_DEPS} )
21
+ set_target_properties (check-ctx_profile PROPERTIES FOLDER "Compiler-RT Misc" )
Original file line number Diff line number Diff line change
1
+ @LIT_SITE_CFG_IN_HEADER@
2
+
3
+ import os
4
+ import platform
5
+ import re
6
+ import shlex
7
+
8
+ # Load common config for all compiler-rt unit tests.
9
+ lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
10
+
11
+ # Setup config name.
12
+ config.name = 'CtxProfile-Unit'
13
+ config.target_arch = "@arch@"
14
+ assert config.target_arch == 'x86_64'
15
+
16
+ config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
17
+ "lib", "ctx_profile", "tests")
18
+
19
+ config.test_source_root = config.test_exec_root
20
+
21
+ # When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on, the initial value of
22
+ # config.compiler_rt_libdir (COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR) has the
23
+ # host triple as the trailing path component. The value is incorrect for i386
24
+ # tests on x86_64 hosts and vice versa. But, since only x86_64 is enabled as
25
+ # target, and we don't support different environments for building and,
26
+ # respectivelly, running tests, we shouldn't see this case.
27
+ assert not config.enable_per_target_runtime_dir or config.target_arch == config.host_arch
Original file line number Diff line number Diff line change @@ -43,6 +43,19 @@ foreach(arch ${MEMPROF_TEST_ARCH})
43
43
${CMAKE_CURRENT_BINARY_DIR} /${CONFIG_NAME} )
44
44
endforeach ()
45
45
46
+ # Add unit tests.
47
+ if (COMPILER_RT_INCLUDE_TESTS )
48
+ foreach (arch ${MEMPROF_TEST_ARCH} )
49
+ string (TOUPPER ${arch} ARCH_UPPER_CASE )
50
+ set (CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME} Config )
51
+ configure_lit_site_cfg (
52
+ ${CMAKE_CURRENT_SOURCE_DIR} /Unit/lit.site.cfg.py.in
53
+ ${CMAKE_CURRENT_BINARY_DIR} /Unit/${CONFIG_NAME}/lit.site.cfg.py )
54
+ list (APPEND MEMPROF_TEST_DEPS MemProfUnitTests )
55
+ list (APPEND MEMPROF_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR} /Unit/${CONFIG_NAME} )
56
+ endforeach ()
57
+ endif ()
58
+
46
59
add_lit_testsuite (check-memprof "Running the MemProfiler tests"
47
60
${MEMPROF_TESTSUITES}
48
61
DEPENDS ${MEMPROF_TEST_DEPS} )
Original file line number Diff line number Diff line change
1
+ @LIT_SITE_CFG_IN_HEADER@
2
+
3
+ import os
4
+ import platform
5
+ import re
6
+ import shlex
7
+
8
+ # Load common config for all compiler-rt unit tests.
9
+ lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
10
+
11
+ # Setup config name.
12
+ config.name = 'MemProfiler-Unit'
13
+ config.target_arch = "@arch@"
14
+ assert config.target_arch == 'x86_64'
15
+
16
+ config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
17
+ "lib", "memprof", "tests")
18
+
19
+ config.test_source_root = config.test_exec_root
20
+
21
+ # When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on, the initial value of
22
+ # config.compiler_rt_libdir (COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR) has the
23
+ # host triple as the trailing path component. The value is incorrect for i386
24
+ # tests on x86_64 hosts and vice versa. But, since only x86_64 is enabled as
25
+ # target, and we don't support different environments for building and,
26
+ # respectivelly, running tests, we shouldn't see this case.
27
+ assert not config.enable_per_target_runtime_dir or config.target_arch == config.host_arch
28
+
29
+ if not config.parallelism_group:
30
+ config.parallelism_group = 'shadow-memory'
You can’t perform that action at this time.
0 commit comments