mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This mandatory pass inserts struct_extract operations before earlier
stores to the aggregate but didn't set the debug location of those new
instructions to the location of the store, which caused unexpected
stepping behavior in the debugger.
Fixes a regression from e74367f2b3.
<rdar://problem/35459092>
23 lines
696 B
Swift
23 lines
696 B
Swift
// RUN: %target-swift-frontend -emit-sil -Xllvm -sil-print-debuginfo %s \
|
|
// RUN: | %FileCheck %s
|
|
|
|
struct MyStruct {
|
|
var a = 12
|
|
}
|
|
|
|
public func use<T>(_ t : T){}
|
|
|
|
public func main() {
|
|
var a = MyStruct() // line 11
|
|
// Verify that the inserted struct_extract has the same location as the store.
|
|
// CHECK: %[[A:.*]] = apply {{.*}} -> MyStruct,
|
|
// CHECK-SAME: loc {{.*}}:11:10, scope [[S:[0-9]+]]
|
|
// CHECK-NEXT: %[[I:.*]] = struct_extract %[[A]]
|
|
// CHECK-SAME: loc {{.*}}:11:10, scope [[S]]
|
|
// CHECK-NEXT: struct_extract %[[I]]
|
|
// CHECK-SAME: loc {{.*}}:11:10, scope [[S]]
|
|
// CHECK: store %[[A]] to %0 : $*MyStruct,
|
|
// CHECK-SAME: loc {{.*}}:11:10, scope [[S]]
|
|
use(a.a)
|
|
}
|