Files
swift-mirror/test/DebugInfo/generic_arg3.swift
Adrian Prantl 3aec2c993f Debug Info: Fix the condition for detecting implicitly indirect types,
factor out the handling of implicitly indirect types
and add coverage for previouslt uncovered additional cases.

rdar://problem/23681035
2015-12-07 16:01:23 -08:00

17 lines
755 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
func apply<Type>(T : Type, fn: (Type) -> Type) -> Type { return fn(T) }
public func f<Type>(value : Type)
{
// CHECK: define {{.*}}_TFF12generic_arg31furFxT_U_FQ_Q_
// CHECK: store %swift.opaque* %1, %swift.opaque** %[[ALLOCA:.*]], align
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %[[ALLOCA]],
// CHECK-SAME: metadata ![[ARG:.*]], metadata ![[EXPR:.*]])
// No deref here: The argument is an Archetype and this implicitly indirect.
// CHECK: ![[EXPR]] = !DIExpression()
// CHECK: ![[ARG]] = !DILocalVariable(name: "arg", arg: 1,
// CHECK-SAME: line: [[@LINE+1]], type: !"_TtQq_F12generic_arg31furFxT_")
apply(value) { arg in return arg }
}