Commit Graph

7628 Commits

Author SHA1 Message Date
practicalswift
26a3121a26 [SourceKit] Add test case for crash triggered in swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*)
Stack trace:

```
found code completion token A at offset 147
swift-ide-test: /path/to/swift/lib/Sema/TypeCheckType.cpp:299: swift::Type swift::TypeChecker::resolveTypeInContext(swift::TypeDecl *, swift::DeclContext *, TypeResolutionOptions, bool, swift::GenericTypeResolver *, UnsatisfiedDependency *): Assertion `ownerNominal && "Owner must be a nominal type"' failed.
8  swift-ide-test  0x000000000097e62c swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1660
12 swift-ide-test  0x000000000097ee1e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
14 swift-ide-test  0x000000000097fd64 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
18 swift-ide-test  0x0000000000ae049e swift::Expr::walk(swift::ASTWalker&) + 46
19 swift-ide-test  0x00000000008c6fa8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
20 swift-ide-test  0x0000000000910b10 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 256
21 swift-ide-test  0x00000000009170b9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
22 swift-ide-test  0x00000000009181d0 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
23 swift-ide-test  0x0000000000918379 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
28 swift-ide-test  0x0000000000931a47 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
29 swift-ide-test  0x00000000008ff0e2 swift::typeCheckCompletionDecl(swift::Decl*) + 1122
45 swift-ide-test  0x0000000000ae0864 swift::Decl::walk(swift::ASTWalker&) + 20
46 swift-ide-test  0x0000000000b6a4ee swift::SourceFile::walk(swift::ASTWalker&) + 174
47 swift-ide-test  0x0000000000b6971f swift::ModuleDecl::walk(swift::ASTWalker&) + 79
48 swift-ide-test  0x0000000000b43882 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
49 swift-ide-test  0x000000000085ca3d swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
50 swift-ide-test  0x000000000076b914 swift::CompilerInstance::performSema() + 3316
51 swift-ide-test  0x00000000007150b7 main + 33239
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl declaration 0x50160f0 at <INPUT-FILE>:2:1
2.	While type-checking 'A' at <INPUT-FILE>:3:1
3.	While type-checking expression at [<INPUT-FILE>:4:7 - line:4:7] RangeText="c"
4.	While resolving type A at [<INPUT-FILE>:4:7 - line:4:7] RangeText="c"
```
2015-12-18 20:40:35 +01:00
Chris Lattner
bf5f6bfbd5 Merge pull request #628 from practicalswift/sourcekit-038-swift-mangle-mangler-getdecltypeformangling
[SourceKit] Add test case for crash triggered in swift::Mangle::Mangler::getDeclTypeForMangling(…)
2015-12-18 11:07:04 -08:00
Doug Gregor
2091e7f852 Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words 2015-12-18 10:54:46 -08:00
Doug Gregor
3ba3bd359b Merge pull request #620 from jtbandes/member-fix
More error checking for member type lookup
2015-12-18 10:49:06 -08:00
Dmitri Gribenko
45bec1bc1d Remove 'REQUIRES: asserts' from fixed crash tests: they don't crash anymore in any configuration 2015-12-18 10:17:20 -08:00
Dmitri Gribenko
5b89565c86 Annotate SIL crash tests for the --no-assertions build 2015-12-18 10:17:20 -08:00
Max Moiseev
9607883b6c fixing tests after merge 2015-12-18 10:17:20 -08:00
Dmitri Gribenko
fa76f20016 Annotate new tests for the --no-assertions build 2015-12-18 10:16:47 -08:00
practicalswift
49fc8236fd [SIL] Add test case for crash triggered in swift::Parser::parseSILVTable()
Stack trace:

```
sil-opt: /path/to/swift/lib/Parse/ParseSIL.cpp:790: llvm::PointerUnion<ValueDecl *, Module *> lookupTopDecl(swift::Parser &, swift::Identifier): Assertion `DeclLookup.isSuccess() && DeclLookup.Results.size() == 1' failed.
9  sil-opt         0x0000000000a24740 swift::Parser::parseSILVTable() + 640
10 sil-opt         0x00000000009f38d3 swift::Parser::parseTopLevel() + 707
11 sil-opt         0x00000000009eecbb swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 107
12 sil-opt         0x0000000000738ad6 swift::CompilerInstance::performSema() + 2918
13 sil-opt         0x000000000072373c main + 1916
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	With parser at source location: <stdin>:2:13
```
2015-12-18 10:16:08 -08:00
Doug Gregor
a97ab6dd14 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-18 10:15:47 -08:00
Dmitri Gribenko
883aee82c1 Merge pull request #631 from practicalswift/sil-002-swift-performnamebinding
[SIL] Add test case for crash triggered in swift::performNameBinding(…)
2015-12-18 02:32:49 -08:00
Dmitri Gribenko
7d8bbd4579 Merge pull request #637 from practicalswift/sil-003-swift-parser-parsetypesimple
[SIL] Add test case for crash triggered in swift::Parser::parseTypeSimple(…)
2015-12-18 02:31:29 -08:00
Dmitri Gribenko
dffae4ed71 build-script: pass down the xcrun toolchain name to CMake, and to lit 2015-12-18 01:52:29 -08:00
practicalswift
fa711cb9ce [SIL] Add test case for crash triggered in swift::Parser::parseTypeSimple(swift::Diag<>, bool)
Stack trace:

