From d7c30cd965847d4fbdcc60ac847ca5702cbb6539 Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Mon, 28 Jul 2025 11:14:13 +0100 Subject: [PATCH 1/3] [test] Update a couple of crasher signatures --- validation-test/compiler_crashers_2/361c5acf488944d1.swift | 2 +- validation-test/compiler_crashers_2/7569a0726f21e49f.swift | 2 +- validation-test/compiler_crashers_2/ee271b56888b63fa.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/validation-test/compiler_crashers_2/361c5acf488944d1.swift b/validation-test/compiler_crashers_2/361c5acf488944d1.swift index 20d226bf45dbf..3e210079056cf 100644 --- a/validation-test/compiler_crashers_2/361c5acf488944d1.swift +++ b/validation-test/compiler_crashers_2/361c5acf488944d1.swift @@ -1,4 +1,4 @@ -// {"signature":"swift::InFlightSubstitution::lookupConformance(swift::Type, swift::ProtocolDecl*, unsigned int)"} +// {"kind":"typecheck","signature":"swift::InFlightSubstitution::checkLimits(swift::Type)"} // RUN: not --crash %target-swift-frontend -typecheck %s typealias a = () struct e < each b { typealias f = (repeat a)struct g < each c { diff --git a/validation-test/compiler_crashers_2/7569a0726f21e49f.swift b/validation-test/compiler_crashers_2/7569a0726f21e49f.swift index e478adbcd5ce7..5041e17501b32 100644 --- a/validation-test/compiler_crashers_2/7569a0726f21e49f.swift +++ b/validation-test/compiler_crashers_2/7569a0726f21e49f.swift @@ -1,4 +1,4 @@ -// {"kind":"emit-silgen","original":"f261a4a8","signature":"Assertion failed: (!outerOrigType.isTuple() || !SGF.silConv.useLoweredAddresses()), function planIntoDirect"} +// {"kind":"emit-silgen","original":"f261a4a8","signature":"(anonymous namespace)::ResultPlanner::planIntoDirect(swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern, swift::CanType, swift::SILResultInfo)"} // RUN: not --crash %target-swift-frontend -emit-silgen %s infix operator <*> : AdditionPrecedence func <*> (c: ((a) -> b?)?, d: a) -> b? { diff --git a/validation-test/compiler_crashers_2/ee271b56888b63fa.swift b/validation-test/compiler_crashers_2/ee271b56888b63fa.swift index 13904d9b87de1..8deb70d656cfb 100644 --- a/validation-test/compiler_crashers_2/ee271b56888b63fa.swift +++ b/validation-test/compiler_crashers_2/ee271b56888b63fa.swift @@ -1,4 +1,4 @@ -// {"signature":"swift::InFlightSubstitution::substType(swift::SubstitutableType*, unsigned int)"} +// {"kind":"typecheck","signature":"swift::InFlightSubstitution::projectLaneFromPackType(swift::Type, unsigned int)"} // RUN: not --crash %target-swift-frontend -typecheck %s typealias a< each b > = ( < struct c< each d { typealias e< each b > = (repeat a< each d, each b > From 74601b5e585a37823c36d9cfd989c9678173fa4d Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Mon, 28 Jul 2025 11:14:13 +0100 Subject: [PATCH 2/3] [test] Remove duplicate test case This is essentially the same as `4414db6acd8120aa.swift`. --- validation-test/compiler_crashers_2/12d47ccfc65a990.swift | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 validation-test/compiler_crashers_2/12d47ccfc65a990.swift diff --git a/validation-test/compiler_crashers_2/12d47ccfc65a990.swift b/validation-test/compiler_crashers_2/12d47ccfc65a990.swift deleted file mode 100644 index 2f635e9670863..0000000000000 --- a/validation-test/compiler_crashers_2/12d47ccfc65a990.swift +++ /dev/null @@ -1,4 +0,0 @@ -// {"kind":"typecheck","signature":"swift::ast_scope::ASTScopeImpl::printRange(llvm::raw_ostream&) const"} -// RUN: not --crash %target-swift-frontend -typecheck %s -extension a {} -func b < >> From ae0f9f51d80d4caad68c86533613a1d127e94516 Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Mon, 28 Jul 2025 11:14:13 +0100 Subject: [PATCH 3/3] [test] Add some more known crashers --- .../IDE/crashers/38a36bbefc496da.swift | 7 +++++++ .../IDE/crashers/928f167118f85cf.swift | 5 +++++ .../IDE/crashers/9f45d664f93ae6f7.swift | 6 ++++++ .../IDE/crashers/e8698acd627edfb.swift | 3 +++ validation-test/IDE/crashers/fd52bd37cd5c96.swift | 8 ++++++++ .../IDE/crashers_fixed/32b0b9ccc582da78.swift | 4 ++++ .../IDE/crashers_fixed/617a2713e6cd3627.swift | 3 +++ .../compiler_crashers_2/2215911baba3c39.swift | 15 +++++++++++++++ .../compiler_crashers_2/3ac172bc4a98f31.swift | 7 +++++++ .../compiler_crashers_2/6b4f7c705d8aa6ba.swift | 4 ++++ .../compiler_crashers_2/9fbd87f3ba61177c.swift | 6 ++++++ .../compiler_crashers_2/b7fa36aa91745be0.swift | 11 +++++++++++ 12 files changed, 79 insertions(+) create mode 100644 validation-test/IDE/crashers/38a36bbefc496da.swift create mode 100644 validation-test/IDE/crashers/928f167118f85cf.swift create mode 100644 validation-test/IDE/crashers/9f45d664f93ae6f7.swift create mode 100644 validation-test/IDE/crashers/e8698acd627edfb.swift create mode 100644 validation-test/IDE/crashers/fd52bd37cd5c96.swift create mode 100644 validation-test/IDE/crashers_fixed/32b0b9ccc582da78.swift create mode 100644 validation-test/IDE/crashers_fixed/617a2713e6cd3627.swift create mode 100644 validation-test/compiler_crashers_2/2215911baba3c39.swift create mode 100644 validation-test/compiler_crashers_2/3ac172bc4a98f31.swift create mode 100644 validation-test/compiler_crashers_2/6b4f7c705d8aa6ba.swift create mode 100644 validation-test/compiler_crashers_2/9fbd87f3ba61177c.swift create mode 100644 validation-test/compiler_crashers_2/b7fa36aa91745be0.swift diff --git a/validation-test/IDE/crashers/38a36bbefc496da.swift b/validation-test/IDE/crashers/38a36bbefc496da.swift new file mode 100644 index 0000000000000..832e1478b619b --- /dev/null +++ b/validation-test/IDE/crashers/38a36bbefc496da.swift @@ -0,0 +1,7 @@ +// {"kind":"complete","original":"61e9155a","signature":"swift::ide::ContextFreeCodeCompletionResult::getCodeCompletionDeclKind(swift::Decl const*)"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +extension () +where + #^^# == <#type#> +{ +} diff --git a/validation-test/IDE/crashers/928f167118f85cf.swift b/validation-test/IDE/crashers/928f167118f85cf.swift new file mode 100644 index 0000000000000..46b15fa45bc59 --- /dev/null +++ b/validation-test/IDE/crashers/928f167118f85cf.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"7bbb1dc5","signature":"swift::TypeRepr::print(swift::ASTPrinter&, swift::PrintOptions const&, swift::optionset::OptionSet) const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +a ? { +init { b { extension +}#^^# diff --git a/validation-test/IDE/crashers/9f45d664f93ae6f7.swift b/validation-test/IDE/crashers/9f45d664f93ae6f7.swift new file mode 100644 index 0000000000000..67f8e740891f3 --- /dev/null +++ b/validation-test/IDE/crashers/9f45d664f93ae6f7.swift @@ -0,0 +1,6 @@ +// {"kind":"complete","original":"588b7eea","signature":"swift::BoundGenericType::get(swift::NominalTypeDecl*, swift::Type, llvm::ArrayRef)"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +// REQUIRES: OS=macosx +import Foundation +Foundation[ + #^^#] diff --git a/validation-test/IDE/crashers/e8698acd627edfb.swift b/validation-test/IDE/crashers/e8698acd627edfb.swift new file mode 100644 index 0000000000000..1d46b6d720cee --- /dev/null +++ b/validation-test/IDE/crashers/e8698acd627edfb.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"bae855bf","signature":"swift::InFlightDiagnostic swift::DiagnosticEngine::diagnose(swift::Decl const*, swift::Diag, swift::detail::PassArgument::type, swift::detail::PassArgument::type)"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +class a (swift::TypeBase*)>) const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +@dynamicMemberLookup +struct a b^subscript(dynamicMember e: WritableKeyPath) a } +let binding = a +{ buffer #^^#?? +binding.0 diff --git a/validation-test/IDE/crashers_fixed/32b0b9ccc582da78.swift b/validation-test/IDE/crashers_fixed/32b0b9ccc582da78.swift new file mode 100644 index 0000000000000..30ecc719d4692 --- /dev/null +++ b/validation-test/IDE/crashers_fixed/32b0b9ccc582da78.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"f8c1c082","signature":"swift::ide::PostfixCompletionCallback::Result::tryMerge(swift::ide::PostfixCompletionCallback::Result const&, swift::DeclContext*)"} +// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +typealias a = () arr = [a].append([ +0])#^^# diff --git a/validation-test/IDE/crashers_fixed/617a2713e6cd3627.swift b/validation-test/IDE/crashers_fixed/617a2713e6cd3627.swift new file mode 100644 index 0000000000000..3b6e697d70749 --- /dev/null +++ b/validation-test/IDE/crashers_fixed/617a2713e6cd3627.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"3de07705","signature":"swift::ide::PostfixCompletionCallback::Result::tryMerge(swift::ide::PostfixCompletionCallback::Result const&, swift::DeclContext*)"} +// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +2 ?? .map {} #^^#?? a diff --git a/validation-test/compiler_crashers_2/2215911baba3c39.swift b/validation-test/compiler_crashers_2/2215911baba3c39.swift new file mode 100644 index 0000000000000..8f6dc6e45dc2d --- /dev/null +++ b/validation-test/compiler_crashers_2/2215911baba3c39.swift @@ -0,0 +1,15 @@ +// {"kind":"emit-silgen","original":"e8914023","signature":"swift::Lowering::AbstractionPattern::getNumFunctionParams() const"} +// RUN: not --crash %target-swift-frontend -emit-silgen %s +func a( + _: (repeat each c)!, + _: b +) { +} +struct d { + let e = "" + static func == (g: Self, f: Self) { + let h = + \.e as (Self) -> _ + a(h, f) + } +} diff --git a/validation-test/compiler_crashers_2/3ac172bc4a98f31.swift b/validation-test/compiler_crashers_2/3ac172bc4a98f31.swift new file mode 100644 index 0000000000000..e04a6d587319c --- /dev/null +++ b/validation-test/compiler_crashers_2/3ac172bc4a98f31.swift @@ -0,0 +1,7 @@ +// {"kind":"typecheck","original":"73696db0","signature":"swift::GenericSignatureImpl::isReducedType(swift::Type) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +a +struct b { +d diff --git a/validation-test/compiler_crashers_2/6b4f7c705d8aa6ba.swift b/validation-test/compiler_crashers_2/6b4f7c705d8aa6ba.swift new file mode 100644 index 0000000000000..56aa0aa41a658 --- /dev/null +++ b/validation-test/compiler_crashers_2/6b4f7c705d8aa6ba.swift @@ -0,0 +1,4 @@ +// {"kind":"typecheck","original":"2e6c789c","signature":"swift::DeclAndTypePrinter::Implementation::visitVarDecl(swift::VarDecl*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +a +@TaskLocal init() diff --git a/validation-test/compiler_crashers_2/9fbd87f3ba61177c.swift b/validation-test/compiler_crashers_2/9fbd87f3ba61177c.swift new file mode 100644 index 0000000000000..da60305ed418c --- /dev/null +++ b/validation-test/compiler_crashers_2/9fbd87f3ba61177c.swift @@ -0,0 +1,6 @@ +// {"kind":"typecheck","original":"45b18ebd","signature":"swift::rewriting::Symbol::Storage::Storage(swift::rewriting::Symbol::Kind, swift::CanType, llvm::ArrayRef)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a { + let c: String + let d: b +} +extension a where b == Void { + init() { + d <= () + } +}