Files
swift-mirror/test/DebugInfo/byref-capture.swift
Joe Groff 13bb6c649a SIL: Remove AllocBoxInst::getElementType().
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.
2016-12-02 16:37:34 -08:00

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()