Skip to content

Commit 994b9d1

Browse files
committed
[test] Add some more known crashers
1 parent 03f74ff commit 994b9d1

19 files changed

+153
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"complete","original":"2ad6764c","signature":"swift::constraints::Solution::getType(swift::KeyPathExpr const*, unsigned int) const"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
0 -> \ a#^^#
4+
!
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"complete","original":"0b319c77","signature":"swift::ExtensionDecl::getExtendedNominal() const"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
extension a[ {
4+
#^^#
5+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// {"kind":"complete","original":"66e1ef62","signature":"swift::Mangle::ASTMangler::appendConstrainedExistential(swift::Type, swift::GenericSignature, swift::ValueDecl const*)"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
protocol a<b, c> {
4+
associatedtype b
5+
associatedtype c
6+
}
7+
var b {
8+
#^^#
9+
}
10+
func d() -> a<a, some a>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// {"kind":"complete","signature":"swift::Mangle::ASTMangler::appendExtension(swift::ExtensionDecl const*, swift::Mangle::ASTMangler::BaseEntitySignature&, llvm::StringRef)"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
public struct Wrapper<T: P> {}
4+
extension Wrapper: Q where T: Q {
5+
public protocol PBase {
6+
associatedtype AssocType
7+
}
8+
public protocol P: PBase {
9+
override associatedtype AssocType:#^^# P = Wrapper<Self>
10+
}
11+
public protocol Q: P where SelfAssocType: Q {}
12+
public protocol R: Q where Self.AssocType: R {}
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"kind":"complete","original":"90f5eddd","signature":"$s11swiftASTGen19emitDiagnosticParts33_5015A222471F7FD97A302015E08809A0LL16diagnosticEngine16sourceFileBuffer7message8severity8position6offset10highlights5editsySo07BridgeddM0V_SRys5UInt8VGSS25_CompilerSwiftDiagnostics0D8SeverityO01_yZ6Syntax16AbsolutePositionVSiSayAT6SyntaxVGSayAT10SourceEditVGtFSo0wD0VSo0W9StringRefVXEfU_","useSourceOrderCompletion":true}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-order-completion -source-filename %s
3+
// REQUIRES: swift_swift_parser
4+
extension a { b {
5+
#^^#macro c =
6+
#^d^#
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// {"kind":"complete","original":"018f6774","signature":"swift::TypeChecker::typeCheckForCodeCompletion(swift::constraints::SyntacticElementTarget&, bool, llvm::function_ref<void (swift::constraints::Solution const&)>)"}
2+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
struct a {
4+
arr: ] func b {
5+
return c
6+
{
7+
before#^^#? arr : }
8+
<
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"kind":"complete","original":"03d6b22e","signature":"swift::TypeChecker::typeCheckForCodeCompletion(swift::constraints::SyntacticElementTarget&, bool, llvm::function_ref<void (swift::constraints::Solution const&)>)"}
2+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
func a->Int { ((0 + 0 + 0 + 0 4) << 1)#^^# <<
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// {"kind":"complete","original":"00db48f7","signature":"swift::TypeChecker::typeCheckForCodeCompletion(swift::constraints::SyntacticElementTarget&, bool, llvm::function_ref<void (swift::constraints::Solution const&)>)"}
2+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
struct a {
4+
arr: ] func b() {
5+
return c {
6+
(#^^# ? arr : <#expression#>)
7+
}
8+
< <#expression#>
9+
}
10+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// {"kind":"typecheck","original":"2fdf1565","signature":"(anonymous namespace)::TypeSubstituter::transformDependentMemberType(swift::DependentMemberType*, swift::TypePosition)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a {
4+
typealias b = c
5+
associatedtype d: b
6+
associatedtype J: Sequence = e<Self> where J.Element == d.f
7+
}
8+
protocol c {
9+
associatedtype f
10+
}
11+
struct g<h>: a {
12+
struct d
13+
}
14+
struct e<i: a>: Sequence {
15+
struct Iterator: IteratorProtocol {
16+
typealias Element = i.d.f
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"typecheck","original":"679d3d53","signature":"(anonymous namespace)::PrintAST::visit(swift::Decl*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
extension () {
4+
class let a
5+
}

0 commit comments

Comments
 (0)