mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In preparation for changing the default, explicitly specify the behavior of all tests that are affected by the choice of behavior for lexical lifetimes and copy-propagation.
20 lines
759 B
Swift
20 lines
759 B
Swift
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -enable-lexical-lifetimes=false %s -emit-ir -g -o - | %FileCheck %s
|
|
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -enable-lexical-lifetimes=false %s -emit-sil -g -o - | %FileCheck -check-prefix=CHECK-SIL %s
|
|
import StdlibUnittest
|
|
|
|
// Test that debug info for local variables is preserved by the
|
|
// mandatory SIL optimization passes.
|
|
|
|
func main() {
|
|
// CHECK-SIL-DAG: debug_value {{.*}}: $Int, let, name "x"
|
|
// CHECK-DAG: DILocalVariable(name: "x"
|
|
let x = 10
|
|
// CHECK-SIL-DAG: alloc_stack $Int, var, name "y"
|
|
// CHECK-DAG: DILocalVariable(name: "y"
|
|
var y = 10
|
|
// The expression x+y may become constant folded.
|
|
_blackHole(x+y)
|
|
}
|
|
|
|
main()
|