From a2f7d239abc6fe74049d548b7a3aa7de64590e21 Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Tue, 2 Sep 2025 09:34:21 +0100 Subject: [PATCH] [test] Add some more known crashers --- .../compiler_crashers_2/3f12a4864c3e4b.swift | 3 +++ .../compiler_crashers_2/6b3f4ab0a969ffc0.swift | 7 +++++++ .../compiler_crashers_2/9ebf7cbda04a5be8.swift | 10 ++++++++++ .../compiler_crashers_2/a79aa9924bdc378.swift | 10 ++++++++++ .../compiler_crashers_2/d4a53522d2dce157.swift | 3 +++ 5 files changed, 33 insertions(+) create mode 100644 validation-test/compiler_crashers_2/3f12a4864c3e4b.swift create mode 100644 validation-test/compiler_crashers_2/6b3f4ab0a969ffc0.swift create mode 100644 validation-test/compiler_crashers_2/9ebf7cbda04a5be8.swift create mode 100644 validation-test/compiler_crashers_2/a79aa9924bdc378.swift create mode 100644 validation-test/compiler_crashers_2/d4a53522d2dce157.swift diff --git a/validation-test/compiler_crashers_2/3f12a4864c3e4b.swift b/validation-test/compiler_crashers_2/3f12a4864c3e4b.swift new file mode 100644 index 0000000000000..67dd5012bf5dc --- /dev/null +++ b/validation-test/compiler_crashers_2/3f12a4864c3e4b.swift @@ -0,0 +1,3 @@ +// {"kind":"typecheck","original":"a275ad03","signature":"swift::Parser::parseTypeInlineArray(swift::SourceLoc)","signatureAssert":"Assertion failed: (Tok.is(K) && \"Consuming wrong token kind\"), function consumeToken"} +// RUN: not --crash %target-swift-frontend -typecheck %s +[a & 3 of diff --git a/validation-test/compiler_crashers_2/6b3f4ab0a969ffc0.swift b/validation-test/compiler_crashers_2/6b3f4ab0a969ffc0.swift new file mode 100644 index 0000000000000..07fd4242dfcd9 --- /dev/null +++ b/validation-test/compiler_crashers_2/6b3f4ab0a969ffc0.swift @@ -0,0 +1,7 @@ +// {"kind":"typecheck","original":"8e10a6ec","signature":"(anonymous namespace)::Verifier::verifyChecked(swift::IdentityExpr*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a { +} +func c(e: repeat a) { + (try repeat each e) +} diff --git a/validation-test/compiler_crashers_2/9ebf7cbda04a5be8.swift b/validation-test/compiler_crashers_2/9ebf7cbda04a5be8.swift new file mode 100644 index 0000000000000..c397b5c884d9d --- /dev/null +++ b/validation-test/compiler_crashers_2/9ebf7cbda04a5be8.swift @@ -0,0 +1,10 @@ +// {"kind":"typecheck","original":"5b785ef0","signature":"swift::ASTWalker::PreWalkResult (anonymous namespace)::Verifier::dispatchVisitPreExpr(swift::OpenExistentialExpr*)","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// RUN: not --crash %target-swift-frontend -typecheck %s +extension Dictionary { + a(b: Sequence) + { + { + for c d b { + var values = + [] ?? { + values.append(c diff --git a/validation-test/compiler_crashers_2/a79aa9924bdc378.swift b/validation-test/compiler_crashers_2/a79aa9924bdc378.swift new file mode 100644 index 0000000000000..42eeed2b832aa --- /dev/null +++ b/validation-test/compiler_crashers_2/a79aa9924bdc378.swift @@ -0,0 +1,10 @@ +// {"kind":"emit-silgen","original":"941ad66b","signature":"swift::CanTypeWrapperTraits::type swift::SILType::castTo() const","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// RUN: not --crash %target-swift-frontend -emit-silgen %s +@available(macOS 14.0, *) +struct a { + var c: (repeat each b) { + (repeat { + each c + }) + } +} diff --git a/validation-test/compiler_crashers_2/d4a53522d2dce157.swift b/validation-test/compiler_crashers_2/d4a53522d2dce157.swift new file mode 100644 index 0000000000000..e96ccf7689742 --- /dev/null +++ b/validation-test/compiler_crashers_2/d4a53522d2dce157.swift @@ -0,0 +1,3 @@ +// {"kind":"typecheck","original":"e0be092d","signature":"swift::constraints::IgnoreAssignmentDestinationType::diagnoseForAmbiguity(llvm::ArrayRef>) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +stride = (a:2).0