Skip to content

Commit 19af3bc

Browse files
authored
Merge pull request #82332 from hamishknight/fuzzy
[test] Add some more known type-checker crashers
2 parents 267d063 + c3fc76f commit 19af3bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+227
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// {"signature":"swift::rewriting::RewriteSystem::verifyRewriteRules(swift::rewriting::RewriteSystem::ValidityPolicy) const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a { associatedtype b : Collection }
4+
struct c < d : Collection where d.Element : a,
5+
e == d.Element.b.Element struct f < d : Collection where d.Element : a,
6+
d.Element.b.Element == d.Index extension c where g == f<d>,
7+
d : RangeReplaceableCollection
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"signature":"swift::InFlightDiagnostic swift::DiagnosticEngine::diagnose<swift::Type>(swift::Decl const*, swift::Diag<swift::Type>, swift::detail::PassArgument<swift::Type>::type)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
// REQUIRES: objc_interop
4+
@objcMembers class a open extension a {
5+
func 0.0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::DifferentiableAttr::DifferentiableAttr(bool, swift::SourceLoc, swift::SourceRange, swift::DifferentiabilityKind, llvm::ArrayRef<swift::ParsedAutoDiffParameter>, swift::TrailingWhereClause*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
func a(@differentiable _ =
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::TypeChecker::typeCheckStmtConditionElement(swift::StmtConditionElement&, bool&, swift::DeclContext*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
a guard let b let a = b
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::constraints::SameTypeRequirementFailure::SameTypeRequirementFailure(swift::constraints::Solution const&, swift::Type, swift::Type, swift::constraints::ConstraintLocator*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a struct b extension Dictionary : a where Value == let func !c {
4+
let d : [Int:b] let : a = d
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::Parser::consumeTokenWithoutFeedingReceiver()"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
@_extern(a
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"cloneRawLiteralExpr(swift::ASTContext&, swift::LiteralExpr*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
a enum a : Double { case = 3.7 case
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"diagnoseAmbiguityWithContextualType(swift::constraints::ConstraintSystem&, swift::constraints::SolutionDiff&, llvm::ArrayRef<std::__1::pair<swift::constraints::Solution const*, swift::constraints::ConstraintFix const*>>, llvm::ArrayRef<swift::constraints::Solution>)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a func b< c >(c = a(
4+
func a
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::constraints::ConstraintSystem::recordKeyPath(swift::KeyPathExpr const*, swift::TypeVariableType*, swift::TypeVariableType*, swift::DeclContext*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
enum a { b->a{switch self{case.c(\ d) e
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// {"signature":"swift::ProtocolConformanceRef::forAbstract(swift::Type, swift::ProtocolDecl*)"}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: env DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib not --crash %target-swift-frontend -typecheck %s
3+
// REQUIRES: OS=macosx
4+
// REQUIRES: target-same-as-host
5+
// REQUIRES: no_asan
36
var sixDoubles
47
: Double "six has the value [\( ( sixDoubles \[]) }0 \0\0 \0 \sixDoubles)"

0 commit comments

Comments
 (0)