Migrate PrintAsObjC tests to Swift 4

I didn't migrate test/PrintAsObjC/versioned.swift, because it
explicitly checks the Swift 3 projection of some APIs.
This commit is contained in:
Slava Pestov
2018-06-26 16:56:04 -07:00
parent edc3b7bfc3
commit 5964c00091
14 changed files with 130 additions and 144 deletions

View File

@@ -1,6 +1,5 @@
SWIFT_CLASS("_TtC8comments4A000")
@interface A000
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -30,7 +29,6 @@ SWIFT_CLASS("_TtC8comments10ATXHeaders")
/// <h1>LEVEL ONE</h1>
/// <h2>LEVEL TWO</h2>
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -39,7 +37,6 @@ SWIFT_CLASS("_TtC8comments13AutomaticLink")
/// And now for a URL.
/// <a href="http://developer.apple.com/swift/">http://developer.apple.com/swift/</a>
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -55,7 +52,6 @@ SWIFT_CLASS("_TtC8comments10BlockQuote")
///
/// </blockquote>
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -75,7 +71,6 @@ SWIFT_CLASS("_TtC8comments5Brief")
/// Aaa.
/// Bbb.
- (void)f3;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -83,7 +78,6 @@ SWIFT_CLASS("_TtC8comments15ClosingComments")
@interface ClosingComments
/// Some comment. */
- (void)closingComment;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -152,7 +146,6 @@ SWIFT_CLASS("_TtC8comments16ClosureContainer")
/// \a combine error: Nothing.
///
- (void)closureParameterOutlineOutlineWithA:(NSInteger)a combine:(SWIFT_NOESCAPE NSInteger (^ _Nonnull)(NSInteger, NSInteger))combine;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -166,7 +159,6 @@ SWIFT_CLASS("_TtC8comments9CodeBlock")
///
/// \endcode
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -175,7 +167,6 @@ SWIFT_CLASS("_TtC8comments8Emphasis")
/// Aaa <em>bbb</em> ccc.
/// Aaa <em>bbb</em> ccc.
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -191,7 +182,6 @@ SWIFT_CLASS("_TtC8comments13EmptyComments")
- (void)f3;
/// Aaa.
- (void)f4;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -204,7 +194,6 @@ SWIFT_CLASS("_TtC8comments19HasThrowingFunction")
/// throws:
/// An error if <code>x == 0</code>
- (void)f1:(NSInteger)x;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -214,7 +203,6 @@ SWIFT_CLASS("_TtC8comments15HorizontalRules")
/// <hr/>
/// The end.
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -222,7 +210,6 @@ SWIFT_CLASS("_TtC8comments16ImplicitNameLink")
@interface ImplicitNameLink
/// <a href="https://www.apple.com/">Apple</a>
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -250,7 +237,6 @@ SWIFT_CLASS("_TtC8comments20IndentedBlockComment")
///
/// \endcode
- (void)f2;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -258,7 +244,6 @@ SWIFT_CLASS("_TtC8comments10InlineCode")
@interface InlineCode
/// Aaa <code>bbb</code> ccc.
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -266,7 +251,6 @@ SWIFT_CLASS("_TtC8comments10InlineLink")
@interface InlineLink
/// Aaa <a href="/path/to/something">bbb</a> ccc.
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -276,7 +260,6 @@ SWIFT_CLASS("_TtC8comments14MultiLineBrief")
/// Brief after softbreak.
/// Some paragraph text.
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -292,7 +275,6 @@ SWIFT_CLASS("_TtC8comments11OrderedList")
/// </li>
/// </ol>
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -338,7 +320,6 @@ SWIFT_CLASS("_TtC8comments15ParamAndReturns")
/// Eee.
/// Fff.
- (void)f4;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -351,7 +332,6 @@ SWIFT_CLASS("_TtC8comments16ParameterOutline")
/// \param z A number
///
- (void)f0:(NSInteger)x y:(NSInteger)y z:(NSInteger)z;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -372,13 +352,11 @@ SWIFT_CLASS("_TtC8comments22ParameterOutlineMiddle")
/// \param z A number
///
- (void)f0:(NSInteger)x y:(NSInteger)y z:(NSInteger)z;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
SWIFT_CLASS("_TtC8comments13ReferenceLink")
@interface ReferenceLink
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -388,7 +366,6 @@ SWIFT_CLASS("_TtC8comments7Returns")
/// returns:
/// A number
- (NSInteger)f0 SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -397,7 +374,6 @@ SWIFT_CLASS("_TtC8comments18SeparateParameters")
/// \param x A number
///
- (void)f0:(NSInteger)x y:(NSInteger)y;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -410,7 +386,6 @@ SWIFT_CLASS("_TtC8comments13SetextHeaders")
/// <h5>LEVEL FIVE</h5>
/// <h5>LEVEL SIX</h5>
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -419,7 +394,6 @@ SWIFT_CLASS("_TtC8comments14StrongEmphasis")
/// Aaa <em>bbb</em> ccc.
/// Aaa <em>bbb</em> ccc.
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@@ -448,7 +422,6 @@ SWIFT_CLASS("_TtC8comments13UnorderedList")
/// </li>
/// </ul>
- (void)f0;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
#if __has_attribute(external_source_symbol)

