Skip to content

Commit 12b0987

Browse files
authored
Merge pull request #15141 from ikesyo/if-os-macos-in-test
2 parents c26f40b + b68be20 commit 12b0987

27 files changed

+48
-42
lines changed

test/ClangImporter/availability_returns_twice.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-swift-frontend -typecheck -verify %s
22

3-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
3+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
44
import Darwin
55
typealias JumpBuffer = Int32
66
#else

test/ClangImporter/clang_builtins.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: not %target-swift-frontend -swift-version 4 -typecheck %s 2> %t.4.txt
44
// RUN: %FileCheck -check-prefix=CHECK-4 -check-prefix=CHECK-%target-runtime-4 %s < %t.4.txt
55

6-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
6+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
77
import Darwin
88
#else
99
import Glibc
@@ -27,7 +27,7 @@ func test() {
2727
// CHECK-4: [[@LINE-2]]:16: error: cannot convert value of type '({{.+}}) -> Int'{{( [(]aka .+[)])?}} to specified type 'Int'
2828
}
2929

30-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
30+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
3131
// These functions aren't consistently available across platforms, so only
3232
// test for them on Apple platforms.
3333
func testApple() {

test/Fuzzing/fuzzer_test.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// XFAIL: OS=watchos
99
// CHECK: Crash!
1010

11-
#if os(OSX) || os(iOS)
11+
#if os(macOS) || os(iOS)
1212
import Darwin
1313
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin)
1414
import Glibc

test/Fuzzing/fuzzer_test_simpler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// XFAIL: OS=tvos
99
// XFAIL: OS=watchos
1010

11-
#if os(OSX) || os(iOS)
11+
#if os(macOS) || os(iOS)
1212
import Darwin
1313
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin)
1414
import Glibc

