Skip to content

Commit 1e9135f

Browse files
authored
Merge pull request #69718 from eeckstein/embedded-stdlib
Two small fixes for the embedded stdlib
2 parents 2f665ba + c8db459 commit 1e9135f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
415415
GYB_SOURCES ${SWIFTLIB_EMBEDDED_GYB_SOURCES}
416416
SWIFT_COMPILE_FLAGS
417417
${swift_stdlib_compile_flags} -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
418+
-Xfrontend -enable-ossa-modules
418419
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
419420
SDK "embedded"
420421
ARCHITECTURE "${arch}"

stdlib/public/core/EmbeddedRuntime.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,8 @@ public func swift_once(predicate: UnsafeMutablePointer<Int>, fn: (@convention(c)
270270
public func swift_deletedMethodError() -> Never {
271271
Builtin.int_trap()
272272
}
273+
274+
@_silgen_name("swift_willThrow")
275+
public func swift_willThrow() throws {
276+
}
277+

test/embedded/throw-trap-stdlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ public func test() {
1010
}
1111
}
1212

13-
// CHECK-NOT: swift_willThrow
13+
// CHECK: swift_willThrow

0 commit comments

Comments
 (0)