View File

@@ -1,21 +1,21 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -parse-as-library %s -typecheck -emit-objc-header-path %t/accessibility.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend -parse-as-library %s -typecheck -emit-objc-header-path %t/accessibility.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=CHECK-PUBLIC %s < %t/accessibility.h
// RUN: %check-in-clang %t/accessibility.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -typecheck -emit-objc-header-path %t/accessibility-internal.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -typecheck -emit-objc-header-path %t/accessibility-internal.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=CHECK-INTERNAL %s < %t/accessibility-internal.h
// RUN: %check-in-clang %t/accessibility-internal.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %s -typecheck -import-objc-header %S/../Inputs/empty.h -emit-objc-header-path %t/accessibility-imported-header.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %s -typecheck -import-objc-header %S/../Inputs/empty.h -emit-objc-header-path %t/accessibility-imported-header.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=CHECK-INTERNAL %s < %t/accessibility-imported-header.h
// RUN: %check-in-clang %t/accessibility-imported-header.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %s -typecheck -DMAIN -emit-objc-header-path %t/accessibility-main.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %s -typecheck -DMAIN -emit-objc-header-path %t/accessibility-main.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=CHECK-INTERNAL %s < %t/accessibility-main.h
// RUN: %check-in-clang %t/accessibility-main.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %s -typecheck -application-extension -emit-objc-header-path %t/accessibility-appext.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %s -typecheck -application-extension -emit-objc-header-path %t/accessibility-appext.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=CHECK-INTERNAL %s < %t/accessibility-appext.h
// RUN: %check-in-clang %t/accessibility-appext.h
@@ -24,16 +24,16 @@
// CHECK-LABEL: @interface A_Public{{$}}
// CHECK-INTERNAL-NEXT: init
// CHECK-NEXT: @end
@objc public class A_Public {}
@objc @objcMembers public class A_Public {}
// CHECK-PUBLIC-NOT: B_Internal
// CHECK-INTERNAL-LABEL: @interface B_Internal{{$}}
// CHECK-INTERNAL-NEXT: init
// CHECK-INTERNAL-NEXT: @end
@objc internal class B_Internal {}
@objc @objcMembers internal class B_Internal {}
// CHECK-NOT: C_Private
@objc private class C_Private {}
@objc @objcMembers private class C_Private {}
#if MAIN

View File

