Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions tslang/test/tester/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2230,23 +2230,22 @@ if (WIN32)
endif()

# An async program linked by tslang itself (test-runner links with gc.lib whatever the model) under
# every model but gc - see async-without-collector.cmake.
if (WIN32)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(async_without_collector_opt "--opt;--opt_level=3")
else()
set(async_without_collector_opt "--di;--opt_level=0")
endif()
add_test(NAME test-compile-async-without-collector
COMMAND ${CMAKE_COMMAND}
"-DTSLANG=$<TARGET_FILE:tslang>"
"-DTESTS_DIR=${PROJECT_SOURCE_DIR}/test/tester/tests"
"-DWORK_DIR=${CMAKE_CURRENT_BINARY_DIR}/async-without-collector"
"-DLLVM_LIB=${LLVM_LIBRARY_DIR}"
"-DTSLANG_LIB=${CMAKE_BINARY_DIR}/lib"
"-DOPT=${async_without_collector_opt}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/async-without-collector.cmake")
# every model but gc - see async-without-collector.cmake. Every platform: the static async runtime
# is an archive on Linux too, and before the split it failed there the same way.
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(async_without_collector_opt "--opt;--opt_level=3")
else()
set(async_without_collector_opt "--di;--opt_level=0")
endif()
add_test(NAME test-compile-async-without-collector
COMMAND ${CMAKE_COMMAND}
"-DTSLANG=$<TARGET_FILE:tslang>"
"-DTESTS_DIR=${PROJECT_SOURCE_DIR}/test/tester/tests"
"-DWORK_DIR=${CMAKE_CURRENT_BINARY_DIR}/async-without-collector"
"-DLLVM_LIB=${LLVM_LIBRARY_DIR}"
"-DTSLANG_LIB=${CMAKE_BINARY_DIR}/lib"
"-DOPT=${async_without_collector_opt}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/async-without-collector.cmake")

# tslang choosing the collector's linkage itself under -mm=gc - see shared-collector-auto.cmake.
if (WIN32)
Expand Down
8 changes: 5 additions & 3 deletions tslang/test/tester/async-without-collector.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# code used to sit in the scheduler's own object file, so every program that awaits anything pulled
# in references to GC_allow_register_threads, GC_register_my_thread, GC_unregister_my_thread and
# GC_get_stack_base - and under rc, none and own the compiler links no gc.lib, so none of them
# linked: "unresolved external symbol GC_allow_register_threads". It is an object file of its own
# linked: "unresolved external symbol GC_allow_register_threads" on Windows, "undefined reference to
# `GC_register_my_thread'" on Linux. It is an object file of its own
# now, pulled in only by the call to GC_enable_threads that the GC pass puts in a gc program.
#
# This drives `tslang --emit=exe` itself, which `test-runner` does not: it links with lld directly,
# and always with gc.lib, so the rc and none corpus runs of the same file never saw it.
# This drives `tslang --emit=exe` itself, which `test-runner` does not: it links the program itself,
# and always with the collector (gc.lib, -lgc), so the rc and none corpus runs of the same file never
# saw it.

cmake_minimum_required(VERSION 3.17.3)

Expand Down
Loading