// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
let:n(f{var _=#^A^#
Add test case for crash triggered in swift::Parser::consumeDecl(swift::Parser::ParserPosition, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, bool)
[SourceKit] Add test case for crash triggered in swift::Parser::consumeDecl(swift::Parser::ParserPosition, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, bool)

Stack trace:

```
found code completion token A at offset 140
swift-ide-test: /path/to/swift/lib/Parse/PersistentParserState.cpp:76: void swift::PersistentParserState::delayDecl(swift::PersistentParserState::DelayedDeclKind, unsigned int, swift::DeclContext *, swift::SourceRange, swift::SourceLoc): Assertion `!CodeCompletionDelayedDeclState.get() && "only one decl can be delayed for code completion"' failed.
9  swift-ide-test  0x00000000008c778f swift::Parser::consumeDecl(swift::Parser::ParserPosition, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, bool) + 175
10 swift-ide-test  0x00000000008c8ef2 swift::Parser::parseDecl(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, llvm::function_ref<void (swift::Decl*)>) + 4674
11 swift-ide-test  0x00000000009265f9 swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 841
12 swift-ide-test  0x00000000008e7378 swift::Parser::parseExprClosure() + 936
13 swift-ide-test  0x00000000008e7e62 swift::Parser::parseTrailingClosure(swift::SourceRange) + 34
14 swift-ide-test  0x00000000008e0b8b swift::Parser::parseExprPostfix(swift::Diag<>, bool) + 5499
15 swift-ide-test  0x00000000008dde2e swift::Parser::parseExprSequence(swift::Diag<>, bool, bool) + 174
16 swift-ide-test  0x00000000008ddd02 swift::Parser::parseExprImpl(swift::Diag<>, bool) + 146
18 swift-ide-test  0x00000000008f5d99 swift::Parser::parseList(swift::tok, swift::SourceLoc, swift::SourceLoc&, swift::tok, bool, bool, swift::Diag<>, std::function<swift::ParserStatus ()>) + 393
19 swift-ide-test  0x00000000008e4ddb swift::Parser::parseExprList(swift::tok, swift::tok, bool, bool, swift::SourceLoc&, llvm::SmallVectorImpl<swift::Expr*>&, llvm::SmallVectorImpl<swift::Identifier>&, llvm::SmallVectorImpl<swift::SourceLoc>&, swift::SourceLoc&, swift::Expr*&) + 267
20 swift-ide-test  0x00000000008e7fe2 swift::Parser::parseExprList(swift::tok, swift::tok) + 226
21 swift-ide-test  0x00000000008e00f2 swift::Parser::parseExprPostfix(swift::Diag<>, bool) + 2786
22 swift-ide-test  0x00000000008dde2e swift::Parser::parseExprSequence(swift::Diag<>, bool, bool) + 174
23 swift-ide-test  0x00000000008ddd02 swift::Parser::parseExprImpl(swift::Diag<>, bool) + 146
24 swift-ide-test  0x0000000000924cf6 swift::Parser::parseExprOrStmt(swift::ASTNode&) + 422
25 swift-ide-test  0x00000000009269fb swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 1867
26 swift-ide-test  0x00000000008bd01c swift::Parser::parseTopLevel() + 156
27 swift-ide-test  0x00000000008f28d0 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 208
28 swift-ide-test  0x00000000007abc46 swift::CompilerInstance::performSema() + 3254
29 swift-ide-test  0x000000000074d981 main + 36401
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	With parser at source location: <INPUT-FILE>:3:16
```
