Skip to content

Commit 7508cb7

Browse files
committed
[test] Add some more known crashers
1 parent 439afd6 commit 7508cb7

23 files changed

+170
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// {"kind":"complete","original":"119b2739","signature":"swift::constraints::ConstraintSystem::recordArgumentList(swift::constraints::ConstraintLocator*, swift::ArgumentList*)"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
[
4+
switch 0 {
5+
case .a(#b): #^^#
6+
}
7+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"kind":"complete","original":"8d3b43e5","signature":"(anonymous namespace)::ConstraintWalker::walkToExprPost(swift::Expr*)"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
[
4+
switch {
5+
case ((\.a) #^^#
6+
, .b,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"complete","signature":"swift::Demangle::RemanglerBase::entryForNode(swift::Demangle::Node*, bool)"}
2+
// Actual signature: USRBasedType::fromType
3+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
4+
protocol a: c { b(a = #^^# }
5+
protocol c: a
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"kind":"complete","original":"33e6423a","signature":"swift::printContext(llvm::raw_ostream&, swift::DeclContext*)"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
extension {
4+
subscript -> {
5+
@
6+
#^^#
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"kind":"complete","signature":"swift::TupleTypeElt::TupleTypeElt(swift::Type, swift::Identifier)"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
-switch {
4+
case
5+
< (&a
6+
#^^#
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"kind":"typecheck","original":"2ce52aa0","signature":"swift::constraints::ConstraintSystem::recordOpenedType(swift::constraints::ConstraintLocator*, llvm::ArrayRef<std::__1::pair<swift::GenericTypeParamType*, swift::TypeVariableType*>>, swift::constraints::PreparedOverloadBuilder*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
{
4+
switch
5+
0 {
6+
case .a( ... b
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// {"kind":"typecheck","signature":"swift::MakeAbstractConformanceForGenericType::operator()(swift::InFlightSubstitution&, swift::Type, swift::ProtocolDecl*) const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol A {}
4+
struct C<T: A> {}
5+
protocol E {
6+
associatedtype F
7+
func g<T>(_: C<T>) where F == T
8+
}
9+
struct H: E {
10+
typealias F = ()
11+
func g<T>(_: C<T>) {}
12+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// {"kind":"typecheck","original":"f0cca09d","signature":"swift::ASTWalker::PostWalkResult<swift::ArrayToPointerExpr*> (anonymous namespace)::Verifier::dispatchVisitPost<swift::ArrayToPointerExpr*>(swift::ArrayToPointerExpr*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a {
4+
var b: String
5+
}
6+
func c<d>(e: PartialKeyPath<d>, _: UnsafePointer<d> ...) {
7+
func f(i: UnsafePointer<Int64>) {
8+
i.withMemoryRebound(to: a.self, capacity: 2) { g in
9+
for h in 0 ..< 2 {
10+
var elt = g[h]
11+
c(e: \.b, &elt)
12+
}
13+
}
14+
}
15+
}

validation-test/compiler_crashers_2/2d564dafb1f91.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// {"kind":"typecheck","signature":"swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, swift::DeclContext*, bool, swift::FunctionRefInfo, swift::constraints::ConstraintLocator*, llvm::SmallVectorImpl<std::__1::pair<swift::GenericTypeParamType*, swift::TypeVariableType*>>*)"}
1+
// {"kind":"typecheck","signature":"swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, swift::DeclContext*, bool, swift::FunctionRefInfo, swift::constraints::ConstraintLocator*, llvm::SmallVectorImpl<std::__1::pair<swift::GenericTypeParamType*, swift::TypeVariableType*>>*, swift::constraints::PreparedOverload*)"}
22
// RUN: not --crash %target-swift-frontend -typecheck %s
33
class a {
44
macro b()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// {"kind":"typecheck","original":"5af4a4fb","signature":"swift::constraints::ConstraintSystem::getBindingsFor(swift::TypeVariableType*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a {
4+
func b(arr: [a]) {
5+
arr.compactMap {
6+
{ c in
7+
d ?? {
8+
$0..
9+
}
10+
}
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)