diff --git a/test/Interpreter/SDK/FoundationDiagnostics.swift b/test/Interpreter/SDK/FoundationDiagnostics.swift deleted file mode 100644 index fbfc17f862cc8..0000000000000 --- a/test/Interpreter/SDK/FoundationDiagnostics.swift +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %target-swift-frontend %s -typecheck -verify - -// REQUIRES: objc_interop - -import Foundation - -func encode(_ string: String) { - _ = string.cString(using: NSUTF8StringEncoding) // expected-error {{'NSUTF8StringEncoding' has been renamed to 'String.Encoding.utf8'}} {{29-49=String.Encoding.utf8}} - let _: NSStringEncoding? = nil // expected-error {{'NSStringEncoding' has been renamed to 'String.Encoding'}} {{10-26=String.Encoding}} -} diff --git a/test/Interpreter/SDK/Foundation_NSRect.swift b/test/Interpreter/SDK/Foundation_NSRect.swift index fbea20b257399..cdf57f73fab15 100644 --- a/test/Interpreter/SDK/Foundation_NSRect.swift +++ b/test/Interpreter/SDK/Foundation_NSRect.swift @@ -4,7 +4,9 @@ // iOS doesn't have NSRect. iOS and OS X CGRect is tested elsewhere. // REQUIRES: OS=macosx -import Foundation +import CoreImage + +_ = JSONDecoder() func printRect(_ r: NSRect) { // FIXME: Constraint checker takes too long to typecheck this as an diff --git a/test/Interpreter/SDK/Quartz_without_Foundation.swift b/test/Interpreter/SDK/Quartz_without_Foundation.swift deleted file mode 100644 index 446ae40163355..0000000000000 --- a/test/Interpreter/SDK/Quartz_without_Foundation.swift +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %target-run-simple-swift | %FileCheck %s -// REQUIRES: executable_test -// REQUIRES: OS=macosx - -import QuartzCore -// Do NOT add anything that publicly imports Foundation here! - -var v = CIVector(x:7); -// CHECK: x = 7 -print("x = \(v.x)") diff --git a/test/Interpreter/SDK/objc_implicit_inner_pointer.swift b/test/Interpreter/SDK/objc_implicit_inner_pointer.swift index 77d2c7de236ff..a2227a213537c 100644 --- a/test/Interpreter/SDK/objc_implicit_inner_pointer.swift +++ b/test/Interpreter/SDK/objc_implicit_inner_pointer.swift @@ -7,6 +7,10 @@ // REQUIRES: executable_test // REQUIRES: objc_interop +import Foundation + +_ = JSONDecoder() + do { // The lifetime of Foo() currently gets extended using autorelease. autoreleasepool { diff --git a/test/Interpreter/SDK/objc_inner_pointer.swift b/test/Interpreter/SDK/objc_inner_pointer.swift index 44f893b3fecf6..710404075ac0d 100644 --- a/test/Interpreter/SDK/objc_inner_pointer.swift +++ b/test/Interpreter/SDK/objc_inner_pointer.swift @@ -4,6 +4,8 @@ // REQUIRES: objc_interop import Foundation + +_ = JSONDecoder() class Canary: NSObject { deinit { diff --git a/test/Interpreter/SDK/objc_unowned.swift b/test/Interpreter/SDK/objc_unowned.swift index fc75dc0ca0b3b..cd862541d9500 100644 --- a/test/Interpreter/SDK/objc_unowned.swift +++ b/test/Interpreter/SDK/objc_unowned.swift @@ -5,6 +5,8 @@ import Foundation +_ = JSONDecoder() + let x = NSObject() unowned let y = x diff --git a/test/stdlib/NSStringAPI.swift b/test/stdlib/NSStringAPI.swift index a1cdc280f6592..c29ca48ce2269 100644 --- a/test/stdlib/NSStringAPI.swift +++ b/test/stdlib/NSStringAPI.swift @@ -210,9 +210,10 @@ NSStringAPIs.test("init(contentsOf:usedEncoding:error:)") { } NSStringAPIs.test("init(cString_:encoding:)") { - expectEqual("foo, a basmati bar!", - String(cString: - "foo, a basmati bar!", encoding: String.defaultCStringEncoding)) + "foo, a basmati bar!".withCString { + expectEqual("foo, a basmati bar!", + String(cString: $0, encoding: String.defaultCStringEncoding)) + } } NSStringAPIs.test("init(utf8String:)") { diff --git a/validation-test/compiler_crashers_2_fixed/rdar81590807.swift b/validation-test/compiler_crashers_2_fixed/rdar81590807.swift index 2d82ccc13825c..46170c5e94aae 100644 --- a/validation-test/compiler_crashers_2_fixed/rdar81590807.swift +++ b/validation-test/compiler_crashers_2_fixed/rdar81590807.swift @@ -48,6 +48,7 @@ func run(on object: PFXObject) async throws { @main struct Main { static func main() async throws { + _ = JSONDecoder() let object = PFXObject() try await run(on: object) }