forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProtocolContainer.swift
25 lines (22 loc) · 733 Bytes
/
ProtocolContainer.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
func markUsed<T>(_ t:T){}
protocolAProtocol{
func print()
}
classAClass:AProtocol{
varx:UInt32
init(){ x =0xDEADBEEF}
func print(){markUsed("x = \(x)")}
}
// CHECK: define hidden {{.*}}void @"$s17ProtocolContainer3foo{{[_0-9a-zA-Z]*}}F"
// CHECK-NEXT: entry:
// CHECK: %[[X:.*]] = alloca %T17ProtocolContainer9AProtocolP, align {{(4|8)}}
// CHECK: #dbg_declare(ptr %[[X]], ![[XMD:.*]], !DIExpression()
// CHECK-NOT: !DILocalVariable({{.*}} name: "x"
// CHECK-NOT: !DILocalVariable({{.*}} name: "x"
func foo (_ x :AProtocol){
varx= x
x.print() // Set breakpoint here
}
varaProtocol:AProtocol=AClass()
foo(aProtocol)