[test] Add some more known crashers

This commit is contained in:
Hamish Knight
2025-11-19 09:07:23 +00:00
parent c717e42af4
commit 272638a30c
7 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
// {"kind":"complete","original":"186a3233","signature":"swift::ReferenceStorageType::get(swift::Type, swift::ReferenceOwnership, swift::ASTContext const&)","signatureAssert":"Assertion failed: (!T->hasTypeVariable()), function get"}
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
struct a<b{ c: b weak var d = \ c {
a()#^^#

View File

@@ -0,0 +1,10 @@
// {"kind":"complete","original":"ee63e244","signature":"swift::rewriting::RequirementMachine::getReducedTypeParameter(swift::CanType, llvm::ArrayRef<swift::GenericTypeParamType*>) const"}
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
protocol a {
associatedtype b
struct c: a {
#^^#
}
d(b )
#e {
d

View File

@@ -0,0 +1,6 @@
// {"kind":"typecheck","original":"bc1e9cdf","signature":"(anonymous namespace)::AssociatedTypeInference::solve()","signatureAssert":"Assertion failed: (!hasTypeParameter() && \"already have an interface type\"), function mapTypeOutOfEnvironment"}
// RUN: not --crash %target-swift-frontend -typecheck %s
// REQUIRES: OS=macosx
import Distributed
distributed actor Distributed<DefaultDistributedActorSystem> {
}

View File

@@ -0,0 +1,5 @@
// {"kind":"typecheck","original":"7048f9d7","signature":"swift::KeyPathExpr::getKeyPathType() const","signatureAssert":"Assertion failed: (isa<To>(Val) && \"cast<Ty>() argument of incompatible type!\"), function cast"}
// RUN: not --crash %target-swift-frontend -typecheck %s
{
convenience #a(\array)
}

View File

@@ -0,0 +1,11 @@
// {"kind":"emit-sil","original":"96451f18","signature":"(anonymous namespace)::LifetimeChecker::getLivenessAtInst(swift::SILInstruction*, unsigned int, unsigned int)","signatureAssert":"Assertion failed: (E <= size() && \"Attempted to set out-of-bounds range!\"), function set"}
// RUN: not --crash %target-swift-frontend -emit-sil %s
struct a<b> {
let c: String
let d: b
}
extension a where b == Void {
init() {
d <= ()
}
}

View File

@@ -0,0 +1,11 @@
// {"kind":"typecheck","original":"30ab265f","signature":"formatDiagnosticArgument(llvm::StringRef, llvm::StringRef, llvm::ArrayRef<swift::DiagnosticArgument>, unsigned int, swift::DiagnosticFormatOptions, llvm::raw_ostream&)","signatureAssert":"Assertion failed: ((!ModifierArguments.empty() || foundPipe) && \"Index beyond bounds in %select modifier\"), function formatSelectionArgument"}
// RUN: not --crash %target-swift-frontend -typecheck %s
// REQUIRES: OS=macosx
// REQUIRES: objc_interop
import Foundation
@objc protocol a {
optional var name: String
}
extension NSObject: a {
var names = <#expression#>
}

View File

@@ -0,0 +1,5 @@
// {"kind":"typecheck","original":"6e824970","signature":"matchCallArguments(swift::constraints::ConstraintSystem&, swift::FunctionType*, swift::ArgumentList*, llvm::ArrayRef<swift::AnyFunctionType::Param>, llvm::ArrayRef<swift::AnyFunctionType::Param>, swift::constraints::ConstraintKind, swift::constraints::ConstraintLocatorBuilder, std::__1::optional<swift::constraints::TrailingClosureMatching>, llvm::SmallVectorImpl<std::__1::pair<swift::TypeVariableType*, swift::ExistentialArchetypeType*>>&)"}
// RUN: not --crash %target-swift-frontend -typecheck %s
{
$1
}($a: [])