mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Clang does not accept `-x objective-c` with WebAssembly target and it crashes with "Objective-C support is unimplemented for object file format" for now. `-enable-objc-interop` can work without the objc runtime support (which is indicated by `objc_interop` feature), so this adds a new `objc_codegen` feature to require Objective-C support only at compile-time.
19 lines
704 B
Swift
19 lines
704 B
Swift
// RUN: %target-swift-frontend -enable-objc-interop -I %S/../Inputs/custom-modules %s -emit-ir | %FileCheck %s
|
|
// REQUIRES: objc_codegen
|
|
|
|
import ObjCRuntimeVisible
|
|
|
|
protocol MyProtocol {}
|
|
protocol YourProtocol {}
|
|
|
|
extension A : MyProtocol {}
|
|
extension A : YourProtocol {}
|
|
|
|
// CHECK-LABEL: @"$sSo1AC32objc_runtime_visible_conformance10MyProtocolACMc"
|
|
// CHECK-SAME: @"$s32objc_runtime_visible_conformance10MyProtocolMp"
|
|
// CHECK-SAME: @.str.21.MyRuntimeVisibleClass
|
|
// CHECK-SAME: @"$sSo1AC32objc_runtime_visible_conformance10MyProtocolACWP"
|
|
// DirectObjCClassName
|
|
// CHECK-SAME: i32 16
|
|
// CHECK: @.str.21.MyRuntimeVisibleClass = private constant [22 x i8] c"MyRuntimeVisibleClass\00"
|