Files
swift-mirror/test/SILOptimizer/moveonly_deinit_devirtualization.swift
Erik Eckstein 3243f87204 tests: remove the lit feature swift_in_compiler
Tests require the compiler built with SwiftCompilerSources since a long time.
So this lit feature was redundant anyway. We can remove it.
2026-06-30 14:47:56 +02:00

19 lines
770 B
Swift

// RUN: %target-swift-frontend -sil-verify-all -emit-sil -O %s | %FileCheck %s
public struct Outer<T> {}
extension Outer where T == UInt8 {
public struct InnerNC: ~Copyable {
var x: Int
deinit {}
}
}
// rdar://173803881 (~Copyable type in all-concrete constrained extension)
// The DeinitDevirtualization should not crash.
//
// CHECK-LABEL: sil @$s32moveonly_deinit_devirtualization24testConstrainedExtensionyyAA5OuterVAAs5UInt8VRszlE7InnerNCVyAF_GnF : $@convention(thin) (@owned Outer<UInt8>.InnerNC) -> () {
// CHECK-NOT: destroy
// CHECK-LABEL: } // end sil function '$s32moveonly_deinit_devirtualization24testConstrainedExtensionyyAA5OuterVAAs5UInt8VRszlE7InnerNCVyAF_GnF'
public func testConstrainedExtension(_ s: consuming Outer<UInt8>.InnerNC) {}