Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -2093,9 +2093,6 @@ ERROR(cdecl_throws,none,
ERROR(cdecl_incompatible_with_objc,none,
"cannot apply both '@c' and '@objc' to %kindonly0",
(const Decl *))
ERROR(cdecl_feature_required,none,
"'@c' requires '-enable-experimental-feature CDecl'",
())

// @_used and @_section
ERROR(section_linkage_markers_disabled,none,
Expand Down
8 changes: 2 additions & 6 deletions include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ LANGUAGE_FEATURE(InlineArrayTypeSugar, 483, "Type sugar for InlineArray")
LANGUAGE_FEATURE(LifetimeDependenceMutableAccessors, 0, "Support mutable accessors returning ~Escapable results")
LANGUAGE_FEATURE(InoutLifetimeDependence, 0, "Support @_lifetime(&)")
SUPPRESSIBLE_LANGUAGE_FEATURE(NonexhaustiveAttribute, 487, "Nonexhaustive Enums")
LANGUAGE_FEATURE(CDecl, 495, "C compatible functions and enums with @c")
LANGUAGE_FEATURE(CImplementation, 495, "C compatible functions and enums with @c")
Comment on lines +279 to +280
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these two language features entirely? One can use #if hasAttribute(c) to detect the availability of this feature, we don't need anything more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the CDecl one for the backwards compatibility of swiftinterfaces? That check wouldn't be perfect either since the attribute name changed but not the feature name.


// Swift 6
UPCOMING_FEATURE(ConciseMagicFile, 274, 6)
Expand Down Expand Up @@ -469,9 +471,6 @@ EXPERIMENTAL_FEATURE(ClosureIsolation, true)
// staging purposes.
EXPERIMENTAL_FEATURE(ObjCImplementationWithResilientStorage, true)

// Enable @implementation on @_cdecl functions.
EXPERIMENTAL_FEATURE(CImplementation, true)

// Enable @sensitive attribute.
EXPERIMENTAL_FEATURE(Sensitive, true)

Expand Down Expand Up @@ -530,9 +529,6 @@ EXPERIMENTAL_FEATURE(ClosureBodyMacro, true)
/// Allow declarations of Swift runtime symbols using @_silgen_name.
EXPERIMENTAL_FEATURE(AllowRuntimeSymbolDeclarations, true)

/// Allow use of `@c`
EXPERIMENTAL_FEATURE(CDecl, false)

/// Allow use of `Module::name` syntax
EXPERIMENTAL_FEATURE(ModuleSelector, false)

Expand Down
9 changes: 1 addition & 8 deletions lib/Parse/ParseDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3027,14 +3027,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
}

case DeclAttrKind::CDecl: {
if (!AttrName.starts_with("_") &&

// Backwards support for @c("stringId"). Remove before enabling in
// production so we accept only the identifier format.
lookahead(1, [&](CancellableBacktrackingScope &) {
return Tok.isNot(tok::string_literal);
})) {

if (AttrName == "c") {
std::optional<StringRef> CName;
if (consumeIfAttributeLParen()) {
// Custom C name.
Expand Down
6 changes: 0 additions & 6 deletions lib/Sema/TypeCheckAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2462,12 +2462,6 @@ void AttributeChecker::visitCDeclAttr(CDeclAttr *attr) {
if (D->getAttrs().getAttribute<ObjCAttr>()) {
diagnose(attr->getLocation(), diag::cdecl_incompatible_with_objc, D);
}

// @c needs to be enabled via a feature flag.
if (!attr->Underscored &&
!Ctx.LangOpts.hasFeature(Feature::CDecl)) {
diagnose(attr->getLocation(), diag::cdecl_feature_required);
}
}

void AttributeChecker::visitExposeAttr(ExposeAttr *attr) {
Expand Down
5 changes: 0 additions & 5 deletions lib/Sema/TypeCheckDeclObjC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4197,11 +4197,6 @@ class ObjCImplementationChecker {
!decl->getASTContext().LangOpts.hasFeature(Feature::CImplementation))
return;

// Only encourage @_objcImplementation *extension* adopters to adopt
// @implementation; @_objcImplementation @_cdecl hasn't been stabilized yet.
if (!isa<ExtensionDecl>(decl))
return;

auto diag = diagnose(getAttr()->getLocation(),
diag::objc_implementation_early_spelling_deprecated);
diag.fixItReplace(getAttr()->getRangeWithAt(), "@implementation");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public struct Strct {
public let transform2: ns.anonStructInNS
}

// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK-NEXT: #if __has_warning("-Watimport-in-framework-header")
Expand Down
2 changes: 1 addition & 1 deletion test/Parse/objc_enum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum NonObjCEnum: Int {

class Bar {
@objc func foo(x: Foo) {}
@objc func nonObjC(x: NonObjCEnum) {} //expected-error{{type of the parameter cannot be represented in Objective-C}} //expected-note{{non-'@objc' enums cannot be represented in Objective-C}}
@objc func nonObjC(x: NonObjCEnum) {} //expected-error{{type of the parameter cannot be represented in Objective-C}} //expected-note{{Swift enums not marked '@c' or '@objc' cannot be represented in Objective-C}}
}

// <rdar://problem/23681566> @objc enums with payloads rejected with no source location info
Expand Down
4 changes: 2 additions & 2 deletions test/PrintAsObjC/cdecl-enum-reference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
// REQUIRES: swift_feature_CDecl

//--- CoreLib.swift
@c("CEnum")
@c(CEnum)
public enum CEnum: CInt { case A, B }

//--- MiddleLib.swift
import CoreLib

@c("CFunc")
@c(CFunc)
public func CFunc(e: CEnum) {}
// CHECK: typedef SWIFT_ENUM_FWD_DECL(int, CEnum)
// CHECK: SWIFT_EXTERN void CFunc(SWIFT_ENUM_TAG CEnum e) SWIFT_NOEXCEPT;
Expand Down
20 changes: 10 additions & 10 deletions test/PrintAsObjC/cdecl-enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import Foundation
// CHECK-NEXT: }

/// Foo: A feer, a female feer.
@c("FooComments") public enum FooComments: CInt {
@c(FooComments) public enum FooComments: CInt {
/// Zim: A zeer, a female zeer.
case Zim
case Zang, Zung
Expand All @@ -67,7 +67,7 @@ import Foundation
// CHECK-NEXT: Zang = -219,
// CHECK-NEXT: Zung = -218,
// CHECK-NEXT: };
@c("NegativeValues") enum NegativeValues: Int16 {
@c(NegativeValues) enum NegativeValues: Int16 {
case Zang = -219, Zung

func methodNotExportedToC() {}
Expand All @@ -77,40 +77,40 @@ import Foundation
// CHECK-NEXT: SomeErrorBadness = 9001,
// CHECK-NEXT: SomeErrorWorseness = 9002,
// CHECK-NEXT: };
@c("SomeError") enum SomeError: Int, Error {
@c(SomeError) enum SomeError: Int, Error {
case Badness = 9001
case Worseness
}

// CHECK-LABEL: typedef SWIFT_ENUM_NAMED(ptrdiff_t, SomeOtherError, "SomeOtherError", closed) {
// CHECK-NEXT: SomeOtherErrorDomain = 0,
// CHECK-NEXT: };
@c("SomeOtherError") enum SomeOtherError: Int, Error {
@c(SomeOtherError) enum SomeOtherError: Int, Error {
case Domain
}

// CHECK-LABEL: typedef SWIFT_ENUM_NAMED(ptrdiff_t, ObjcErrorType, "SomeRenamedErrorType", closed) {
// CHECK-NEXT: ObjcErrorTypeBadStuff = 0,
// CHECK-NEXT: };
@c("ObjcErrorType") enum SomeRenamedErrorType: Int, Error {
@c(ObjcErrorType) enum SomeRenamedErrorType: Int, Error {
case BadStuff
}

@c("acceptMemberImported") func acceptMemberImported(a: Wrapper.Raw, b: Wrapper.Enum, c: Wrapper.Options, d: Wrapper.Typedef, e: Wrapper.Anon, ee: Wrapper.Anon2) {}
@c(acceptMemberImported) func acceptMemberImported(a: Wrapper.Raw, b: Wrapper.Enum, c: Wrapper.Options, d: Wrapper.Typedef, e: Wrapper.Anon, ee: Wrapper.Anon2) {}
// CHECK-LABEL: SWIFT_EXTERN void acceptMemberImported(enum MemberRaw a, enum MemberEnum b, MemberOptions c, enum MemberTypedef d, MemberAnon e, MemberAnon2 ee) SWIFT_NOEXCEPT;

@c("acceptPlainEnum") func acceptPlainEnum(_: NSMalformedEnumMissingTypedef) {}
@c(acceptPlainEnum) func acceptPlainEnum(_: NSMalformedEnumMissingTypedef) {}
// CHECK-LABEL: SWIFT_EXTERN void acceptPlainEnum(enum NSMalformedEnumMissingTypedef) SWIFT_NOEXCEPT;

@c("acceptTopLevelImported") func acceptTopLevelImported(a: TopLevelRaw, b: TopLevelEnum, c: TopLevelOptions, d: TopLevelTypedef, e: TopLevelAnon) {}
@c(acceptTopLevelImported) func acceptTopLevelImported(a: TopLevelRaw, b: TopLevelEnum, c: TopLevelOptions, d: TopLevelTypedef, e: TopLevelAnon) {}
// CHECK-LABEL: SWIFT_EXTERN void acceptTopLevelImported(enum TopLevelRaw a, TopLevelEnum b, TopLevelOptions c, TopLevelTypedef d, TopLevelAnon e) SWIFT_NOEXCEPT;

@c("takeAndReturnEnumC") func takeAndReturnEnumC(_ foo: FooComments) -> NegativeValues {
@c(takeAndReturnEnumC) func takeAndReturnEnumC(_ foo: FooComments) -> NegativeValues {
return .Zung
}
// CHECK-LABEL: SWIFT_EXTERN SWIFT_ENUM_TAG NegativeValues takeAndReturnEnumC(SWIFT_ENUM_TAG FooComments foo) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

@c("takeAndReturnRenamedEnum") func takeAndReturnRenamedEnum(_ foo: EnumNamed) -> EnumNamed {
@c(takeAndReturnRenamedEnum) func takeAndReturnRenamedEnum(_ foo: EnumNamed) -> EnumNamed {
return .A
}
// CHECK-LABEL: SWIFT_EXTERN SWIFT_ENUM_TAG ObjcEnumNamed takeAndReturnRenamedEnum(SWIFT_ENUM_TAG ObjcEnumNamed foo) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;
Expand Down
4 changes: 2 additions & 2 deletions test/PrintAsObjC/cdecl-includes-with-objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ import Foundation
// CHECK: extern "C" {
// CHECK: #endif

@c("get_int_alias")
@c(get_int_alias)
public func getIntAlias() -> IntFromCFramework { 42 }
// CHECK: SWIFT_EXTERN IntFromCFramework get_int_alias(void) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

@c("imports_cgpoint")
@c(imports_cgpoint)
public func importsCGPoint(pt: CGPoint) { }
// CHECK: SWIFT_EXTERN void imports_cgpoint(CGPoint pt) SWIFT_NOEXCEPT;

Expand Down
6 changes: 3 additions & 3 deletions test/PrintAsObjC/cdecl-includes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ import CModule
// CHECK: extern "C" {
// CHECK: #endif

@c("mirror_struct")
@c(mirror_struct)
public func a_mirrorStruct(_ a: CStruct) -> CStruct { a }
// CHECK: SWIFT_EXTERN struct CStruct mirror_struct(struct CStruct a) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

@c("mirror_union")
@c(mirror_union)
public func b_mirrorStruct(_ a: CUnion) -> CUnion { a }
// CHECK: SWIFT_EXTERN union CUnion mirror_union(union CUnion a) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;


@c("TKGetDefaultToastSetting")
@c(TKGetDefaultToastSetting)
public func c_defaultToastSetting() -> TKTimeSetting { TKTimeSettingNormal } // It would be nice to import TKTimeSettingNormal as a member.
// CHECK: SWIFT_EXTERN TKTimeSetting TKGetDefaultToastSetting(void) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

Expand Down
20 changes: 10 additions & 10 deletions test/PrintAsObjC/cdecl-official.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,30 @@ func a0_simple(x: Int, bar y: Int) -> Int { return x }
func a1_defaultName(x: Int) -> Int { return x }
// CHECK-LABEL: SWIFT_EXTERN ptrdiff_t a1_defaultName(ptrdiff_t x) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

@c("primitiveTypes")
@c(primitiveTypes)
public func b_primitiveTypes(i: Int, ci: CInt, l: CLong, c: CChar, f: Float, d: Double, b: Bool) {}
// CHECK-LABEL: SWIFT_EXTERN void primitiveTypes(ptrdiff_t i, int ci, long l, char c, float f, double d, bool b) SWIFT_NOEXCEPT;

@c("has_keyword_arg_names")
@c(has_keyword_arg_names)
func c_keywordArgNames(auto: Int, union: Int) {}
// CHECK-LABEL: SWIFT_EXTERN void has_keyword_arg_names(ptrdiff_t auto_, ptrdiff_t union_) SWIFT_NOEXCEPT;

@c("return_never")
@c(return_never)
func d_returnNever() -> Never { fatalError() }
// CHECK-LABEL: SWIFT_EXTERN void return_never(void) SWIFT_NOEXCEPT SWIFT_NORETURN;

/// Pointer types
// CHECK: /// Pointer types

@c("pointers")
@c(pointers)
func f_pointers(_ x: UnsafeMutablePointer<Int>,
y: UnsafePointer<Int>,
z: UnsafeMutableRawPointer,
w: UnsafeRawPointer,
u: OpaquePointer) {}
// CHECK: SWIFT_EXTERN void pointers(ptrdiff_t * _Nonnull x, ptrdiff_t const * _Nonnull y, void * _Nonnull z, void const * _Nonnull w, void * _Nonnull u) SWIFT_NOEXCEPT;

@c("nullable_pointers")
@c(nullable_pointers)
func g_nullablePointers(_ x: UnsafeMutableRawPointer,
y: UnsafeMutableRawPointer?,
z: UnsafeMutableRawPointer!) {}
Expand All @@ -87,23 +87,23 @@ func g_nullablePointers(_ x: UnsafeMutableRawPointer,
@c
enum CEnum: CInt { case A, B }

@c("CEnumRenamed_CName")
@c(CEnumRenamed_CName)
enum CEnumRenamed: CLong { case A, B }

@c("use_enum")
@c(use_enum)
func h_useCEnum(e: CEnum) -> CEnum { return e }
// CHECK: SWIFT_EXTERN SWIFT_ENUM_TAG CEnum use_enum(SWIFT_ENUM_TAG CEnum e) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

@c("use_enum_renamed")
@c(use_enum_renamed)
func i_useCEnumLong(e: CEnumRenamed) -> CEnumRenamed { return e }
// CHECK: SWIFT_EXTERN SWIFT_ENUM_TAG CEnumRenamed_CName use_enum_renamed(SWIFT_ENUM_TAG CEnumRenamed_CName e) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

@c("use_enum_late")
@c(use_enum_late)
func j_useCEnumChar(e: zCEnumDefinedLate) -> zCEnumDefinedLate { return e }
// CHECK: SWIFT_EXTERN SWIFT_ENUM_TAG zCEnumDefinedLate use_enum_late(SWIFT_ENUM_TAG zCEnumDefinedLate e) SWIFT_NOEXCEPT SWIFT_WARN_UNUSED_RESULT;

/// Declare this enum late in the source file and in alphabetical order.
@c("zCEnumDefinedLate")
@c(zCEnumDefinedLate)
enum zCEnumDefinedLate: CChar { case A, B }

// CHECK: #if defined(__cplusplus)
Expand Down
2 changes: 1 addition & 1 deletion test/PrintAsObjC/cdecl-with-objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// REQUIRES: swift_feature_CDecl
// REQUIRES: objc_interop

@c("cFunc")
@c(cFunc)
func cFunc() { }
// CHECK: cFunc
// CHECK-NOT: cFunc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class HelloWorld: NSObject {
}
}

// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK-NEXT: #if __has_warning("-Watimport-in-framework-header")
// CHECK-NEXT: #pragma clang diagnostic ignored "-Watimport-in-framework-header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import EmitClangHeaderNonmodularIncludesStressTest

public class Bar : Baz {}

// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK-NEXT: #if __has_warning("-Watimport-in-framework-header")
// CHECK-NEXT: #pragma clang diagnostic ignored "-Watimport-in-framework-header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import EmitClangHeaderNonmodularIncludesStressTest

public class Bar : Baz {}

// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK-NEXT: #if __has_warning("-Watimport-in-framework-header")
// CHECK-NEXT: #pragma clang diagnostic ignored "-Watimport-in-framework-header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import EmitClangHeaderNonmodularIncludesStressTest
public class Bar : Foo {}


// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK-NEXT: #if __has_warning("-Watimport-in-framework-header")
// CHECK-NEXT: #pragma clang diagnostic ignored "-Watimport-in-framework-header"
Expand Down
7 changes: 7 additions & 0 deletions test/PrintAsObjC/empty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
// CHECK-NEXT: #endif
// CHECK-NEXT: #endif

// CHECK: #if defined(__cplusplus)
// CHECK-NEXT: extern "C" {
// CHECK-NEXT: #endif

// CHECK: #if defined(__cplusplus)
// CHECK-NEXT: } // extern "C"
// CHECK-NEXT: #endif

// CHECK-NOT: {{[@;{}]}}

Expand Down
18 changes: 9 additions & 9 deletions test/PrintAsObjC/enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-source-import -emit-module -emit-module-doc -o %t %s -import-objc-header %S/Inputs/enums.h -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/enums.swiftmodule -typecheck -verify -emit-objc-header-path %t/enums.h -import-objc-header %S/Inputs/enums.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/enums.h
// RUN: %FileCheck %s -input-file %t/enums.h
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/enums.h
// RUN: %check-in-clang %t/enums.h
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/enums.h -include ctypes.h -include CoreFoundation.h

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-source-import -emit-module -o /dev/null -emit-module-doc-path /dev/null -module-name enums %s -emit-objc-header-path %t/enums.WMO.h -import-objc-header %S/Inputs/enums.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/enums.WMO.h
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/enums.WMO.h
// RUN: %FileCheck %s -input-file %t/enums.WMO.h
// RUN: %FileCheck -check-prefix=NEGATIVE %s -input-file %t/enums.WMO.h
// RUN: %check-in-clang %t/enums.WMO.h
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/enums.WMO.h -include ctypes.h -include CoreFoundation.h

Expand All @@ -18,20 +18,20 @@

// RUN: echo "{\"%s\": {\"objc-header\": \"%t/enums-supplemental.h\"}}" > %t-output-file-map.json
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %s -enable-source-import -typecheck -verify -supplementary-output-file-map %t-output-file-map.json -import-objc-header %S/Inputs/enums.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck -check-prefix CHECK-SUPPLEMENTAL %s < %t/enums-supplemental.h
// RUN: %FileCheck -check-prefix CHECK-SUPPLEMENTAL %s -input-file %t/enums-supplemental.h

// REQUIRES: objc_interop

import Foundation

// NEGATIVE-NOT: NSMalformedEnumMissingTypedef :
// NEGATIVE-NOT: enum EnumNamed
// CHECK-LABEL: enum FooComments : NSInteger;
// CHECK-LABEL: enum NegativeValues : int16_t;
// CHECK-LABEL: enum ObjcEnumNamed : NSInteger;
// CHECK-LABEL: typedef SWIFT_ENUM_FWD_DECL(NSInteger, FooComments)
// CHECK-LABEL: typedef SWIFT_ENUM_FWD_DECL(int16_t, NegativeValues)
// CHECK-LABEL: typedef SWIFT_ENUM_FWD_DECL(NSInteger, ObjcEnumNamed)

// CHECK-SUPPLEMENTAL: enum NegativeValues : int16_t;
// CHECK-SUPPLEMENTAL: enum ObjcEnumNamed : NSInteger;
// CHECK-SUPPLEMENTAL: typedef SWIFT_ENUM_FWD_DECL(int16_t, NegativeValues)
// CHECK-SUPPLEMENTAL: typedef SWIFT_ENUM_FWD_DECL(NSInteger, ObjcEnumNamed)

// CHECK-LABEL: @interface AnEnumMethod
// CHECK-NEXT: - (enum NegativeValues)takeAndReturnEnum:(enum FooComments)foo SWIFT_WARN_UNUSED_RESULT;
Expand Down
3 changes: 2 additions & 1 deletion test/PrintAsObjC/mixed-framework-fwd.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

// REQUIRES: objc_interop

// CHECK-LABEL: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK-NEXT: #if __has_warning
// CHECK-NEXT: #pragma clang diagnostic
// CHECK-NEXT: #endif
Expand Down
3 changes: 2 additions & 1 deletion test/PrintAsObjC/mixed-framework.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

// CHECK: #pragma clang diagnostic push

// CHECK-LABEL: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK: #if __has_feature(objc_modules)
// CHECK-NEXT: #if __has_warning("-Watimport-in-framework-header")
// CHECK-NEXT: #pragma clang diagnostic ignored "-Watimport-in-framework-header"
// CHECK-NEXT: #endif
Expand Down
Loading