Files
swift-mirror/test/IRGen/mangle-anonclosure.swift
Michael Gottesman fd4828e40a Eliminate -assume-parsing-unqualified-ownership-sil from tests.
I am doing this separately from the actual change to eliminate the option to
make it easier to review.
2018-12-19 12:54:13 -08:00

21 lines
696 B
Swift

// RUN: %target-swift-frontend -emit-ir %s -o - | %FileCheck %s
func someValidPointer<T>() -> UnsafeMutablePointer<T> { fatalError() }
class HeapStorage<Value, Element> {
public final func withUnsafeMutablePointerToElements<R>(
body: (UnsafeMutablePointer<Element>) -> R
) -> R { return body(someValidPointer()) }
}
struct CountAndCapacity {}
class TestHeapStorage<T> : HeapStorage<CountAndCapacity,T> {
deinit {
withUnsafeMutablePointerToElements {
// Don't crash when mangling this closure's name.
// CHECK: $s4main15TestHeapStorageCfdySpyxGXEfU_
// ---> main.TestHeapStorage.deinit.(closure #1)
(p: UnsafeMutablePointer<T>) -> () in
}
}
}