Fixing the omit_needless_words test. (#4505)

AppKit apinotes do not get applied on anything other than macOS. This
commit extracts the AppKit related part of the test into a separate
file, in order to not restrict all other tests from being executed on
simulators.
<rdar://problem/27495329>
diff --git a/test/IDE/print_omit_needless_words.swift b/test/IDE/print_omit_needless_words.swift
index 23c0d7f..5c8bb69 100644
--- a/test/IDE/print_omit_needless_words.swift
+++ b/test/IDE/print_omit_needless_words.swift
@@ -9,17 +9,12 @@
 // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules-without-ns/CoreGraphics.swift
 // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t  %S/../Inputs/clang-importer-sdk/swift-modules-without-ns/Foundation.swift
 
-// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t  %S/../Inputs/clang-importer-sdk/swift-modules-without-ns/AppKit.swift
-
 // RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -print-module -source-filename %s -module-to-print=ObjectiveC -function-definitions=false -prefer-type-repr=true  > %t.ObjectiveC.txt
 // RUN: %FileCheck %s -check-prefix=CHECK-OBJECTIVEC -strict-whitespace < %t.ObjectiveC.txt
 
 // RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -print-module -source-filename %s -module-to-print=Foundation -function-definitions=false -prefer-type-repr=true  -skip-parameter-names > %t.Foundation.txt
 // RUN: %FileCheck %s -check-prefix=CHECK-FOUNDATION -strict-whitespace < %t.Foundation.txt
 
-// RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -print-module -source-filename %s -module-to-print=AppKit -function-definitions=false -prefer-type-repr=true  -skip-parameter-names > %t.AppKit.txt
-// RUN: %FileCheck %s -check-prefix=CHECK-APPKIT -strict-whitespace < %t.AppKit.txt
-
 // RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t -I %S/../ClangModules/Inputs/custom-modules) -print-module -source-filename %s -module-to-print=CoreCooling -function-definitions=false -prefer-type-repr=true  -skip-parameter-names > %t.CoreCooling.txt
 // RUN: %FileCheck %s -check-prefix=CHECK-CORECOOLING -strict-whitespace < %t.CoreCooling.txt
 
@@ -196,73 +191,12 @@
 // CHECK-FOUNDATION: var NSTimeIntervalSince1970: Double { get }
 // CHECK-FOUNDATION: var NS_DO_SOMETHING: Int
 
-// Note: class method name stripping context type.
-// CHECK-APPKIT: class func red() -> NSColor
-
-// Note: instance method name stripping context type.
-// CHECK-APPKIT: func same() -> Self
-
-// Note: Unsafe(Mutable)Pointers don't get defaulted to 'nil'
-// CHECK-APPKIT: func getRGBAComponents(_: UnsafeMutablePointer<Int8>?)
-
-// Note: Skipping over "3D"
-// CHECK-APPKIT: func drawInAir(at: Point3D)
-
-// Note: with<something> -> <something>
-// CHECK-APPKIT: func draw(at: Point3D, withAttributes: [String : Any]? = nil)
-
-// Note: Don't strip names that aren't preceded by a verb or preposition.
-// CHECK-APPKIT: func setTextColor(_: NSColor?)
-
-// Note: Splitting with default arguments.
-// CHECK-APPKIT: func draw(in: NSView?)
-
-// Note: NSDictionary default arguments for "options"
-// CHECK-APPKIT: func drawAnywhere(in: NSView?, options: [AnyHashable : Any] = [:])
-// CHECK-APPKIT: func drawAnywhere(options: [AnyHashable : Any] = [:])
-// CHECK-APPKIT: func drawAnywhere(optionalOptions: [AnyHashable : Any]? = nil)
-
 // Note: no lowercasing of initialisms when there might be a prefix.
 // CHECK-CORECOOLING: func CFBottom() ->
 
 // Note: Skipping over "Ref"
 // CHECK-CORECOOLING: func replace(_: CCPowerSupply!)
 
-// Make sure we're removing redundant context type info at both the
-// beginning and the end.
-// CHECK-APPKIT: func reversing() -> NSBezierPath
-
-// Make sure we're dealing with 'instancetype' properly.
-// CHECK-APPKIT: func inventing() -> Self
-
-// Make sure we're removing redundant context type info at both the
-// beginning and the end of a property.
-// CHECK-APPKIT: var flattened: NSBezierPath { get }
-
-// CHECK-APPKIT: func dismiss(animated: Bool)
-
-// CHECK-APPKIT: func shouldCollapseAutoExpandedItems(forDeposited: Bool) -> Bool
-
-// Introducing argument labels and pruning the base name.
-// CHECK-APPKIT: func rectForCancelButton(whenCentered: Bool)
-
-// CHECK-APPKIT: func openUntitledDocumentAndDisplay(_: Bool)
-
-// Don't strip due to weak type information.
-// CHECK-APPKIT: func setContentHuggingPriority(_: NSLayoutPriority)
-
-// Look through typedefs of pointers.
-// CHECK-APPKIT: func layout(at: NSPointPointer!)
-
-// The presence of a property prevents us from stripping redundant
-// type information from the base name.
-// CHECK-APPKIT: func addGestureRecognizer(_: NSGestureRecognizer)
-// CHECK-APPKIT: func removeGestureRecognizer(_: NSGestureRecognizer)
-// CHECK-APPKIT: func favoriteView(for: NSGestureRecognizer) -> NSView?
-// CHECK-APPKIT: func addLayoutConstraints(_: Set<NSLayoutConstraint>)
-// CHECK-APPKIT: func add(_: NSRect)
-// CHECK-APPKIT: class func conjureRect(_: NSRect)
-
 // CHECK-OMIT-NEEDLESS-WORDS: struct OMWWobbleOptions
 // CHECK-OMIT-NEEDLESS-WORDS:   static var sideToSide: OMWWobbleOptions
 // CHECK-OMIT-NEEDLESS-WORDS:   static var backAndForth: OMWWobbleOptions
diff --git a/test/IDE/print_omit_needless_words_appkit.swift b/test/IDE/print_omit_needless_words_appkit.swift
new file mode 100644
index 0000000..ef6ae2c
--- /dev/null
+++ b/test/IDE/print_omit_needless_words_appkit.swift
@@ -0,0 +1,74 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+
+// REQUIRES: objc_interop
+// REQUIRES: OS=macosx
+
+// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules-without-ns/ObjectiveC.swift
+// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules-without-ns/CoreGraphics.swift
+// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t  %S/../Inputs/clang-importer-sdk/swift-modules-without-ns/Foundation.swift
+// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t  %S/../Inputs/clang-importer-sdk/swift-modules-without-ns/AppKit.swift
+
+// RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -print-module -source-filename %s -module-to-print=AppKit -function-definitions=false -prefer-type-repr=true  -skip-parameter-names > %t.AppKit.txt
+// RUN: %FileCheck %s -check-prefix=CHECK-APPKIT -strict-whitespace < %t.AppKit.txt
+
+// Note: class method name stripping context type.
+// CHECK-APPKIT: class func red() -> NSColor
+
+// Note: instance method name stripping context type.
+// CHECK-APPKIT: func same() -> Self
+
+// Note: Unsafe(Mutable)Pointers don't get defaulted to 'nil'
+// CHECK-APPKIT: func getRGBAComponents(_: UnsafeMutablePointer<Int8>?)
+
+// Note: Skipping over "3D"
+// CHECK-APPKIT: func drawInAir(at: Point3D)
+
+// Note: with<something> -> <something>
+// CHECK-APPKIT: func draw(at: Point3D, withAttributes: [String : Any]? = nil)
+
+// Note: Don't strip names that aren't preceded by a verb or preposition.
+// CHECK-APPKIT: func setTextColor(_: NSColor?)
+
+// Note: Splitting with default arguments.
+// CHECK-APPKIT: func draw(in: NSView?)
+
+// Note: NSDictionary default arguments for "options"
+// CHECK-APPKIT: func drawAnywhere(in: NSView?, options: [AnyHashable : Any] = [:])
+// CHECK-APPKIT: func drawAnywhere(options: [AnyHashable : Any] = [:])
+// CHECK-APPKIT: func drawAnywhere(optionalOptions: [AnyHashable : Any]? = nil)
+
+// Make sure we're removing redundant context type info at both the
+// beginning and the end.
+// CHECK-APPKIT: func reversing() -> NSBezierPath
+
+// Make sure we're dealing with 'instancetype' properly.
+// CHECK-APPKIT: func inventing() -> Self
+
+// Make sure we're removing redundant context type info at both the
+// beginning and the end of a property.
+// CHECK-APPKIT: var flattened: NSBezierPath { get }
+
+// CHECK-APPKIT: func dismiss(animated: Bool)
+
+// CHECK-APPKIT: func shouldCollapseAutoExpandedItems(forDeposited: Bool) -> Bool
+
+// Introducing argument labels and pruning the base name.
+// CHECK-APPKIT: func rectForCancelButton(whenCentered: Bool)
+
+// CHECK-APPKIT: func openUntitledDocumentAndDisplay(_: Bool)
+
+// Don't strip due to weak type information.
+// CHECK-APPKIT: func setContentHuggingPriority(_: NSLayoutPriority)
+
+// Look through typedefs of pointers.
+// CHECK-APPKIT: func layout(at: NSPointPointer!)
+
+// The presence of a property prevents us from stripping redundant
+// type information from the base name.
+// CHECK-APPKIT: func addGestureRecognizer(_: NSGestureRecognizer)
+// CHECK-APPKIT: func removeGestureRecognizer(_: NSGestureRecognizer)
+// CHECK-APPKIT: func favoriteView(for: NSGestureRecognizer) -> NSView?
+// CHECK-APPKIT: func addLayoutConstraints(_: Set<NSLayoutConstraint>)
+// CHECK-APPKIT: func add(_: NSRect)
+// CHECK-APPKIT: class func conjureRect(_: NSRect)