Files
swift-mirror/test/DebugInfo/alloc_stack_arg.swift
Adrian Prantl 81f9ea33be SILGen: Preserve function argument debug info for arguments needing alloc_stack
This fixes a logic error in the existing code that cause these
function arguments to appear twice, once as local variable and once as
formal parameter.

rdar://problem/37410759
2018-08-31 10:35:52 -07:00

11 lines
329 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
public func snd<T, U>(_ t : (T, U)) -> U {
let (_, y) = t
return y
}
// Test that the alloc_stack's argument number is preserved.
// CHECK-NOT: !DILocalVariable(name: "t"
// CHECK: !DILocalVariable(name: "t", arg: 1
// CHECK-NOT: !DILocalVariable(name: "t"