File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -800,8 +800,14 @@ AvailabilityVersionsTestSuite.test("_stdlib_isOSVersionAtLeast") {
800
800
expectTrue(isAtLeastOS(0, 1066, 0))
801
801
expectTrue(isAtLeastOS(0, 0, 1066))
802
802
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
+ }
805
811
#endif
806
812
}
807
813
You can’t perform that action at this time.
0 commit comments