Files
swift-mirror/test/SILGen/closure_self_recursion.swift
Kavon Farvardin d2bd562799 Test: send shadow RUN lines to /dev/null
The opaque values test coverage I initially added will emit to
stdout, which is noisy for people's logs if the test is failing for
some other reason.
2026-06-30 17:40:48 -07:00

19 lines
853 B
Swift

// RUN: %target-swift-emit-silgen-ossa -o /dev/null -enable-sil-opaque-values %s
// RUN: %target-swift-emit-silgen -module-name foo %s | %FileCheck %s
// RUN: %target-swift-emit-sil -module-name foo -verify %s
// RUN: %target-swift-frontend -emit-sil -module-name foo -verify %s
// CHECK-LABEL: sil [ossa] @main
// CHECK-LABEL: sil private [ossa] @$s3foo5recuryycvgyycfU_
var recur : () -> () {
// CHECK-LABEL: function_ref @$s3foo5recuryycvg
return { recur() } // expected-warning {{attempting to access 'recur' within its own getter}}
}
// CHECK-LABEL: sil private [ossa] @$s3foo12recur_harderyyycyyXEcvgyycyyXEcfU_
var recur_harder : (() -> ()) -> (() -> ()) {
// CHECK-LABEL: function_ref @$s3foo12recur_harderyyycyyXEcvg
return { f in recur_harder(f) } // expected-warning {{attempting to access 'recur_harder' within its own getter}}
}