Skip to content

Commit 6495bc3

Browse files
committed
Add a test case from SR-6860
1 parent aa76808 commit 6495bc3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/Interpreter/closures.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,13 @@ func f() -> Bool? { return nil }
8282
let c = { b = true }
8383
_ = (b, c)
8484
})()
85+
86+
// This used to crash at one point in optimized mode because we had the wrong
87+
// memory effects on swift_getFunctionTypeMetadata.
88+
func crash() {
89+
let f: (Int, Int, Int, Int) -> Int = { _, _, _, _ in 21 }
90+
let fs = [f, f]
91+
// CHECK: fs: [(Function), (Function)]
92+
print("fs: \(fs)")
93+
}
94+
crash()

0 commit comments

Comments
 (0)