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
707 B
Plaintext
19 lines
707 B
Plaintext
// RUN: %target-swift-frontend -enable-objc-interop -emit-ir %s | %FileCheck %s
|
|
// REQUIRES: objc_codegen
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
|
|
// CHECK: @"\01L_selector_data(help:me:)" = private global [9 x i8] c"help:me:\00"
|
|
// CHECK: @"\01L_selector(help:me:)" = private externally_initialized global ptr @"\01L_selector_data(help:me:)"
|
|
|
|
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @objc_selector_literal() #0 {
|
|
sil @objc_selector_literal : $@convention(thin) () -> Builtin.RawPointer {
|
|
bb0:
|
|
// CHECK: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(help:me:)"
|
|
%0 = string_literal objc_selector "help:me:"
|
|
// CHECK-NEXT: ret ptr [[SEL]]
|
|
return %0 : $Builtin.RawPointer
|
|
}
|