From c8db45907f9b9343f8440797513e966cbd44b8eb Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Tue, 31 Oct 2023 20:00:39 +0100 Subject: [PATCH] EmbeddedRuntime: add swift_willThrow --- stdlib/public/core/EmbeddedRuntime.swift | 5 +++++ test/embedded/throw-trap-stdlib.swift | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/public/core/EmbeddedRuntime.swift b/stdlib/public/core/EmbeddedRuntime.swift index 206c7bfd44e..726ea5c027c 100644 --- a/stdlib/public/core/EmbeddedRuntime.swift +++ b/stdlib/public/core/EmbeddedRuntime.swift @@ -270,3 +270,8 @@ public func swift_once(predicate: UnsafeMutablePointer, fn: (@convention(c) public func swift_deletedMethodError() -> Never { Builtin.int_trap() } + +@_silgen_name("swift_willThrow") +public func swift_willThrow() throws { +} + diff --git a/test/embedded/throw-trap-stdlib.swift b/test/embedded/throw-trap-stdlib.swift index ef151cd17ad..eb6f576d4ef 100644 --- a/test/embedded/throw-trap-stdlib.swift +++ b/test/embedded/throw-trap-stdlib.swift @@ -10,4 +10,4 @@ public func test() { } } -// CHECK-NOT: swift_willThrow +// CHECK: swift_willThrow