mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
26 lines
557 B
Swift
26 lines
557 B
Swift
// RUN: %target-run-simple-swift %t
|
|
// REQUIRES: executable_test
|
|
// UNSUPPORTED: OS=windows-msvc
|
|
// UNSUPPORTED: OS=wasip1
|
|
|
|
import StdlibUnittest
|
|
#if canImport(Darwin)
|
|
import Darwin
|
|
#elseif canImport(Glibc)
|
|
import Glibc
|
|
#elseif canImport(Android)
|
|
import Android
|
|
// MAP_FAILED is not available on android.
|
|
let MAP_FAILED = UnsafeMutableRawPointer(bitPattern: -1)
|
|
#else
|
|
#error("Unsupported platform")
|
|
#endif
|
|
|
|
var MMapTests = TestSuite("MMaptests")
|
|
|
|
MMapTests.test("MAP_FAILED") {
|
|
expectEqual(mmap(nil, 0, 0, 0, 0, 0), MAP_FAILED)
|
|
}
|
|
|
|
runAllTests()
|