@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/availability.swiftmodule -typecheck -emit-objc-header-path %t/availability.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/availability.swiftmodule -typecheck -emit-objc-header-path %t/availability.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/availability.h
// RUN: %check-in-clang %t/availability.h
@@ -153,7 +153,7 @@
@available(macOS 10.10, *)
@objc init(x _: Int) {}
var simpleProperty: Int {
@objc var simpleProperty: Int {
get {
return 100
}
@@ -193,7 +193,7 @@ extension Availability {
@available(macOS, deprecated: 10.10)
var propertyDeprecatedInsideExtension: Int {
@objc var propertyDeprecatedInsideExtension: Int {
get {
return 0
}
@@ -208,7 +208,7 @@ extension Availability {
@available(macOS 999, *)
@objc class WholeClassAvailability {
@objc @objcMembers class WholeClassAvailability {
func wholeClassAvailability(_: WholeProtoAvailability) {}
}

View File

@@ -1,8 +1,8 @@
// Please keep this file in alphabetical order!
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/blocks.swiftmodule -typecheck -emit-objc-header-path %t/blocks.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/blocks.swiftmodule -typecheck -emit-objc-header-path %t/blocks.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/blocks.h
// RUN: %check-in-clang %t/blocks.h
@@ -135,6 +135,9 @@ typealias MyBlockWithNoescapeParam = (() -> ()) -> Int
// CHECK-NEXT: @property (nonatomic, getter=class, setter=setClass:) NSInteger (* _Nonnull class_)(NSInteger);
@objc var `class`: @convention(c) (_ function: Int) -> Int = { $0 }
// CHECK-NEXT: init
@objc init() {}
}
// CHECK-NEXT: init
// CHECK-NEXT: @end

View File

@@ -5,13 +5,13 @@
// RUN: %empty-directory(%t)
// FIXME: BEGIN -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
// FIXME: END -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -import-objc-header %S/Inputs/circularity.h -emit-module -o %t %s -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -import-objc-header %S/Inputs/circularity.h -parse-as-library %t/circularity.swiftmodule -typecheck -emit-objc-header-path %t/circularity.h -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -import-objc-header %S/Inputs/circularity.h -emit-module -o %t %s
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -import-objc-header %S/Inputs/circularity.h -parse-as-library %t/circularity.swiftmodule -typecheck -emit-objc-header-path %t/circularity.h
// RUN: %FileCheck %s < %t/circularity.h
@@ -23,18 +23,18 @@ import Foundation
// CHECK-LABEL: @interface A1 : ProtoImpl
class A1: ProtoImpl {
// CHECK: // 'test(_:)' below
func test(_: NeedsProto<A2>) {}
@objc func test(_: NeedsProto<A2>) {}
} // CHECK: @end
// CHECK-LABEL: @interface A2 : ProtoImpl
class A2: ProtoImpl {
// CHECK: - (void)test:
func test(_: NeedsProto<A1>) {}
@objc func test(_: NeedsProto<A1>) {}
} // CHECK: @end
// CHECK-LABEL: @interface B1 : ProtoImpl
class B1: ProtoImpl {
// CHECK: // 'test(_:)' below
func test(_: NeedsProto<B2>) {}
@objc func test(_: NeedsProto<B2>) {}
} // CHECK: @end
// CHECK-LABEL: @interface B2 : ProtoImpl
class B2: ProtoImpl {
@@ -43,7 +43,7 @@ class B2: ProtoImpl {
// CHECK-LABEL: @interface C1 : ProtoImpl
class C1: ProtoImpl {
// CHECK: // 'test(_:)' below
func test(_: NeedsProto<C2>) {}
@objc func test(_: NeedsProto<C2>) {}
} // CHECK: @end
// CHECK-LABEL: @protocol C2 <Proto>
@objc protocol C2: Proto {
@@ -52,7 +52,7 @@ class C1: ProtoImpl {
// CHECK-LABEL: @interface D1 : ProtoImpl
class D1: ProtoImpl {
// CHECK: // 'test(_:)' below
func test(_: NeedsProto<D2>) {}
@objc func test(_: NeedsProto<D2>) {}
} // CHECK: @end
// CHECK-LABEL: @protocol D2 <Proto>
@objc protocol D2: Proto {
@@ -70,7 +70,7 @@ class D1: ProtoImpl {
} // CHECK: @end
// Moved ahead.
class D4: ProtoImpl {
func test(_: NeedsProto<D3>) {}
@objc func test(_: NeedsProto<D3>) {}
}
// CHECK-LABEL: @interface E2 : ProtoImpl
@@ -91,7 +91,7 @@ class F1: ProtoImpl {
// CHECK-LABEL: @interface F1 (SWIFT_EXTENSION(circularity))
extension F1 {
// CHECK: - (void)test:
func test(_: NeedsProto<F2>) {}
@objc func test(_: NeedsProto<F2>) {}
} // CHECK: @end
// Moved ahead.
class F2: ProtoImpl {}
@@ -104,7 +104,7 @@ class G1: ProtoImpl {
// CHECK-LABEL: @interface G1 (SWIFT_EXTENSION(circularity))
extension G1 {
// CHECK: - (void)test:
func test(_: NeedsProto<G2>) {}
@objc func test(_: NeedsProto<G2>) {}
} // CHECK: @end
// Moved ahead.
@objc protocol G2: Proto {}
@@ -112,56 +112,56 @@ extension G1 {
// CHECK-LABEL: @interface H1 : ProtoImpl
class H1: ProtoImpl {
// CHECK: 'test(_:)' below
func test(_: NeedsProto<H2>) {}
@objc func test(_: NeedsProto<H2>) {}
// CHECK: 'anotherTest(_:)' below
func anotherTest(_: NeedsProto<H3>) {}
@objc func anotherTest(_: NeedsProto<H3>) {}
} // CHECK: @end
// CHECK-LABEL: @interface H2 : ProtoImpl
class H2: ProtoImpl {
// CHECK: // 'test(_:)' below
func test(_: NeedsProto<H3>) {}
@objc func test(_: NeedsProto<H3>) {}
// CHECK: - (void)anotherTest:
func anotherTest(_: NeedsProto<H1>) {}
@objc func anotherTest(_: NeedsProto<H1>) {}
} // CHECK: @end
// CHECK-LABEL: @interface H3 : ProtoImpl
class H3: ProtoImpl {
// CHECK: - (void)test:
func test(_: NeedsProto<H1>) {}
@objc func test(_: NeedsProto<H1>) {}
// CHECK: - (void)anotherTest:
func anotherTest(_: NeedsProto<H2>) {}
@objc func anotherTest(_: NeedsProto<H2>) {}
} // CHECK: @end
// CHECK-LABEL: @interface I1 : Parent
class I1 : Parent {
// CHECK: // 'test(_:)' below
func test(_: NeedsParent<I2>) {}
@objc func test(_: NeedsParent<I2>) {}
} // CHECK: @end
// CHECK-LABEL: @interface I2 : Parent
class I2 : Parent {
// CHECK: - (void)test:
func test(_: NeedsParent<I1>) {}
@objc func test(_: NeedsParent<I1>) {}
} // CHECK: @end
// CHECK-LABEL: @interface J1 : Parent
class J1 : Parent {
// CHECK: - (void)test:
func test(_: Unconstrained<J2>) {}
@objc func test(_: Unconstrained<J2>) {}
} // CHECK: @end
// CHECK-LABEL: @interface J2 : Parent
class J2 : Parent {
// CHECK: - (void)test:
func test(_: Unconstrained<J1>) {}
@objc func test(_: Unconstrained<J1>) {}
} // CHECK: @end
// CHECK-LABEL: @protocol K1 <Proto>
@objc protocol K1 : Proto {
// CHECK: - (void)test:
func test(_: Unconstrained<K2>)
@objc func test(_: Unconstrained<K2>)
} // CHECK: @end
// CHECK-LABEL: @protocol K2 <Proto>
@objc protocol K2 : Proto {
// CHECK: - (void)test:
func test(_: Unconstrained<K1>)
@objc func test(_: Unconstrained<K1>)
} // CHECK: @end

View File

@@ -5,15 +5,15 @@
// RUN: %empty-directory(%t)
// FIXME: BEGIN -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/AppKit.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/AppKit.swift
// FIXME: END -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -I %S/Inputs/custom-modules -o %t %s -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -parse-as-library %t/classes.swiftmodule -typecheck -I %S/Inputs/custom-modules -emit-objc-header-path %t/classes.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -I %S/Inputs/custom-modules -o %t %s -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -parse-as-library %t/classes.swiftmodule -typecheck -I %S/Inputs/custom-modules -emit-objc-header-path %t/classes.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/classes.h
// RUN: %FileCheck --check-prefix=NEGATIVE %s < %t/classes.h
// RUN: %check-in-clang -I %S/Inputs/custom-modules/ %t/classes.h
@@ -42,7 +42,7 @@ import SingleGenericClass
// CHECK-LABEL: @interface A1{{$}}
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class A1 {}
@objc @objcMembers class A1 {}
// CHECK-LABEL: @interface B1 : A1
// CHECK-NEXT: init
@@ -54,7 +54,7 @@ import SingleGenericClass
// CHECK-NEXT: - (NSSet * _Nonnull)setBridge:(NSSet * _Nonnull)x SWIFT_WARN_UNUSED_RESULT;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class BridgedTypes {
@objc @objcMembers class BridgedTypes {
@objc func dictBridge(_ x: Dictionary<NSObject, AnyObject>) -> Dictionary<NSObject, AnyObject> {
return x
}
@@ -71,7 +71,8 @@ import SingleGenericClass
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc(CustomName)
class ClassWithCustomName {
@objcMembers
class ClassWithCustomName {
@objc func forwardCustomName(_: ClassWithCustomName2) {}
}
@@ -80,6 +81,7 @@ class ClassWithCustomName {
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc(CustomName2)
@objcMembers
class ClassWithCustomName2 {}
// CHECK-LABEL: SWIFT_CLASS_NAMED("ClassWithCustomNameSub")
@@ -96,7 +98,7 @@ class ClassWithCustomNameSub : ClassWithCustomName {}
// CHECK-NEXT: - (BOOL)isKindOfClass:(Class _Nonnull)aClass SWIFT_WARN_UNUSED_RESULT;
// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
// CHECK-NEXT: @end
@objc class ClassWithNSObjectProtocol : NSObjectProtocol {
@objc @objcMembers class ClassWithNSObjectProtocol : NSObjectProtocol {
@objc var description: String { return "me" }
@objc(conformsToProtocol:)
func conforms(to _: Protocol) -> Bool { return false }
@@ -290,6 +292,8 @@ class NotObjC {}
@objc func initializeEvenMoreThings() {}
@objc(newWithFoo:) class func make(foo: Int) -> Methods { return Methods() }
@objc init() {}
}
typealias AliasForNSRect = NSRect
@@ -310,7 +314,7 @@ typealias AliasForNSRect = NSRect
// CHECK-NEXT: - (NSURL * _Nullable)returnsURL SWIFT_WARN_UNUSED_RESULT;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class MethodsWithImports {
@objc @objcMembers class MethodsWithImports {
@objc func getOrigin(_ r: NSRect) -> NSPoint { return r.origin }
@objc func getOriginX(_ r: AliasForNSRect) -> CGFloat { return r.origin.x }
@objc func getOriginY(_ r: CGRect) -> CGFloat { return r.origin.y }
@@ -340,7 +344,7 @@ typealias AliasForNSRect = NSRect
// CHECK-NEXT: - (void)testBridgingOptionality:(NSInteger const * _Nullable)a b:(NSInteger * _Null_unspecified)b c:(Methods * _Nullable * _Nullable)c;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class MethodsWithPointers {
@objc @objcMembers class MethodsWithPointers {
@objc func test(_ a: UnsafeMutablePointer<Int>) -> UnsafeMutablePointer<AnyObject> {
return UnsafeMutablePointer(bitPattern: -1)!
}
@@ -368,7 +372,7 @@ class MyObject : NSObject {}
// CHECK-NEXT: - (void)test:(Class <MyProtocolMetaOnly> _Nullable)x;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class MyProtocolMetaCheck {
@objc @objcMembers class MyProtocolMetaCheck {
@objc func test(_ x: MyProtocolMetaOnly.Type?) {}
}
// CHECK-LABEL: @protocol MyProtocolMetaOnly
@@ -378,21 +382,21 @@ class MyObject : NSObject {}
// CHECK-LABEL: @interface Nested
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Nested {
@objc @objcMembers class Nested {
// CHECK-LABEL: @interface Inner
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Inner {
@objc @objcMembers class Inner {
// CHECK-LABEL: @interface DeeperIn
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class DeeperIn {}
@objc @objcMembers class DeeperIn {}
}
// CHECK-LABEL: @interface AnotherInner : A1
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class AnotherInner : A1 {}
@objc @objcMembers class AnotherInner : A1 {}
// NEGATIVE-NOT: NonObjCInner
class NonObjCInner {}
@@ -407,13 +411,13 @@ class MyObject : NSObject {}
// CHECK-NEXT: @property (nonatomic, strong) Inner3 * _Nullable ref3;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class NestedMembers {
@objc @objcMembers class NestedMembers {
// NEGATIVE-NOT: @class NestedMembers;
// CHECK-LABEL: @interface Inner2
// CHECK-NEXT: @property (nonatomic, strong) NestedMembers * _Nullable ref;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Inner2 {
@objc @objcMembers class Inner2 {
@objc var ref: NestedMembers?
}
@@ -424,7 +428,7 @@ class MyObject : NSObject {}
// CHECK-NEXT: @property (nonatomic, strong) NestedMembers * _Nullable ref;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Inner3 {
@objc @objcMembers class Inner3 {
@objc var ref: NestedMembers?
}
}
@@ -432,11 +436,11 @@ class MyObject : NSObject {}
// CHECK-LABEL: @interface NestedSuperclass
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class NestedSuperclass {
@objc @objcMembers class NestedSuperclass {
// CHECK-LABEL: @interface Subclass : NestedSuperclass
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Subclass : NestedSuperclass {}
@objc @objcMembers class Subclass : NestedSuperclass {}
}
// CHECK-LABEL: @interface NewBanned
@@ -444,7 +448,7 @@ class MyObject : NSObject {}
// CHECK-NEXT: - (nonnull instancetype)init SWIFT_UNAVAILABLE;
// CHECK-NEXT: + (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable");
// CHECK-NEXT: @end
@objc class NewBanned : NSObject {
@objc @objcMembers class NewBanned : NSObject {
init(arbitraryArgument: Int) { super.init() }
}
@@ -452,7 +456,7 @@ class MyObject : NSObject {}
// CHECK-NEXT: - (nonnull instancetype)initWithDifferentArbitraryArgument:(NSInteger)differentArbitraryArgument OBJC_DESIGNATED_INITIALIZER;
// CHECK-NEXT: - (nonnull instancetype)initWithArbitraryArgument:(NSInteger)arbitraryArgument SWIFT_UNAVAILABLE;
// CHECK-NEXT: @end
@objc class NewBannedStill : NewBanned {
@objc @objcMembers class NewBannedStill : NewBanned {
init(differentArbitraryArgument: Int) { super.init(arbitraryArgument: 0) }
}
@@ -461,7 +465,7 @@ class MyObject : NSObject {}
// CHECK-NEXT: + (nonnull instancetype)new;
// CHECK-NEXT: - (nonnull instancetype)initWithArbitraryArgument:(NSInteger)arbitraryArgument SWIFT_UNAVAILABLE;
// CHECK-NEXT: @end
@objc class NewUnbanned : NewBanned {
@objc @objcMembers class NewUnbanned : NewBanned {
init() { super.init(arbitraryArgument: 0) }
}
@@ -470,7 +474,7 @@ class MyObject : NSObject {}
// CHECK-NEXT: + (nonnull instancetype)new;
// CHECK-NEXT: - (nonnull instancetype)initWithDifferentArbitraryArgument:(NSInteger)differentArbitraryArgument SWIFT_UNAVAILABLE;
// CHECK-NEXT: @end
@objc class NewUnbannedDouble : NewBannedStill {
@objc @objcMembers class NewUnbannedDouble : NewBannedStill {
init() { super.init(differentArbitraryArgument: 0) }
}
@@ -664,6 +668,8 @@ public class NonObjCClass { }
}
@objc var customValueTypeProp: URL?
@objc init() {}
}
// CHECK-LABEL: @interface PropertiesOverridden
@@ -690,7 +696,7 @@ public class NonObjCClass { }
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class ReversedOrder1 : ReversedOrder2 {}
@objc class ReversedOrder2 {}
@objc @objcMembers class ReversedOrder2 {}
// CHECK-LABEL: @interface Subscripts1
@@ -698,7 +704,7 @@ public class NonObjCClass { }
// CHECK-NEXT: - (Subscripts1 * _Nonnull)objectForKeyedSubscript:(Subscripts1 * _Nonnull)o SWIFT_WARN_UNUSED_RESULT;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Subscripts1 {
@objc @objcMembers class Subscripts1 {
@objc subscript (i: Int) -> Subscripts1 {
return self
}
@@ -716,7 +722,7 @@ public class NonObjCClass { }
// CHECK-NEXT: @property (nonatomic, copy) NSArray<NSString *> * _Nonnull cardPaths;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Subscripts2 {
@objc @objcMembers class Subscripts2 {
@objc subscript (i: Int16) -> Subscripts2 {
get {
return self
@@ -743,7 +749,7 @@ public class NonObjCClass { }
// CHECK-NEXT: - (Subscripts3 * _Nonnull)objectAtIndexedSubscript:(unsigned long)_ SWIFT_WARN_UNUSED_RESULT;
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Subscripts3 {
@objc @objcMembers class Subscripts3 {
@objc subscript (_: CUnsignedLong) -> Subscripts3 {
return self
}

View File

@@ -1,8 +1,8 @@
// Please keep this file in alphabetical order!
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-source-import -emit-module -emit-module-path %t/comments.swiftmodule -emit-module-doc -emit-module-doc-path %t/comments.swiftdoc -module-name comments %S/../Inputs/comment_to_something_conversion.swift -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/comments.swiftmodule -typecheck -emit-objc-header-path %t/comments.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-source-import -emit-module -emit-module-path %t/comments.swiftmodule -emit-module-doc -emit-module-doc-path %t/comments.swiftdoc -module-name comments %S/../Inputs/comment_to_something_conversion.swift -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/comments.swiftmodule -typecheck -emit-objc-header-path %t/comments.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: awk '/A000/,0' %t/comments.h > %t/comments.h-cleaned
// RUN: diff -u %t/comments.h-cleaned %S/Inputs/comments-expected-output.h
// RUN: %check-in-clang -Wno-documentation %t/comments.h

View File

@@ -1,8 +1,8 @@
// Please keep this file in alphabetical order!
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/extensions.swiftmodule -typecheck -emit-objc-header-path %t/extensions.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/extensions.swiftmodule -typecheck -emit-objc-header-path %t/extensions.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/extensions.h
// RUN: %FileCheck --check-prefix=NEGATIVE %s < %t/extensions.h
// RUN: %check-in-clang %t/extensions.h
@@ -18,7 +18,7 @@ import objc_generics
// CHECK-LABEL: @interface A1{{$}}
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class A1 {}
@objc @objcMembers class A1 {}
// NEGATIVE-NOT: @interface A1 (SWIFT_EXTENSION(extensions))
extension A1 {}
@@ -32,12 +32,12 @@ extension A1 {}
extension A2 {
@objc var some: Int { return 1 }
}
@objc class A2 {}
@objc @objcMembers class A2 {}
// CHECK-LABEL: @interface A3{{$}}
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class A3 {}
@objc @objcMembers class A3 {}
// CHECK-LABEL: @interface A3 (SWIFT_EXTENSION(extensions))
// CHECK-DAG: @interface A3 (SWIFT_EXTENSION(extensions))
@@ -55,7 +55,7 @@ extension A3 {
// CHECK-LABEL: @interface A4{{$}}
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class A4 {}
@objc @objcMembers class A4 {}
// CHECK-LABEL: @interface A4 (SWIFT_EXTENSION(extensions))
// CHECK-NEXT: @end
@@ -63,13 +63,13 @@ extension A4 {
// CHECK-LABEL: @interface Inner
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class Inner {}
@objc @objcMembers class Inner {}
}
// CHECK-LABEL: @interface A5{{$}}
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class A5 {}
@objc @objcMembers class A5 {}
// NEGATIVE-NOT: @interface A5 (SWIFT_EXTENSION(extensions))
extension A5 {
@@ -80,6 +80,7 @@ extension A5 {
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc(CustomName)
@objcMembers
class ClassWithCustomName {
}

View File

@@ -1,8 +1,8 @@
// Please keep this file in alphabetical order!
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -module-name generic -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/generic.swiftmodule -typecheck -emit-objc-header-path %t/generic.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -module-name generic -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/generic.swiftmodule -typecheck -emit-objc-header-path %t/generic.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/generic.h
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/generic.h
// RUN: %check-in-clang %t/generic.h
@@ -14,7 +14,7 @@ import ObjectiveC
// CHECK-LABEL: @interface ConcreteClass
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class ConcreteClass {}
@objc @objcMembers class ConcreteClass {}
// CHECK-NOT: @interface GenericSubclass
// NEGATIVE-NOT: @interface GenericSubclass
@@ -30,7 +30,7 @@ class NonGenericSubclass : GenericSubclass<ConcreteClass> {}
// CHECK-NOT: rocky
// NEGATIVE-NOT: rocky
// CHECK-NEXT: @end
@objc class TopMoviesOfAllTime {
@objc @objcMembers class TopMoviesOfAllTime {
func rambo(c: ConcreteClass) {}
func rocky(c: NonGenericSubclass) {}
}

View File

@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -import-objc-header %S/Inputs/imported-block-typedefs.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/imported-block-typedefs.swiftmodule -typecheck -emit-objc-header-path %t/imported-block-typedefs-output.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -import-objc-header %S/Inputs/imported-block-typedefs.h -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/imported-block-typedefs.swiftmodule -typecheck -emit-objc-header-path %t/imported-block-typedefs-output.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/imported-block-typedefs-output.h
// RUN: %check-in-clang %t/imported-block-typedefs-output.h -include %S/Inputs/imported-block-typedefs.h
@@ -74,5 +74,4 @@ import ObjectiveC
@objc func resultHasEscapingParam5() -> (@escaping BlockReturningBlockWithNoescapeParam) -> () { fatalError() }
}
// CHECK-NEXT: init
// CHECK-NEXT: @end

View File

@@ -1,8 +1,8 @@
// Please keep this file in alphabetical order!
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules/ -F %S/Inputs/ -emit-module -o %t %s -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules/ -F %S/Inputs/ -parse-as-library %t/imports.swiftmodule -typecheck -emit-objc-header-path %t/imports.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules/ -F %S/Inputs/ -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules/ -F %S/Inputs/ -parse-as-library %t/imports.swiftmodule -typecheck -emit-objc-header-path %t/imports.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/imports.h
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/imports.h
// RUN: %check-in-clang %t/imports.h -I %S/Inputs/custom-modules/ -F %S/Inputs/
@@ -41,19 +41,19 @@ import MostlyPrivate1_Private
import MostlyPrivate2_Private
@objc class Test {
let word: DWORD = 0
let number: TimeInterval = 0.0
@objc let word: DWORD = 0
@objc let number: TimeInterval = 0.0
let baseI: BaseI = 0
let baseII: BaseII = 0
let baseIE: BaseIE = 0
let baseE: BaseE = 0
let baseEI: BaseEI = 0
let baseEE: BaseEE = 0
@objc let baseI: BaseI = 0
@objc let baseII: BaseII = 0
@objc let baseIE: BaseIE = 0
@objc let baseE: BaseE = 0
@objc let baseEI: BaseEI = 0
@objc let baseEE: BaseEE = 0
// Deliberately use the private type before the public type.
let mp1priv: MP1PrivateType = 0
let mp1pub: MP1PublicType = 0
@objc let mp1priv: MP1PrivateType = 0
@objc let mp1pub: MP1PublicType = 0
let mp2priv: MP2PrivateType = 0
@objc let mp2priv: MP2PrivateType = 0
}

View File

@@ -1,8 +1,8 @@
// Please keep this file in alphabetical order!
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -module-name local -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/local.swiftmodule -typecheck -emit-objc-header-path %t/local.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -module-name local -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/local.swiftmodule -typecheck -emit-objc-header-path %t/local.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/local.h
// RUN: %check-in-clang %t/local.h
@@ -13,7 +13,7 @@ import ObjectiveC
// CHECK-LABEL: @interface AFullyDefinedClass
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class AFullyDefinedClass {}
@objc @objcMembers class AFullyDefinedClass {}
class ANonObjCClass {}
@@ -65,6 +65,8 @@ class ANonObjCClass {}
@objc var j: ZForwardClass3 { return ZForwardClass3() }
@objc var k: ZForwardClass4.Type { return ZForwardClass4.self }
@objc init() {}
}
// CHECK-NOT: @class ZForwardClass1;
@@ -78,6 +80,7 @@ class ANonObjCClass {}
@objc class UseForwardAgain {
@objc func a(_ a: ZForwardClass1) {}
@objc func b(_ b: ZForwardProtocol1) {}
@objc init() {}
}
typealias ZForwardAlias = ZForwardAliasClass
@@ -91,6 +94,7 @@ typealias ZForwardAlias = ZForwardAliasClass
// CHECK-NEXT: @end
@objc class ZForwardClass1 {
@objc func circular(_ a: UseForward) {}
@objc init() {}
}
@objc class ZForwardClass2 {}
@objc class ZForwardClass3 {}

View File

@@ -1,17 +1,17 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %S/Inputs/ -module-name Mixed -import-underlying-module %s -typecheck -emit-objc-header-path %t/mixed.h -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %S/Inputs/ -module-name Mixed -import-underlying-module %s -typecheck -emit-objc-header-path %t/mixed.h
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=NO-IMPORT %s < %t/mixed.h
// RUN: %check-in-clang -F %S/Inputs/ %t/mixed.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -module-name Mixed -import-objc-header %S/Inputs/Mixed.framework/Headers/Mixed.h %s -typecheck -emit-objc-header-path %t/mixed-header.h -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -module-name Mixed -import-objc-header %S/Inputs/Mixed.framework/Headers/Mixed.h %s -typecheck -emit-objc-header-path %t/mixed-header.h
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=NO-IMPORT %s < %t/mixed-header.h
// RUN: %check-in-clang -include %S/Inputs/Mixed.framework/Headers/Mixed.h %t/mixed-header.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %S/Inputs/ -module-name Mixed -import-underlying-module %s -typecheck -emit-objc-header-path %t/mixed-proto.h -DREQUIRE -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %S/Inputs/ -module-name Mixed -import-underlying-module %s -typecheck -emit-objc-header-path %t/mixed-proto.h -DREQUIRE
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=FRAMEWORK %s < %t/mixed-proto.h
// RUN: %check-in-clang -F %S/Inputs/ %t/mixed-proto.h
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -module-name Mixed -import-objc-header %S/Inputs/Mixed.framework/Headers/Mixed.h %s -typecheck -emit-objc-header-path %t/mixed-header-proto.h -DREQUIRE -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -module-name Mixed -import-objc-header %S/Inputs/Mixed.framework/Headers/Mixed.h %s -typecheck -emit-objc-header-path %t/mixed-header-proto.h -DREQUIRE
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=HEADER %s < %t/mixed-header-proto.h
// RUN: %check-in-clang -include %S/Inputs/Mixed.framework/Headers/Mixed.h %t/mixed-header-proto.h
@@ -32,7 +32,7 @@
import Foundation
public class Dummy: NSNumber {
public func getProto() -> CustomProto? {
@objc public func getProto() -> CustomProto? {
return nil
}
}

View File

@@ -3,13 +3,13 @@
// RUN: %empty-directory(%t)
// FIXME: BEGIN -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/CoreGraphics.swift
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
// FIXME: END -enable-source-import hackaround
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -emit-module -o %t %s -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -parse-as-library %t/protocols.swiftmodule -typecheck -emit-objc-header-path %t/protocols.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -emit-module -o %t %s -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -I %t -parse-as-library %t/protocols.swiftmodule -typecheck -emit-objc-header-path %t/protocols.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/protocols.h
// RUN: %FileCheck --check-prefix=NEGATIVE %s < %t/protocols.h
// RUN: %check-in-clang %t/protocols.h
@@ -129,12 +129,12 @@ extension NSString : A, ZZZ {}
// CHECK-LABEL: @interface PrivateProtoAdopter{{$}}
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class PrivateProtoAdopter : PrivateProto {}
@objc @objcMembers class PrivateProtoAdopter : PrivateProto {}
// CHECK-LABEL: @interface PrivateProtoAdopter2 <A>
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class PrivateProtoAdopter2 : PrivateProto, A {}
@objc @objcMembers class PrivateProtoAdopter2 : PrivateProto, A {}
// CHECK-LABEL: @protocol Properties
// CHECK-NEXT: @property (nonatomic, readonly) NSInteger a;
@@ -165,7 +165,7 @@ extension NSString : A, ZZZ {}
@objc func references(someClassAndZZZ: ReferencesSomeClass2 & ZZZ)
}
@objc class ReferencesSomeClass2 {}
@objc @objcMembers class ReferencesSomeClass2 {}
// CHECK-LABEL: @protocol ReversedOrder2{{$}}