mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
There's no longer a single element type to speak of. Update uses to either iterate all box fields or to assert that they're working with a single-field box.
24 lines
853 B
Swift
24 lines
853 B
Swift
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
|
|
|
|
func makeIncrementor(_ inc : Int64) -> () -> Int64
|
|
{
|
|
var sum : Int64 = 0
|
|
// CHECK: define {{.*}}5inner
|
|
func inner() -> Int64 {
|
|
// CHECK: call void @llvm.dbg.declare(metadata %Vs5Int64**
|
|
// CHECK-SAME: metadata ![[SUM_CAPTURE:[0-9]+]],
|
|
// CHECK-SAME: metadata ![[EMPTY:.*]])
|
|
// CHECK: ![[EMPTY]] = !DIExpression()
|
|
// CHECK: ![[INOUTTY:[0-9]+]] = !DICompositeType({{.*}}identifier: "_TtRVs5Int64"
|
|
// ^ inout type.
|
|
// CHECK: ![[SUM_CAPTURE]] = !DILocalVariable(name: "sum", arg: 1,
|
|
// CHECK-SAME: line: [[@LINE-10]], type: ![[INOUTTY]]
|
|
sum += inc
|
|
return sum
|
|
}
|
|
return inner
|
|
}
|
|
|
|
var incrementor = makeIncrementor(5)
|
|
incrementor()
|