From 4a8a647e4c9b8ce943df8464a4349e574ee34d25 Mon Sep 17 00:00:00 2001 From: Nate Chandler Date: Wed, 28 Jul 2021 20:19:07 -0700 Subject: [PATCH] [Test] Used test header rather than SDK. Stopped validation-test/compiler_crashers_2_fixed/rdar79383990.swift from trying to call -[NSBackgroundActivityScheduler scheduleWithBlock:] async--that method is now annotated NS_SWIFT_DISABLE_ASYNC. --- .../compiler_crashers_2_fixed/Inputs/rdar79383990.h | 12 ++++++++++++ .../compiler_crashers_2_fixed/rdar79383990.swift | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 validation-test/compiler_crashers_2_fixed/Inputs/rdar79383990.h diff --git a/validation-test/compiler_crashers_2_fixed/Inputs/rdar79383990.h b/validation-test/compiler_crashers_2_fixed/Inputs/rdar79383990.h new file mode 100644 index 0000000000000..dbe29c0ce3eba --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/Inputs/rdar79383990.h @@ -0,0 +1,12 @@ +@import Foundation; + +typedef NS_ENUM(NSInteger, BackgroundActivityResult) { + BackgroundActivityResultFinished = 1, + BackgroundActivityResultDeferred = 2, +}; + +typedef void (^BackgroundActivityCompletionHandler)(BackgroundActivityResult result); + +@interface BackgroundActivityScheduler : NSObject +- (void)scheduleWithBlock:(void (^)(BackgroundActivityCompletionHandler completionHandler))block; +@end diff --git a/validation-test/compiler_crashers_2_fixed/rdar79383990.swift b/validation-test/compiler_crashers_2_fixed/rdar79383990.swift index e3dc9cf219d4e..2c2f4ce080775 100644 --- a/validation-test/compiler_crashers_2_fixed/rdar79383990.swift +++ b/validation-test/compiler_crashers_2_fixed/rdar79383990.swift @@ -1,9 +1,9 @@ -// RUN: %target-swift-frontend %s -emit-silgen -disable-availability-checking +// RUN: %target-swift-frontend %s -emit-silgen -disable-availability-checking -import-objc-header %S/Inputs/rdar79383990.h // REQUIRES: objc_interop // REQUIRES: OS=macosx import Foundation -func test(s: NSBackgroundActivityScheduler) async { +func test(s: BackgroundActivityScheduler) async { _ = await s.schedule() }