Files
swift-mirror/test/IRGen/objc_block.sil
Anthony Latsis 17fc00f8a7 [test] IRGen: Adjust FileCheck patterns for new nuw attribute in upstream LLVM
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.
2025-05-04 03:28:56 +01:00

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: }