Files
swift-mirror/test/Concurrency/objc_async_protocol_irgen.swift
Arnold Schwaighofer f8d009e05f IRGen: Default to weak hidden instead of internal linkage for objc metadata
This extends #39944 to apply to more objc metadata.

rdar://85037490
2021-12-02 12:56:50 -08:00

16 lines
698 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -import-objc-header %S/Inputs/Delegate.h %s -emit-ir -o - | %FileCheck %s -DALIGNMENT=%target-alignment
// REQUIRES: concurrency
// REQUIRES: objc_interop
let anyObject: AnyObject = (MyAsyncProtocol.self as AnyObject) // or something like this
// rdar://76192003
// Make sure we don't emit 2 copies of methods, due to a completion-handler
// version and another due to an async based version.
// CHECK-LABEL: @_PROTOCOL_INSTANCE_METHODS_MyAsyncProtocol = weak hidden constant
// CHECK-SAME: selector_data(myAsyncMethod:)
// CHECK-NOT: selector_data(myAsyncMethod:)
// CHECK-SAME: align [[ALIGNMENT]]