File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,29 @@ foreach(SDK ${SWIFT_SDKS})
195195
196196 set (test_dependencies)
197197 get_test_dependencies("${SDK} " test_dependencies)
198+
199+ # NOTE create a stub BlocksRuntime library that can be used for the
200+ # reflection tests
201+ file (WRITE ${test_bin_dir} /BlocksRuntime.c
202+ "void
203+ #if defined(_WIN32)
204+ __declspec(dllexport)
205+ #endif
206+ _Block_release(void) { }\n " )
207+ add_library (BlocksRuntimeStub-${SDK} -${ARCH} SHARED
208+ ${test_bin_dir} /BlocksRuntime.c)
209+ if (CMAKE_C_COMPILER_ID STREQUAL Clang AND
210+ NOT CMAKE_C_COMPILER_SIMULATE_ID STREQUAL MSVC )
211+ target_compile_options (BlocksRuntimeStub-${SDK} -${ARCH} PRIVATE
212+ -target ;${SWIFT_SDK_${SDK} _ARCH_${ARCH} _TRIPLE})
213+ endif ()
214+ set_target_properties (BlocksRuntimeStub-${SDK} -${ARCH} PROPERTIES
215+ ARCHIVE_OUTPUT_DIRECTORY ${test_bin_dir}
216+ LIBRARY_OUTPUT_DIRECTORY ${test_bin_dir}
217+ RUNTIME_OUTPUT_DIRECTORY ${test_bin_dir}
218+ OUTPUT_NAME BlocksRuntime)
219+ list (APPEND test_dependencies BlocksRuntimeStub-${SDK} -${ARCH} )
220+
198221 list (APPEND test_dependencies
199222 "swift-test-stdlib-${SWIFT_SDK_${SDK} _LIB_SUBDIR}" )
200223
Original file line number Diff line number Diff line change 11
22// REQUIRES: no_asan
33// RUN: %empty-directory(%t)
4- // RUN: %target-build-swift %s -emit-module -emit-library -module-name capture_descriptors -o %t/capture_descriptors%{target-shared-library-suffix}
4+ // RUN: %target-build-swift %s -emit-module -emit-library -module-name capture_descriptors -o %t/capture_descriptors%{target-shared-library-suffix} -L%t/../../.. -lBlocksRuntime
55// RUN: %target-swift-reflection-dump -binary-filename %t/capture_descriptors%{target-shared-library-suffix} | %FileCheck %s
66
77sil_stage canonical
You can’t perform that action at this time.
0 commit comments