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.
18 lines
494 B
Swift
18 lines
494 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop %s -emit-ir -disable-objc-attr-requires-foundation-module -use-jit | %FileCheck %s
|
|
// REQUIRES: objc_codegen
|
|
|
|
import Foundation
|
|
import objc_generics
|
|
|
|
extension NSString {
|
|
func fn() {}
|
|
}
|
|
|
|
extension GenericClass {
|
|
@objc func fn() {}
|
|
}
|
|
|
|
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} private void @runtime_registration
|
|
// CHECK-NOT: @__swift_instantiateConcreteTypeFromMangledName
|
|
// CHECK: ret void
|