Files
swift-mirror/test/stdlib/WASILibcAPI.swift
Yuta Saito be08ebb12a [wasm] Annotate errno as SwiftPrivate by apinotes
This patch adds an apinotes file for SwiftWASILibc clang module to mark
`errno` macro hidden from Swift code. This resolves ambiguity between
the C macro definition and the Swift wrapper in WASILibc overlay module.

This change installs the apinotes file to the resource directories for
both lib/swift/apinotes and lib/swift_static/apinotes.
2024-08-16 10:57:24 +00:00

20 lines
389 B
Swift

// RUN: %target-swift-frontend -typecheck -swift-version 6 %s -verify
// REQUIRES: executable_test
// REQUIRES: OS=wasi
import WASILibc
// errno is a global thread-local variable, so it should be accessible
// from any context.
enum TestErrno {
static func testSyncContext() {
_ = errno
errno = 0
}
static func testAsyncContext() async {
_ = errno
errno = 0
}
}