diff --git a/stdlib/private/StdlibUnittest/StdlibUnittest.swift b/stdlib/private/StdlibUnittest/StdlibUnittest.swift index 981d965b93dc6..0c8bfdf905a0e 100644 --- a/stdlib/private/StdlibUnittest/StdlibUnittest.swift +++ b/stdlib/private/StdlibUnittest/StdlibUnittest.swift @@ -811,8 +811,10 @@ var _testSuiteNameToIndex: [String : Int] = [:] let _stdlibUnittestStreamPrefix = "__STDLIB_UNITTEST__" let _crashedPrefix = "CRASHED:" +#if !os(WASI) @_silgen_name("installTrapInterceptor") func _installTrapInterceptor() +#endif #if _runtime(_ObjC) @objc protocol _StdlibUnittestNSException { @@ -823,7 +825,9 @@ func _installTrapInterceptor() // Avoid serializing references to objc_setUncaughtExceptionHandler in SIL. @inline(never) func _childProcess() { +#if !os(WASI) _installTrapInterceptor() +#endif #if _runtime(_ObjC) objc_setUncaughtExceptionHandler {