mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[tests] Standarize the checks for Darwin, Glibc and MSVCRT.
Different tests used different os checks for importing Darwin, Glibc and MSVCRT. This commit use the same pattern for importing those libraries, in order to avoid the #else branches of the incorrect patterns to be applied to the wrong platform. This was very normal for Android, which normally should follow the Linux branches, but sometimes was trying to import Darwin or not importing anything. The standarized pattern imports Darwin for macOS, iOS, tvOS and watchOS. It imports Glibc for Linux, FreeBSD, PS4, Android, Cygwin and Haiku; and imports MSVCRT for Windows. If a new platform is introduced, the else branch will report an error, so the new platform can be added to one of the branches (or maybe add a new specific branch). In some cases the standard pattern was modified because some test required it (importing extra modules, or extra type aliases), and in some other cases some branches were removed because the test will not have used them (but it is not exhaustive, so there might be some unnecessary branches). This should, at least, fix three tests for Android (the three dynamic_replacement*.swift ones).
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
// RUN: %target-typecheck-verify-swift
|
||||
// UNSUPPORTED: OS=windows-msvc
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
typealias JumpBuffer = Int32
|
||||
#elseif os(Android) || os(Cygwin) || os(FreeBSD) || os(Linux)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
typealias JumpBuffer = jmp_buf
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
func test_unavailable_returns_twice_function() {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// RUN: not %target-swift-frontend -typecheck %s 2>&1 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-%target-runtime %s
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Android) || os(Cygwin) || os(FreeBSD) || os(Linux)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
func test() {
|
||||
|
||||
@@ -8,10 +8,14 @@
|
||||
// XFAIL: OS=watchos
|
||||
// CHECK: Crash!
|
||||
|
||||
#if os(macOS) || os(iOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
@_cdecl("LLVMFuzzerTestOneInput") public func fuzzOneInput(Data: UnsafePointer<CChar>, Size: CLong) -> CInt {
|
||||
|
||||
@@ -8,10 +8,14 @@
|
||||
// XFAIL: OS=tvos
|
||||
// XFAIL: OS=watchos
|
||||
|
||||
#if os(macOS) || os(iOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
@_cdecl("LLVMFuzzerTestOneInput") public func fuzzOneInput(Data: UnsafePointer<CChar>, Size: CLong) -> CInt {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// RUN: %target-swift-frontend -emit-ir -O %s | %FileCheck %s -check-prefix CHECK -check-prefix CHECK-%target-os
|
||||
|
||||
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Android) || os(Cygwin) || os(FreeBSD) || os(Linux)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
// Make sure we use an intrinsic for functions such as exp.
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
// RUN: %target-swift-frontend -emit-ir -sanitize=address -sanitize-coverage=edge,8bit-counters %s | %FileCheck %s -check-prefix=SANCOV -check-prefix=SANCOV_8BIT_COUNTERS
|
||||
// RUN: %target-swift-frontend -emit-ir -sanitize=fuzzer %s | %FileCheck %s -check-prefix=SANCOV -check-prefix=SANCOV_TRACE_CMP
|
||||
|
||||
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Android) || os(Cygwin) || os(FreeBSD) || os(Linux)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
// FIXME: We should have a reliable way of triggering an indirect call in the
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
// TODO: rdar://problem/33388782
|
||||
// REQUIRES: CPU=x86_64
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
let sourcePath = CommandLine.arguments[1]
|
||||
|
||||
@@ -53,13 +53,15 @@ import Module1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
#if os(Linux)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import WinSDK
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
var DynamicallyReplaceable = TestSuite("DynamicallyReplaceable")
|
||||
|
||||
@@ -22,13 +22,15 @@ import A
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
#if os(Linux)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import WinSDK
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
var DynamicallyReplaceable = TestSuite("DynamicallyReplaceableChaining")
|
||||
|
||||
@@ -9,13 +9,15 @@ import Module1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
#if os(Linux)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import WinSDK
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
var DynamicallyReplaceable = TestSuite("DynamicallyReplaceable")
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
// REQUIRES: CPU=x86_64
|
||||
|
||||
import StdlibUnittest
|
||||
#if os(Windows)
|
||||
import MSVCRT
|
||||
#elseif os(Linux) || os(Android)
|
||||
import Glibc
|
||||
#elseif os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
extension FixedWidthInteger {
|
||||
|
||||
@@ -10,10 +10,14 @@
|
||||
// don't support TSan.
|
||||
// UNSUPPORTED: remote_run
|
||||
|
||||
#if os(macOS) || os(iOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
// Make sure we can handle swifterror and don't bail during the LLVM
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// RUN: %target-typecheck-verify-swift
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
_ = FLT_RADIX // expected-warning {{is deprecated}}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// RUN: %target-typecheck-verify-swift
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
_ = M_PI // expected-warning {{is deprecated}}
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
// UNSUPPORTED: OS=windows-msvc
|
||||
|
||||
import StdlibUnittest
|
||||
#if os(Linux) || os(Android)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
chdir(CommandLine.arguments[1])
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
// REQUIRES: executable_test
|
||||
|
||||
import StdlibUnittest
|
||||
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
import Glibc
|
||||
#elseif os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
// It takes about an hour to run the Float formatter over all 2 billion
|
||||
|
||||
@@ -10,13 +10,15 @@ import Swift
|
||||
import StdlibUnittest
|
||||
import SwiftShims
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
import WinSDK
|
||||
import MSVCRT
|
||||
import WinSDK
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
@_silgen_name("swift_demangle")
|
||||
|
||||
@@ -4,18 +4,20 @@
|
||||
import Swift
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
import Darwin
|
||||
import CoreGraphics
|
||||
#elseif os(Linux) || os(FreeBSD) || os(Android) || os(Haiku) || os(PS4)
|
||||
import Glibc
|
||||
typealias CGFloat = Double
|
||||
import Darwin
|
||||
import CoreGraphics
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
typealias CGFloat = Double
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#if arch(x86_64) || arch(arm64)
|
||||
typealias CGFloat = Double
|
||||
import MSVCRT
|
||||
#if arch(x86_64) || arch(arm64)
|
||||
typealias CGFloat = Double
|
||||
#else
|
||||
typealias CGFloat = Float
|
||||
#endif
|
||||
#else
|
||||
typealias CGFloat = Float
|
||||
#endif
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
func my_printf(_ format: String, _ arguments: CVarArg...) {
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
// UNSUPPORTED: OS=windows-msvc
|
||||
|
||||
import StdlibUnittest
|
||||
#if os(Linux) || os(Android)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
var MMapTests = TestSuite("MMaptests")
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
// RUN: %line-directive %t/tgmath.swift -- %target-run %t/a.out
|
||||
// REQUIRES: executable_test
|
||||
|
||||
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin.C.tgmath
|
||||
#elseif os(Linux) || os(android) || os(FreeBSD) || os(Haiku) || os(PS4)
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
#if (arch(i386) || arch(x86_64)) && !os(Windows)
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
// RUN: %target-run %t/a.out
|
||||
// REQUIRES: executable_test
|
||||
|
||||
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
import Glibc
|
||||
#elseif os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
@@ -9,10 +9,14 @@
|
||||
import SwiftPrivate
|
||||
import StdlibUnittest
|
||||
|
||||
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
final class HeapBool {
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
// UNSUPPORTED: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
_setTestSuiteFailedCallback() { print("abort()") }
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
// REQUIRES: executable_test
|
||||
|
||||
import StdlibUnittest
|
||||
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
_setTestSuiteFailedCallback() { print("abort()") }
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
// REQUIRES: executable_test
|
||||
|
||||
import StdlibUnittest
|
||||
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
import Darwin
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
@@ -5,10 +5,14 @@
|
||||
|
||||
import SwiftPrivate
|
||||
import StdlibUnittest
|
||||
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
func simple_getline() -> [UInt8]? {
|
||||
|
||||
@@ -11,10 +11,12 @@
|
||||
import Swift
|
||||
import StdlibUnittest
|
||||
|
||||
#if os(Linux) || os(Android)
|
||||
import Glibc
|
||||
#elseif os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
var POSIXErrorCodeTestSuite = TestSuite("POSIXErrorCode")
|
||||
|
||||
@@ -1201,8 +1201,8 @@ StringTests.test("Conversions") {
|
||||
}
|
||||
|
||||
|
||||
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
|
||||
import Glibc
|
||||
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#endif
|
||||
|
||||
StringTests.test("lowercased()") {
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
import SwiftPrivateThreadExtras
|
||||
#if os(OSX) || os(iOS)
|
||||
import Darwin
|
||||
#elseif os(Linux)
|
||||
import Glibc
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
import Darwin
|
||||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
|
||||
import Glibc
|
||||
#elseif os(Windows)
|
||||
import MSVCRT
|
||||
#else
|
||||
#error("Unsupported platform")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user