Skip to content

Commit 236ba1b

Browse files
committed
---
yaml --- r: 348702 b: refs/heads/master c: 339e84d h: refs/heads/master
1 parent 0991bcf commit 236ba1b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2795f40f33231faef9297b93c444695aa313f647
2+
refs/heads/master: 339e84dae3a8b14fd84f9369f82a17c17f92a1d6
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/test/stdlib/Runtime.swift.gyb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,14 @@ AvailabilityVersionsTestSuite.test("_stdlib_isOSVersionAtLeast") {
800800
expectTrue(isAtLeastOS(0, 1066, 0))
801801
expectTrue(isAtLeastOS(0, 0, 1066))
802802

803-
// 9999 is a special version that's always available
804-
expectTrue(isAtLeastOS(9999, 0, 0))
803+
// When using a runtime that's not part of the OS, 9999 is a special version
804+
// that's always available. The _swift_classIsSwiftMask symbol is absent in OS
805+
// libraries, so detect based on that.
806+
let RTLD_DEFAULT = UnsafeMutableRawPointer(bitPattern: -2)
807+
let _swift_classIsSwiftMaskPtr = dlsym(RTLD_DEFAULT, "_swift_classIsSwiftMask")
808+
if _swift_classIsSwiftMaskPtr != nil {
809+
expectTrue(isAtLeastOS(9999, 0, 0))
810+
}
805811
#endif
806812
}
807813

0 commit comments

Comments
 (0)