Files
swift-mirror/test/DebugInfo/guard-let-scope4.swift
Mykola Pokhylets 04166e21c9 Fixed some tests
Remaining failures:

SILGen/unowned-class-bound-generic-parameter.swift
2025-05-19 17:03:59 +02:00

20 lines
861 B
Swift

// RUN: %target-swift-frontend -g -Xllvm -sil-print-types -emit-sil %s -parse-as-library -module-name a | %FileCheck %s
open class C {
public func fun() {}
public func run() {
{ [weak self] in
guard let self else { fatalError("cannot happen") }
// CHECK: sil_scope [[LAMBDA:[0-9]+]] { loc "{{.*}}":6:5
// CHECK: sil_scope [[BODY:[0-9]+]] { loc "{{.*}}":6:19 parent [[LAMBDA]]
// CHECK: sil_scope [[LET:[0-9]+]] { loc "{{.*}}":7:7 parent [[BODY]]
// CHECK: sil_scope [[TMP:[0-9]+]] { loc "{{.*}}":7:17 parent [[LET]]
// CHECK: sil_scope [[GUARD:[0-9]+]] { loc "{{.*}}":7:17 parent [[LET]]
// CHECK: debug_value {{.*}} : $C, let, name "self", {{.*}}, scope [[GUARD]]
// CHECK: function_ref {{.*}}3fun{{.*}}, scope [[GUARD]]
// CHECK-NEXT: apply {{.*}}, scope [[GUARD]]
self.fun()
}()
}
}