Skip to content

Commit f96104d

Browse files
committed
[Test] Duplicate test/TypeDecoder/existentials.swift with explicit
existential types enabled.
1 parent 8db129b commit f96104d

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-build-swift -Xfrontend -enable-explicit-existential-types -emit-executable %s -g -o %t/existentials -emit-module
4+
// RUN: sed -ne '/\/\/ *DEMANGLE: /s/\/\/ *DEMANGLE: *//p' < %s > %t/input
5+
// RUN: %lldb-moduleimport-test %t/existentials -type-from-mangled=%t/input | %FileCheck %s
6+
7+
func blackHole(_: Any...) {}
8+
9+
protocol P {}
10+
protocol Q {}
11+
class C {}
12+
13+
class D : C, P, Q {}
14+
15+
do {
16+
let e0: Any = D()
17+
let e1: AnyObject = D()
18+
19+
let e2: P = D()
20+
let e4: P & C = D()
21+
let e3: P & AnyObject = D()
22+
23+
let e5: P & Q = D()
24+
let e6: P & Q & C = D()
25+
let e7: P & Q & AnyObject = D()
26+
27+
blackHole(e0, e1, e2, e3, e4, e5, e6, e7)
28+
}
29+
30+
do {
31+
let e0: Any.Type = D.self
32+
let e1: AnyObject.Type = D.self
33+
34+
let e2: P.Type = D.self
35+
let e4: (P & C).Type = D.self
36+
let e3: (P & AnyObject).Type = D.self
37+
38+
let e5: (P & Q).Type = D.self
39+
let e6: (P & Q & C).Type = D.self
40+
let e7: (P & Q & AnyObject).Type = D.self
41+
42+
blackHole(e0, e1, e2, e3, e4, e5, e6, e7)
43+
}
44+
45+
do {
46+
let e0: Any.Protocol = Any.self
47+
let e1: AnyObject.Protocol = AnyObject.self
48+
49+
let e2: P.Protocol = P.self
50+
let e4: (P & C).Protocol = (P & C).self
51+
let e3: (P & AnyObject).Protocol = (P & AnyObject).self
52+
53+
let e5: (P & Q).Protocol = (P & Q).self
54+
let e6: (P & Q & C).Protocol = (P & Q & C).self
55+
let e7: (P & Q & AnyObject).Protocol = (P & Q & AnyObject).self
56+
57+
blackHole(e0, e1, e2, e3, e4, e5, e6, e7)
58+
}
59+
60+
// DEMANGLE: $sypD
61+
// DEMANGLE: $syXlD
62+
// DEMANGLE: $s12existentials1P_pD
63+
// DEMANGLE: $s12existentials1P_AA1CCXcD
64+
// DEMANGLE: $s12existentials1P_XlD
65+
// DEMANGLE: $s12existentials1P_AA1QpD
66+
// DEMANGLE: $s12existentials1P_AA1QAA1CCXcD
67+
// DEMANGLE: $s12existentials1P_AA1QXlD
68+
69+
// CHECK: Any
70+
// CHECK: AnyObject
71+
// CHECK: P
72+
// CHECK: C & P
73+
// CHECK: P & AnyObject
74+
// CHECK: P & Q
75+
// CHECK: C & P & Q
76+
// CHECK: P & Q & AnyObject
77+
78+
// DEMANGLE: $sypXpD
79+
// DEMANGLE: $syXlXpD
80+
// DEMANGLE: $s12existentials1P_pXpD
81+
// DEMANGLE: $s12existentials1P_XlXpD
82+
// DEMANGLE: $s12existentials1P_AA1CCXcXpD
83+
// DEMANGLE: $s12existentials1P_AA1QpXpD
84+
// DEMANGLE: $s12existentials1P_AA1QAA1CCXcXpD
85+
// DEMANGLE: $s12existentials1P_AA1QXlXpD
86+
87+
// CHECK: Any.Type
88+
// CHECK: AnyObject.Type
89+
// CHECK: P.Type
90+
// CHECK: (P & AnyObject).Type
91+
// CHECK: (C & P).Type
92+
// CHECK: (P & Q).Type
93+
// CHECK: (C & P & Q).Type
94+
// CHECK: (P & Q & AnyObject).Type
95+
96+
// DEMANGLE: $sypmD
97+
// DEMANGLE: $syXlmD
98+
// DEMANGLE: $s12existentials1P_pmD
99+
// DEMANGLE: $s12existentials1P_AA1CCXcmD
100+
// DEMANGLE: $s12existentials1P_XlmD
101+
// DEMANGLE: $s12existentials1P_AA1QpmD
102+
// DEMANGLE: $s12existentials1P_AA1QAA1CCXcmD
103+
// DEMANGLE: $s12existentials1P_AA1QXlmD
104+
105+
// CHECK: Any.Protocol
106+
// CHECK: AnyObject.Protocol
107+
// CHECK: P.Protocol
108+
// CHECK: (C & P).Protocol
109+
// CHECK: (P & AnyObject).Protocol
110+
// CHECK: (P & Q).Protocol
111+
// CHECK: (C & P & Q).Protocol
112+
// CHECK: (P & Q & AnyObject).Protocol

0 commit comments

Comments
 (0)