```
<stdin>:3:7: error: expected '(' in argument list of function declaration
func x:inout p<
      ^
<stdin>:3:7: error: expected '->' after function parameter tuple
func x:inout p<
      ^
      ->
<stdin>:3:16: error: expected type
func x:inout p<
               ^
sil-opt: /path/to/swift/include/swift/Parse/ParserResult.h:73: T *swift::ParserResult<swift::TypeRepr>::get() const [T = swift::TypeRepr]: Assertion `getPtrOrNull() && "not checked for nullptr"' failed.
8  sil-opt         0x0000000000a54abd swift::Parser::parseTypeSimple(swift::Diag<>, bool) + 1229
9  sil-opt         0x0000000000a5620a swift::Parser::parseType(swift::Diag<>, bool) + 202
10 sil-opt         0x0000000000a1e1fc swift::Parser::parseFunctionSignature(swift::Identifier, swift::DeclName&, llvm::SmallVectorImpl<swift::Pattern*>&, swift::Parser::DefaultArgumentInfo&, swift::SourceLoc&, bool&, swift::TypeRepr*&) + 1020
11 sil-opt         0x0000000000a07cb5 swift::Parser::parseDeclFunc(swift::SourceLoc, swift::StaticSpellingKind, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&) + 1957
12 sil-opt         0x00000000009ff69a swift::Parser::parseDecl(llvm::SmallVectorImpl<swift::Decl*>&, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>) + 3306
13 sil-opt         0x0000000000a4968b swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 2027
14 sil-opt         0x00000000009f413c swift::Parser::parseTopLevel() + 156
15 sil-opt         0x00000000009ef6bf swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 207
16 sil-opt         0x0000000000738da6 swift::CompilerInstance::performSema() + 2918
17 sil-opt         0x00000000007239fc main + 1916
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	With parser at source location: <stdin>:4:1
```
2015-12-18 08:52:11 +01:00
Max Moiseev
f4aaece75e revisiting CString related String extensions 2015-12-17 17:27:29 -08:00
Chris Willmore
92d230993a Merge pull request #619 from jtbandes/subscript-fix
Propagate ErrorType when checking subscript decls
2015-12-17 17:25:22 -08:00
Dmitri Gribenko
ebb3e45886 Sequence.{min,max}Element() => .min(), .max() 2015-12-17 17:07:01 -08:00
Maxim Moiseev
9e50505970 internal or public // @testable initializers 2015-12-17 17:02:49 -08:00
Dmitri Gribenko
6eedc99016 UnicodeDecodingResult: case Result(...) => case ScalarValue(...) 2015-12-17 16:31:49 -08:00
Maxim Moiseev
9d8755511d fixing validation tests 2015-12-17 16:26:43 -08:00
Dmitri Gribenko
15a9649062 Repeated(repeating:length:) => repeatElement(_:count:) 2015-12-17 16:24:47 -08:00
Dmitri Gribenko
86f1258810 Repeat => Repeated 2015-12-17 16:24:11 -08:00
Mishal Shah
56275ecafc [SR-295] Disabled 029-swift-decl-walk test due to failure 2015-12-17 16:22:33 -08:00
Dmitri Gribenko
73ce9ae7e9 Collection.count => .length
And other API changes that naturally fall out from this, like
Array(repeating:count:) => Array(repeating:length:).
2015-12-17 15:55:29 -08:00
Doug Gregor
824088a07d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 15:50:24 -08:00
practicalswift
65e7ee6080 [SIL] Add test case for crash triggered in swift::performNameBinding(swift::SourceFile&, unsigned int)
Stack trace:

```
sil-opt: /path/to/swift/lib/Sema/NameBinding.cpp:196: void (anonymous namespace)::NameBinder::addImport(SmallVectorImpl<std::pair<ImportedModule, ImportOptions> > &, swift::ImportDecl *): Assertion `topLevelModule && "top-level module missing"' failed.
8  sil-opt         0x0000000000a5ae29 swift::performNameBinding(swift::SourceFile&, unsigned int) + 6969
9  sil-opt         0x0000000000a63a37 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 55
10 sil-opt         0x0000000000738af2 swift::CompilerInstance::performSema() + 2946
11 sil-opt         0x000000000072373c main + 1916
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
```
2015-12-17 23:15:35 +01:00
Dmitri Gribenko
e31aae83ae Remove 'REQUIRES: asserts' from fixed crash tests: they don't crash anymore in any configuration 2015-12-17 14:54:32 -07:00
Dmitri Gribenko
1d5c9b153b Annotate SIL crash tests for the --no-assertions build 2015-12-17 14:53:55 -07:00
Max Moiseev
9f0993449a fixing tests after merge 2015-12-17 13:36:26 -08:00
Dmitri Gribenko
488acb7d67 Annotate new tests for the --no-assertions build 2015-12-17 13:09:25 -07:00
Doug Gregor
f245f18a09 Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words 2015-12-17 11:35:58 -08:00
practicalswift
fb106c87f1 [SourceKit] Add test case for crash triggered in swift::Mangle::Mangler::getDeclTypeForMangling(swift::ValueDecl const*, llvm::ArrayRef<swift::GenericTypeParamType*>&, unsigned int&, llvm::ArrayRef<swift::Requirement>&, llvm::SmallVectorImpl<swift::Requirement>&)
Stack trace:

