Files
swift-mirror/test/embedded/wasm/wasilibc_functions.swift
Max Desiatov 6582ad92bc Embedded Wasm: enable import WASILibc
WASILibc wasn't built for the embedded stdlib in `stdlib/public/Platform/CMakeLists.txt`. New `copy_wasilibc_modulemap_embedded_resource` and `embedded-stdlib-platform-${triple}` targets are added, the latter for `wasm32-unknown-wasip1` only for now. Also added a `wasilibc_functions.swift` test to verify the result.

Resolves https://github.com/swiftlang/swift/issues/83513

rdar://157467412
2025-08-18 18:41:10 +01:00

19 lines
419 B
Swift

// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo) | %FileCheck %s
// REQUIRES: executable_test
// REQUIRES: OS=wasip1
// REQUIRES: swift_feature_Embedded
import WASILibc
@main struct Main {
static func main() {
puts("Hello")
// CHECK: Hello
let div_result = div(5,2)
print(div_result.quot)
// CHECK: 2
print(div_result.rem)
// CHECK: 1
}
}