Files
swift-mirror/test/stdlib/mmap.swift
Maxim Moiseev 69b3cc0946 [overlay] Declaring MAP_FAILED (#4971)
Clang importer is unable to handle `((void *)-1)`, therefore manually
declaring the said constant in both Darwin and Glibc modules.

rdar://problem/26689135
2016-09-23 14:48:48 -07:00

18 lines
287 B
Swift

// RUN: %target-run-simple-swift %t
// REQUIRES: executable_test
import StdlibUnittest
#if os(Linux)
import Glibc
#else
import Darwin
#endif
var MMapTests = TestSuite("MMaptests")
MMapTests.test("MAP_FAILED") {
expectEqual(mmap(nil, 0, 0, 0, 0, 0), MAP_FAILED)
}
runAllTests()