```
found code completion token A at offset 143
4  swift-ide-test  0x0000000000b5efd9 swift::Mangle::Mangler::getDeclTypeForMangling(swift::ValueDecl const*, llvm::ArrayRef<swift::GenericTypeParamType*>&, unsigned int&, llvm::ArrayRef<swift::Requirement>&, llvm::SmallVectorImpl<swift::Requirement>&) + 665
5  swift-ide-test  0x0000000000b5ebc4 swift::Mangle::Mangler::mangleDeclType(swift::ValueDecl const*, swift::ResilienceExpansion, unsigned int) + 116
6  swift-ide-test  0x0000000000b5bda1 swift::Mangle::Mangler::mangleEntity(swift::ValueDecl const*, swift::ResilienceExpansion, unsigned int) + 417
7  swift-ide-test  0x0000000000b5b8d0 swift::Mangle::Mangler::mangleNominalType(swift::NominalTypeDecl const*, swift::ResilienceExpansion, swift::Mangle::Mangler::BindGenerics, swift::CanGenericSignature, swift::GenericParamList const*) + 256
8  swift-ide-test  0x0000000000b9a322 swift::ide::printDeclUSR(swift::ValueDecl const*, llvm::raw_ostream&) + 722
10 swift-ide-test  0x0000000000773808 copyAssociatedUSRs(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, swift::Decl const*) + 104
11 swift-ide-test  0x0000000000773f88 swift::ide::CodeCompletionResultBuilder::takeResult() + 1624
15 swift-ide-test  0x0000000000b5619b swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 555
22 swift-ide-test  0x0000000000ae0b44 swift::Decl::walk(swift::ASTWalker&) + 20
23 swift-ide-test  0x0000000000b6a7ce swift::SourceFile::walk(swift::ASTWalker&) + 174
24 swift-ide-test  0x0000000000b699ff swift::ModuleDecl::walk(swift::ASTWalker&) + 79
25 swift-ide-test  0x0000000000b43b62 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
26 swift-ide-test  0x000000000085ca3d swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
27 swift-ide-test  0x000000000076b914 swift::CompilerInstance::performSema() + 3316
28 swift-ide-test  0x00000000007150b7 main + 33239
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl 'a' at <INPUT-FILE>:2:1
```
2015-12-17 20:11:35 +01:00
practicalswift
a95646680d [SIL] Add test case for crash triggered in swift::Parser::parseSILVTable()
Stack trace:

