mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This attribute was introduced in 7eca38ce76d5d1915f4ab7e665964062c0b37697 (llvm-project). Match it using a wildcard regex, since it is not relevant to these tests. This is intended to reduce future conflicts with rebranch.
24 lines
777 B
Plaintext
24 lines
777 B
Plaintext
// RUN: %target-swift-frontend %s -emit-ir | %FileCheck %s
|
|
|
|
sil_stage canonical
|
|
|
|
import Swift
|
|
|
|
class Foo {}
|
|
sil_vtable Foo {}
|
|
|
|
sil @$s10objc_block3FooCfD : $(Foo) -> ()
|
|
|
|
sil @call_block : $@convention(thin) (@convention(block) (Foo) -> Foo, Foo) -> Foo {
|
|
entry(%b : $@convention(block) (Foo) -> Foo, %x : $Foo):
|
|
%y = apply %b(%x) : $@convention(block) (Foo) -> Foo
|
|
return %y : $Foo
|
|
}
|
|
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @call_block(ptr %0, ptr %1) {{.*}} {
|
|
// CHECK: entry:
|
|
// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr %0, i32 0, i32 3
|
|
// CHECK: [[T1:%.*]] = load ptr, ptr [[T0]]
|
|
// CHECK: [[T4:%.*]] = call ptr [[T1]](ptr %0, ptr %1)
|
|
// CHECK: ret ptr [[T4]]
|
|
// CHECK: }
|