Revision ac4b68fbf45853ba4b9e327cb42f93f42a8fa252 authored by Ellie Shin on 17 March 2023, 04:14:20 UTC, committed by Ellie Shin on 17 March 2023, 04:14:20 UTC
1 parent f2c68fb
Raw File
capturelist.swift
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
class C {
  func withClosure(_ : () -> ()) -> () {}

  func f() {
    // CHECK-LABEL: define{{.*}}$s11capturelist1CC1fyyFyyXEfU_
    // There should not be a local weak variable "self" shadowing the
    // implicit self argument.
    // let self
    // CHECK: call void @llvm.dbg
    // let s
    // CHECK: call void @llvm.dbg
    // var weak self
    // CHECK-NOT: call void @llvm.dbg
    // CHECK-LABEL: ret void
    withClosure { [weak self] in
      guard let s = self else { return }
    }
  }
}
back to top