```
sil-opt: /path/to/swift/lib/Parse/ParseSIL.cpp:790: llvm::PointerUnion<ValueDecl *, Module *> lookupTopDecl(swift::Parser &, swift::Identifier): Assertion `DeclLookup.isSuccess() && DeclLookup.Results.size() == 1' failed.
9  sil-opt         0x0000000000a24740 swift::Parser::parseSILVTable() + 640
10 sil-opt         0x00000000009f38d3 swift::Parser::parseTopLevel() + 707
11 sil-opt         0x00000000009eecbb swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 107
12 sil-opt         0x0000000000738ad6 swift::CompilerInstance::performSema() + 2918
13 sil-opt         0x000000000072373c main + 1916
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	With parser at source location: <stdin>:2:13
```
2015-12-17 20:07:37 +01:00
Max Moiseev
3fe0c60d7f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 11:00:02 -08:00
Max Moiseev
a28a510407 Fixing tests 2015-12-17 10:24:40 -08:00
Jacob Bandes-Storch
ac95c1318f More error checking for member type lookup 2015-12-17 01:50:53 -08:00
Jacob Bandes-Storch
37207165f0 More error checking for subscript decls 2015-12-17 00:40:01 -08:00
Maxim Moiseev
fc65e676cd fixing validation tests 2015-12-16 17:21:57 -08:00
Maxim Moiseev
c4763ae686 _debugPrecondition => _debugRequire 2015-12-16 17:20:40 -08:00
Maxim Moiseev
e6468a0eca _precondition => _require 2015-12-16 17:19:01 -08:00
Maxim Moiseev
f2f50d6a9d precondition => require 2015-12-16 17:16:08 -08:00
Maxim Moiseev
6c50752aed UnsafePointer: initializeMemory and deinitializePointee 2015-12-16 17:11:57 -08:00
Maxim Moiseev
0e54467bfa Final bulk removal of Type suffix 2015-12-16 17:06:19 -08:00
Mark Lacey
931966ad42 Move a no-longer-crashing swift-ide-test over. 2015-12-16 16:49:44 -08:00
Maxim Moiseev
ca932fca5a CVarArgType => CVarArg 2015-12-16 15:52:01 -08:00
Dmitri Gribenko
3d0ad16094 Unsafe[Mutable]Pointer.memory => .pointee 2015-12-16 15:50:31 -08:00
Dmitri Gribenko
f1dbe205a3 UnsafeMutablePointer.dealloc(_:) => .deallocateCapacity(_:) 2015-12-16 15:47:58 -08:00
Dmitri Gribenko
1f70e25899 UnsafeMutablePointer.alloc(_:) => UnsafeMutablePointer(allocatingCapacity:) 2015-12-16 15:45:48 -08:00
Dmitri Gribenko
339c7a99dc Remove no-argument initializers from unsafe pointer types
The preferred way to create a nil pointer is to use the 'nil' literal.

Affected types:
AutoreleasingUnsafeMutablePointer
OpaquePointer
UnsafeMutablePointer
UnsafePointer
2015-12-16 14:59:50 -08:00
Max Moiseev
2cb497f9a6 XFAILing and IDE crasher due to missing free map 2015-12-16 14:37:36 -08:00