Skip to content

Commit 79b0a7c

Browse files
Merge pull request #76739 from nate-chandler/rdar136388508_2
[Test] Added regression test.
2 parents fe796b4 + 03e1018 commit 79b0a7c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %target-swiftc_driver -c -O %s
2+
3+
// This used to crash during LargeTypesReg2Mem.
4+
5+
class C {}
6+
struct Big {
7+
let c: C
8+
let x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20: Int
9+
@_silgen_name("Big.init")
10+
init(_ bool: Bool)
11+
}
12+
13+
@_silgen_name("summon")
14+
func summon<Entity>() throws -> Entity
15+
@_silgen_name("banish")
16+
func banish<Entity>(_ t: Entity)
17+
18+
func doit() {
19+
let big: Big
20+
do {
21+
big = Big(try summon())
22+
23+
banish(try summon() as Bool)
24+
} catch {
25+
_ = "\(error)"
26+
}
27+
}

0 commit comments

Comments
 (0)