Skip to content

Commit 59588bc

Browse files
committed
[test] Add a few more known type-checker crashers
1 parent f6f0d75 commit 59588bc

13 files changed

+53
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"signature":"swift::RootProtocolConformance::getWitness(swift::ValueDecl*) const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a{typealias b : IteratorProtocol} extension a{typealias Element =
4+
b.Element} protocol c
5+
: a{typealias b typealias Element} protocol d
6+
: c{typealias Element} protocol e : d struct f : e
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::GenericSignatureImpl::getReducedTypeParameter(swift::CanType) const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
enum b : c protocol
4+
a{typealias c : d.e struct d : a func c typealias e} typealias c : a
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::Parser::parseTypeSimple(swift::Diag<>, swift::Parser::ParseTypeReason)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
subscript(a: ~b <
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::Decl::getResolvedCustomAttrType(swift::CustomAttr*) const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a {
4+
@b c, () {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::constraints::ConstraintSystem::repairFailures(swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::optionset::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, llvm::SmallVectorImpl<swift::constraints::RestrictionOrFix>&, swift::constraints::ConstraintLocatorBuilder)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
func a< b , c : Sequence, d >( b, c) where b== c.Element a( ( 0 , [ (0 0), (
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::TypeChecker::typeCheckParameterDefault(swift::Expr*&, swift::DeclContext*, swift::Type, bool, bool)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
init<a>(b: a == {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// {"signature":"substPrefixType(swift::Type, unsigned int, swift::Type, swift::GenericSignature)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a {
4+
protocol a{associatedtype b} extension a {
5+
extension a {
6+
struct c {
7+
d : b
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"signature":"swift::constraints::ConstraintSystem::simplifySameShapeConstraint(swift::Type, swift::Type, swift::optionset::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a < each b {
4+
c(d : repeat each b) {
5+
c(preacidte : b) {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::constraints::ConjunctionStep::SolverSnapshot::~SolverSnapshot()"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
// REQUIRES: OS=macosx
4+
import Foundation{let a = malloc(b.c <d>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::TuplePattern::createSimple(swift::ASTContext&, swift::SourceLoc, llvm::ArrayRef<swift::TuplePatternElt>, swift::SourceLoc)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
switch { case (repeat a
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::PrintingDiagnosticConsumer::printDiagnostic(swift::SourceManager&, swift::DiagnosticInfo const&)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck -diagnostic-style=llvm %s
3+
' '
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::SubstitutionMap::get(swift::GenericSignature, swift::InFlightSubstitution&)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a < each b { class c protocol d init(e: c & d
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"signature":"swift::constraints::MissingContextualConformanceFailure::diagnoseAsError()"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a }
4+
{
5+
b -> a? in return .c<d e

0 commit comments

Comments
 (0)