test/IDE/coloring_configs.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ class NestedPoundIf {
280280
// CHECK: <kw>class</kw> NestedPoundIf {
281281
func foo1() {
282282
// CHECK: <kw>func</kw> foo1() {
283-
#if os(OSX)
284-
// CHECK: <#kw>#if</#kw> <#id>os</#id>(<#id>OSX</#id>)
283+
#if os(macOS)
284+
// CHECK: <#kw>#if</#kw> <#id>os</#id>(<#id>macOS</#id>)
285285
var a = 1
286286
// CHECK: <kw>var</kw> a = <int>1</int>
287287
#if USE_METAL

test/IDE/structure.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func rethrowFunc(_ f: () throws -> () = {}) rethrows {}
154154

155155
class NestedPoundIf{
156156
func foo1() {
157-
#if os(OSX)
157+
#if os(macOS)
158158
var a = 1
159159
#if USE_METAL
160160
var b = 2

test/IRGen/Inputs/ObjectiveC.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
@_exported import ObjectiveC
33

44
public struct ObjCBool : CustomStringConvertible {
5-
#if os(OSX) || (os(iOS) && (arch(i386) || arch(arm)))
6-
// On OS X and 32-bit iOS, Objective-C's BOOL type is a "signed char".
5+
#if os(macOS) || (os(iOS) && (arch(i386) || arch(arm)))
6+
// On macOS and 32-bit iOS, Objective-C's BOOL type is a "signed char".
77
private var value: Int8
88

99
public init(_ value: Bool) {

test/Interpreter/SDK/Foundation_test.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ FoundationTestSuite.test("DarwinBoolean smoke test") {
252252
let _: CFArrayEqualCallBack = { DarwinBoolean($0 == $1) }
253253
}
254254

255-
#if os(OSX)
255+
#if os(macOS)
256256
FoundationTestSuite.test("NSRectEdge/constants") {
257257
// Check that the following constants have the correct type and value.
258258
//

test/Interpreter/SDK/c_pointers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// REQUIRES: objc_interop
77

88
import Foundation
9-
#if os(OSX)
9+
#if os(macOS)
1010
import AppKit
1111
typealias XXColor = NSColor
1212
#endif
@@ -28,7 +28,7 @@ let cgRed = CGColor(colorSpace: rgb, components: [1.0, 0.0, 0.0, 1.0])!
2828
let nsRed = XXColor(cgColor: cgRed)
2929

3030
var r: CGFloat = 0.5, g: CGFloat = 0.5, b: CGFloat = 0.5, a: CGFloat = 0.5
31-
#if os(OSX)
31+
#if os(macOS)
3232
nsRed!.getRed(&r, green: &g, blue: &b, alpha: &a)
3333
#else
3434
nsRed.getRed(&r, green: &g, blue: &b, alpha: &a)

test/Interpreter/SDK/cf_extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import Foundation
77
import StdlibUnittest
88

9-
#if os(OSX)
9+
#if os(macOS)
1010
import AppKit
1111
#endif
1212

test/Interpreter/SDK/cf_type_bridging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// REQUIRES: objc_interop
55

6-
#if os(OSX)
6+
#if os(macOS)
77
import AppKit
88
#endif
99
#if os(iOS) || os(tvOS) || os(watchOS)

test/Interpreter/SDK/libc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// TODO: rdar://problem/33388782
1010
// REQUIRES: CPU=x86_64
1111

12-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
12+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
1313
import Darwin
1414
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
1515
import Glibc

test/Interpreter/SDK/objc_ns_enum.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// strict checking if we get a guarantee that certain types don't have
99
// hidden or future enumeration values.)
1010

11-
#if os(OSX)
11+
#if os(macOS)
1212
import AppKit
1313

1414
print(NSButtonType(rawValue: 20721)!.rawValue)

test/Parse/ConditionalCompilation/basicIdentity.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ var v = u
6363
var w = Foo()
6464
#endif
6565
var x = w
66+
67+
// Test os(macOS) as well
68+
#if os(macOS)
69+
var y = Foo()
70+
#endif
71+
var z = y

test/PrintAsObjC/accessibility.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838

3939
#if MAIN
40-
#if os(OSX)
40+
#if os(macOS)
4141
import AppKit
4242

4343
@NSApplicationMain

test/SILGen/opaque_ownership.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public enum FloatingPointSign: Int64 {
171171
case minus
172172
}
173173

174-
#if os(OSX)
174+
#if os(macOS)
175175
// Test open_existential_value used in a conversion context.
176176
// (the actual bridging call is dropped because we don't import Swift).
177177
// ---
@@ -196,7 +196,7 @@ public func _unsafeDowncastToAnyObject(fromAny any: Any) -> AnyObject {
196196

197197
public protocol Error {}
198198

199-
#if os(OSX)
199+
#if os(macOS)
200200
// Test open_existential_box_value in a conversion context.
201201
// ---
202202
// CHECK-OSX-LABEL: sil @$Ss3foo1eys5Error_pSg_tF : $@convention(thin) (@owned Optional<Error>) -> () {

test/Sanitizers/tsan.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// https://bugs.swift.org/browse/SR-6622
88
// XFAIL: linux
99

10-
#if os(OSX) || os(iOS)
10+
#if os(macOS) || os(iOS)
1111
import Darwin
1212
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin)
1313
import Glibc
@@ -38,7 +38,7 @@ var threads: [pthread_t] = []
3838
var racey_x: Int;
3939

4040
for _ in 1...5 {
41-
#if os(OSX) || os(iOS)
41+
#if os(macOS) || os(iOS)
4242
var t : pthread_t?
4343
#else
4444
var t : pthread_t = 0
@@ -49,7 +49,7 @@ for _ in 1...5 {
4949

5050
return nil
5151
}, nil)
52-
#if os(OSX) || os(iOS)
52+
#if os(macOS) || os(iOS)
5353
threads.append(t!)
5454
#else
5555
threads.append(t)

test/stdlib/CodableTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct UUIDCodingWrapper : Codable, Equatable {
117117
// MARK: - Tests
118118
class TestCodable : TestCodableSuper {
119119
// MARK: - AffineTransform
120-
#if os(OSX)
120+
#if os(macOS)
121121
lazy var affineTransformValues: [Int : AffineTransform] = [
122122
#line : AffineTransform.identity,
123123
#line : AffineTransform(),
@@ -776,7 +776,7 @@ var tests = [
776776
"test_UUID_Plist" : TestCodable.test_UUID_Plist,
777777
]
778778

779-
#if os(OSX)
779+
#if os(macOS)
780780
tests["test_AffineTransform_JSON"] = TestCodable.test_AffineTransform_JSON
781781
tests["test_AffineTransform_Plist"] = TestCodable.test_AffineTransform_Plist
782782
#endif

test/stdlib/FloatConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
3+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
44
import Darwin
55
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
66
import Glibc

test/stdlib/MathConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
3+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
44
import Darwin
55
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
66
import Glibc

test/stdlib/Metal.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if #available(OSX 10.13, iOS 11.0, tvOS 11.0, *) {
7272
/* Setup */
7373

7474
let device = MTLCreateSystemDefaultDevice()!
75-
#if os(OSX)
75+
#if os(macOS)
7676
let options = MTLResourceOptions.storageModeManaged
7777
#else
7878
let options = MTLResourceOptions.storageModePrivate
@@ -81,7 +81,7 @@ if #available(OSX 10.13, iOS 11.0, tvOS 11.0, *) {
8181

8282
/* Call APIs */
8383

84-
#if os(OSX)
84+
#if os(macOS)
8585
buf.didModifyRange(0..<4)
8686
#endif
8787
buf.addDebugMarker("test marker", range: 0..<4)
@@ -97,7 +97,7 @@ if #available(OSX 10.13, iOS 11.0, tvOS 11.0, *) {
9797
let queue = device.makeCommandQueue()!
9898
let cmdBuf = queue.makeCommandBuffer()!
9999

100-
#if os(OSX)
100+
#if os(macOS)
101101
let options = MTLResourceOptions.storageModeManaged
102102
#else
103103
let options = MTLResourceOptions.storageModePrivate
@@ -162,7 +162,7 @@ if #available(OSX 10.13, iOS 11.0, tvOS 11.0, *) {
162162
let queue = device.makeCommandQueue()!
163163
let cmdBuf = queue.makeCommandBuffer()!
164164

165-
#if os(OSX)
165+
#if os(macOS)
166166
let options = MTLResourceOptions.storageModeManaged
167167
#else
168168
let options = MTLResourceOptions.storageModePrivate
@@ -182,7 +182,7 @@ if #available(OSX 10.13, iOS 11.0, tvOS 11.0, *) {
182182
let encoder = cmdBuf.makeRenderCommandEncoder(descriptor: rpDesc)!
183183
encoder.useResources([buf], usage: MTLResourceUsage.read)
184184
encoder.useHeaps([heap])
185-
#if os(OSX)
185+
#if os(macOS)
186186
encoder.setViewports([MTLViewport()])
187187
encoder.setScissorRects([MTLScissorRect(x:0, y:0, width:1, height:1)])
188188
#endif

test/stdlib/NSStringAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ NSStringAPIs.test("smallestEncoding") {
13291329
}
13301330

13311331
func getHomeDir() -> String {
1332-
#if os(OSX)
1332+
#if os(macOS)
13331333
return String(cString: getpwuid(getuid()).pointee.pw_dir)
13341334
#elseif os(iOS) || os(tvOS) || os(watchOS)
13351335
// getpwuid() returns null in sandboxed apps under iOS simulator.

test/stdlib/NSValueBridging.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ${ testCase("NSRange", "NSRange(location: 17, length: 38)", "range", "rangesEqua
5959
// For historic reasons, macOS has different NSValue methods for the
6060
// CoreGraphics types from other Apple platforms.
6161

62-
#if os(OSX)
62+
#if os(macOS)
6363

6464
${ testCase("CGRect", "CGRect(x: 17, y: 38, width: 6, height: 79)", "rect", "(==)") }
6565
${ testCase("CGPoint", "CGPoint(x: 17, y: 38)", "point", "(==)") }

test/stdlib/Reflection_objc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import Swift
1616
import Foundation
1717

18-
#if os(OSX)
18+
#if os(macOS)
1919
import AppKit
2020

2121
typealias OSImage = NSImage

test/stdlib/Runtime.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Swift
99
import StdlibUnittest
1010
import SwiftShims
1111

12-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
12+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
1313
import Darwin
1414
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
1515
import Glibc
@@ -553,7 +553,7 @@ Runtime.test("Struct layout with reference storage types") {
553553
}
554554

555555
Runtime.test("SwiftError layout constants for LLDB") {
556-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
556+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
557557
let RTLD_DEFAULT = UnsafeMutableRawPointer(bitPattern: -2)
558558
#elseif os(Linux)
559559
let RTLD_DEFAULT = UnsafeMutableRawPointer(bitPattern: 0)
@@ -565,7 +565,7 @@ Runtime.test("SwiftError layout constants for LLDB") {
565565
dlsym(RTLD_DEFAULT, "_swift_lldb_offsetof_SwiftError_typeMetadata")!
566566
let sizeof_SwiftError =
567567
dlsym(RTLD_DEFAULT, "_swift_lldb_sizeof_SwiftError")!
568-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
568+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
569569
#if arch(i386) || arch(arm)
570570
expectEqual(20, offsetof_SwiftError_typeMetadata.load(as: UInt.self))
571571
expectEqual(36, sizeof_SwiftError.load(as: UInt.self))
@@ -1671,7 +1671,7 @@ AvailabilityVersionsTestSuite.test("_stdlib_isOSVersionAtLeast") {
16711671

16721672
// _stdlib_isOSVersionAtLeast is broken for
16731673
// watchOS. rdar://problem/20234735
1674-
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
1674+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
16751675
// This test assumes that no version component on an OS we test upon
16761676
// will ever be greater than 1066 and that every major version will always
16771677
// be greater than 1.

test/stdlib/TestAffineTransform.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Foundation
1414

15-
#if os(OSX)
15+
#if os(macOS)
1616

1717
#if FOUNDATION_XCTEST
1818
import XCTest

test/stdlib/TestURL.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class TestURL : TestURLSuper {
6767
}
6868
}
6969

70-
#if os(OSX)
70+
#if os(macOS)
7171
func testQuarantineProperties() {
7272
// Test the quarantine stuff; it has special logic
7373
if #available(OSX 10.11, iOS 9.0, *) {
@@ -383,7 +383,7 @@ var URLTests = TestSuite("TestURL")
383383
URLTests.test("testBasics") { TestURL().testBasics() }
384384
URLTests.test("testProperties") { TestURL().testProperties() }
385385
URLTests.test("testSetProperties") { TestURL().testSetProperties() }
386-
#if os(OSX)
386+
#if os(macOS)
387387
URLTests.test("testQuarantineProperties") { TestURL().testQuarantineProperties() }
388388
#endif
389389
URLTests.test("testMoreSetProperties") { TestURL().testMoreSetProperties() }

0 commit comments

Comments
 (0)