Skip to content

Commit 1b5e1db

Browse files
committed
[test] Add some more known crashers
1 parent 0c553ca commit 1b5e1db

16 files changed

+102
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// {"kind":"complete","original":"70b8b689","signature":"swift::constraints::ConstraintSystem::addConstraintImpl(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool)","signatureAssert":"Assertion failed: (second && \"Missing second type\"), function addConstraintImpl"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
@propertyWrapper struct a {
4+
wrappedValue : Bool init(wrappedValue: Bool)
5+
var projectedValue init(projectedValue:)
6+
b(@a )
7+
{
8+
b(#^^#
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"kind":"complete","original":"febd2f61","signature":"swift::constraints::ConstraintSystem::matchFunctionTypes(swift::FunctionType*, swift::FunctionType*, swift::constraints::ConstraintKind, swift::optionset::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder)","signatureAssert":"Assertion failed: (Index < Length && \"Invalid index!\"), function operator[]"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
Optional#^^# = {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"kind":"typecheck","signature":"(anonymous namespace)::ConnectedComponents::unionSets(swift::TypeVariableType*, swift::TypeVariableType*)","signatureAssert":"Assertion failed: (validComponentCount > 0), function unionSets"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
let b = (c(), d()
4+
a {
5+
e
6+
b
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"typecheck","signature":"swift::constraints::ConstraintSystem::getClosureType(swift::ClosureExpr const*) const","signatureAssert":"Assertion failed: (result), function getClosureType"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
return {
4+
lazy var a = if .random() { return }
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// {"kind":"typecheck","original":"6bf5a596","signature":"(anonymous namespace)::DeclChecker::visit(swift::Decl*)","signatureAssert":"Assertion failed: (Val && \"isa<> used on a null pointer\"), function doit"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
@implementation
4+
extension
5+
CInt
6+
{
7+
deinit {
8+
}
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"typecheck","signature":"(anonymous namespace)::ExprRewriter::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocatorBuilder)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a {
4+
callAsFunction( () -> Void)
5+
_ = a. init {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// {"kind":"typecheck","signature":"(anonymous namespace)::ExprRewriter::visitDeclRefExpr(swift::DeclRefExpr*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
{
4+
for b 0..<0 {
5+
let a = Array(0..<b)
6+
for c d a {
7+
for e d c... {
8+
Array(a[c..<e].reversed())
9+
f(
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"typecheck","signature":"swift::PackType::getExpandedGenericArgs(llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Type>)","signatureAssert":"Assertion failed: (isa<To>(Val) && \"cast<Ty>() argument of incompatible type!\"), function cast"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a<each b
4+
typealias c<each d> = a<>
5+
c<(
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"kind":"typecheck","original":"134d8fc1","signature":"swift::Parser::parseCustomAttribute(swift::SourceLoc)","signatureAssert":"Assertion failed: (Tok.is(tok::identifier)), function parseCustomAttribute"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
@ @ ::
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"kind":"typecheck","original":"21bee1da","signature":"swift::Parser::parseExprEditorPlaceholder(swift::Token, swift::Identifier)","signatureAssert":"Assertion failed: (PlaceholderId.isEditorPlaceholder()), function parseExprEditorPlaceholder"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
<##>::

0 commit comments

Comments
 (0)