mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Right now the stdlib/overlays can compile against -Onone tests with or without -enable-ownership-stripping-after-serialization. This will help me to prevent other work going on from breaking these properties.
18 lines
820 B
Swift
18 lines
820 B
Swift
// 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 -enable-ownership-stripping-after-serialization
|
|
|
|
// 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}}
|
|
}
|