Commit Graph

7628 Commits

Author SHA1 Message Date
practicalswift
83d902a881 [swiftc] Add test case for crash triggered in swift::IterativeTypeChecker::processInheritedProtocols(swift::ProtocolDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>)
Stack trace:

```
swift: /path/to/swift/include/swift/AST/Decl.h:3495: void swift::ProtocolDecl::setInheritedProtocols(ArrayRef<swift::ProtocolDecl *>): Assertion `!InheritedProtocolsSet && "protocols already set"' failed.
8  swift           0x0000000000edd252 swift::IterativeTypeChecker::processInheritedProtocols(swift::ProtocolDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 1602
9  swift           0x0000000000edba8d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
10 swift           0x0000000000dfcca0 swift::TypeChecker::resolveInheritedProtocols(swift::ProtocolDecl*) + 64
11 swift           0x0000000000ef98e1 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 225
14 swift           0x0000000000efb47f swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
15 swift           0x0000000000ef964b swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 603
16 swift           0x0000000000ef9a07 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 519
19 swift           0x0000000000efb47f swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
20 swift           0x0000000000ef964b swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 603
21 swift           0x0000000000ef93cc swift::ArchetypeBuilder::addGenericParameterRequirements(swift::GenericTypeParamDecl*) + 172
22 swift           0x0000000000e23107 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 391
23 swift           0x0000000000e2493f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
24 swift           0x0000000000e24cf4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
25 swift           0x0000000000e003c0 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1248
28 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
29 swift           0x0000000000dd1b12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
30 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
32 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
33 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28226-swift-iterativetypechecker-processinheritedprotocols.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28226-swift-iterativetypechecker-processinheritedprotocols-2a895f.o
1.	While type-checking 'A' at validation-test/compiler_crashers/28226-swift-iterativetypechecker-processinheritedprotocols.swift:8:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 22:22:27 +01:00
Dmitri Gribenko
f7b5536600 Merge pull request #1046 from practicalswift/swiftc-28225-swift-typechecker-checkconformance
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(…)
2016-01-22 13:06:34 -08:00
Joe Pamer
a59e78749d - When simplifying constraint systems generated for deeply nested binary expressions with homogeneous argument types, directly bind the parameter type variable to the argument type. This generally improves type check performance of such expressions.
- Fix the test invocation of a fixed compiler crasher - it now compiles and runs cleanly.
2016-01-22 12:34:34 -08:00
Joe Pamer
e9c44f2877 Resolve three crashers that were fixed by the last set of changes. 2016-01-22 12:34:34 -08:00
practicalswift
351851b64f [swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*)
Stack trace:

```
6  swift           0x0000000000e2f88d swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 1293
10 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
13 swift           0x0000000000e4ab3a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
14 swift           0x0000000000e4a98e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
15 swift           0x0000000000e4b558 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
17 swift           0x0000000000dd1c12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
18 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
20 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
21 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28225-swift-typechecker-checkconformance.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28225-swift-typechecker-checkconformance-39d6d8.o
1.	While type-checking 'e' at validation-test/compiler_crashers/28225-swift-typechecker-checkconformance.swift:7:1
2.	While type-checking 'k' at validation-test/compiler_crashers/28225-swift-typechecker-checkconformance.swift:7:8
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 15:59:56 +01:00
practicalswift
06154e1476 [swiftc] Add test case for crash triggered in swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&)
Stack trace:

```
swift: /path/to/swift/lib/AST/ASTContext.cpp:2918: static swift::GenericFunctionType *swift::GenericFunctionType::get(swift::GenericSignature *, swift::Type, swift::Type, const swift::AnyFunctionType::ExtInfo &): Assertion `sig && "no generic signature for generic function type?!"' failed.
8  swift           0x0000000000f134de swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&) + 574
10 swift           0x0000000000e001ec swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 780
11 swift           0x0000000000ff9a1c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
12 swift           0x0000000000e27bca swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 282
14 swift           0x0000000000e5076e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
16 swift           0x0000000000e516d4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000e5067a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000e23242 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 706
19 swift           0x0000000000e2493f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
20 swift           0x0000000000e24cf4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
21 swift           0x0000000000e00042 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 354
24 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
27 swift           0x0000000000e4be6a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
28 swift           0x0000000000e758fc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
29 swift           0x0000000000dea85b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
31 swift           0x0000000000e4bfb6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
32 swift           0x0000000000dd1b7d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
33 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
35 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
36 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28224-swift-genericfunctiontype-get-d82d73.o
1.	While type-checking expression at [validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:1 - line:8:28] RangeText="{enum S<T where S.c:A{case c"
2.	While type-checking 'S' at validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:2
3.	While resolving type S.c at [validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:17 - line:8:19] RangeText="S.c"
4.	While type-checking 'c' at validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:28
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 11:29:14 +01:00
practicalswift
d062340887 [swiftc] Add test case for crash triggered in swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const
Stack trace:

```
5  swift           0x00000000010122bc swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 44
6  swift           0x0000000001012543 swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 691
7  swift           0x0000000000e6b8dd swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext*, llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Requirement>, bool, unsigned int, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 1293
9  swift           0x00000000010122bc swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 44
10 swift           0x0000000000e6c23a swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, bool, bool, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >*) + 778
11 swift           0x0000000000e6d537 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 519
12 swift           0x0000000000ec6f93 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 931
13 swift           0x0000000000e69fd7 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
14 swift           0x0000000000e6d2c7 swift::constraints::ConstraintSystem::addOverloadSet(swift::Type, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocator*, swift::constraints::OverloadChoice*) + 327
15 swift           0x0000000000ec5448 swift::constraints::ConstraintSystem::simplifyMemberConstraint(swift::constraints::Constraint const&) + 600
16 swift           0x0000000000ec6c34 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 68
17 swift           0x0000000000e69fd7 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
20 swift           0x0000000000f63515 swift::Expr::walk(swift::ASTWalker&) + 69
21 swift           0x0000000000ea75d8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
22 swift           0x0000000000de42c0 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
23 swift           0x0000000000dea7e9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
26 swift           0x0000000000e4ab3a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
27 swift           0x0000000000e4a98e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
28 swift           0x0000000000e4b558 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
30 swift           0x0000000000dd1c12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
31 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
33 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
34 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28223-swift-type-transform.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28223-swift-type-transform-1612ec.o
1.	While type-checking 'b' at validation-test/compiler_crashers/28223-swift-type-transform.swift:7:28
2.	While type-checking expression at [validation-test/compiler_crashers/28223-swift-type-transform.swift:7:35 - line:7:35] RangeText="b"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 10:56:36 +01:00
practicalswift
ed90deabb5 [swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:148: swift::Type swift::constraints::Solution::computeSubstitutions(swift::Type, swift::DeclContext *, swift::Type, swift::constraints::ConstraintLocator *, SmallVectorImpl<swift::Substitution> &) const: Assertion `(conforms || firstArchetype->getIsRecursive() || isOpenedAnyObject(replacement) || replacement->is<GenericTypeParamType>()) && "Constraint system missed a conformance?"' failed.
13 swift           0x0000000000e2f7f3 swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 2083
19 swift           0x0000000000e053b6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
22 swift           0x0000000000e4baba swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
23 swift           0x0000000000e7557c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
24 swift           0x0000000000dea4ab swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
25 swift           0x0000000000deb5b0 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
26 swift           0x0000000000deb759 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
31 swift           0x0000000000e053b6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
34 swift           0x0000000000e4a78a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
35 swift           0x0000000000e4a5de swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
36 swift           0x0000000000e4b1a8 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
38 swift           0x0000000000dd1862 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
39 swift           0x0000000000c7d15f swift::CompilerInstance::performSema() + 2975
41 swift           0x0000000000775137 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
42 swift           0x000000000076fd15 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28222-swift-typechecker-checkconformance-e1d9f6.o
1.	While type-checking declaration 0x47c2e80 at validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:6
2.	While type-checking 'B' at validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:7
3.	While type-checking expression at [validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:39 - line:8:58] RangeText="{struct B<a{enum B{c"
4.	While type-checking 'B' at validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:40
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-21 22:48:53 +01:00
Slava Pestov
b6b5f8bfa9 Add preliminary enum evolution tests
These are passing now that resilient enum case numbering has been
implemented.
2016-01-21 12:10:58 -08:00
Dmitri Gribenko
62f73f4469 Rename CollectionDefaultIterator to IndexingIterator 2016-01-21 11:49:03 -08:00
Erik Eckstein
adef0368bb tests: add import statements to workaround linker errors in all relevant tests.
This is needed if we compile StdlibUnittest with -sil-serialize-all
So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining).
Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
2016-01-21 09:59:50 -08:00
practicalswift
10ffde9f5f [swiftc] Add test case for crash triggered in swift::TypeBase::getMemberSubstitutions(swift::DeclContext*)
Stack trace:

```
swift: /path/to/swift/lib/AST/Type.cpp:2465: TypeSubstitutionMap swift::TypeBase::getMemberSubstitutions(swift::DeclContext *): Assertion `baseTy && "Couldn't find appropriate context"' failed.
8  swift           0x000000000103021a swift::TypeBase::getMemberSubstitutions(swift::DeclContext*) + 458
9  swift           0x000000000103051a swift::TypeBase::getTypeOfMember(swift::ModuleDecl*, swift::Type, swift::DeclContext*) + 58
10 swift           0x0000000000e85547 swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1591
14 swift           0x0000000000e85f5e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
16 swift           0x0000000000e86ec4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000e85e6a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000e33a6a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4890
19 swift           0x0000000000e35fc5 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1829
20 swift           0x0000000001015e7c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
21 swift           0x0000000000e5d2aa swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 282
23 swift           0x0000000000e85f5e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
25 swift           0x0000000000e86ec4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
26 swift           0x0000000000e85e6a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
27 swift           0x0000000000e33a6a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4890
28 swift           0x0000000000e58885 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 373
29 swift           0x0000000000e5a0cf swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
30 swift           0x0000000000e5a484 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
31 swift           0x0000000000e35a02 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 354
34 swift           0x0000000000e3b126 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
37 swift           0x0000000000e8165a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
38 swift           0x0000000000eaafcc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
39 swift           0x0000000000e2024b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
41 swift           0x0000000000e817a6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
42 swift           0x0000000000e0760d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
43 swift           0x0000000000cb1f5f swift::CompilerInstance::performSema() + 2975
45 swift           0x0000000000775447 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
46 swift           0x0000000000770025 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28221-swift-typebase-getmembersubstitutions-17ebef.o
1.	While type-checking expression at [validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:1 - line:8:35] RangeText="{struct d<h:d.d{struct d struct d:d"
2.	While type-checking 'd' at validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:2
3.	While resolving type d.d at [validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:13 - line:8:15] RangeText="d.d"
4.	While resolving type d at [validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:35 - line:8:35] RangeText="d"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-21 09:08:42 +01:00
Chris Willmore
983a674e0c Make use of curried function declaration syntax an error.
<rdar://problem/23111018>
2016-01-20 21:57:38 -08:00
Slava Pestov
0159627322 As promised, split up struct_add_remove_conformances library evolution test
We now test four setups, with the four {before, after}^2 runs of each:

a) Client adds conformance -vs- library adds public conformance -- fixed-layout struct
b) Client adds conformance -vs- library removes internal conformance -- fixed-layout struct
c) Client adds conformance -vs- library adds public conformance -- resilient struct
d) Client adds conformance -vs- library removes internal conformance -- resilient struct

The first two pass, but a) requires a hack to ensure we don't
directly reference conformance table, otherwise the 'after_before'
version doesn't link. I think the right idea here is to weakly
reference conformance tables where the deployment target is
lower than the availability of the conformance.

The second two are XFAIL'd until protocol conformance tables can
reference resilient types from other modules. This requires emitting
indirect metadata symbols, since the client doesn't know if the
resilient type's metadata is direct or a template, and the
conformance table cannot use the metadata accessor either.

These tests will also become important if we decide to revisit
synthesized accessors, and make them lazy again for structs.
2016-01-20 19:08:13 -08:00
Slava Pestov
1d77d810fd Re-apply "Sema: Always synthesize accessors for structs, unless they were imported from Clang"
This reverts commit 24a70e17ea.
2016-01-20 15:04:10 -08:00
Slava Pestov
f099da66b8 Add dummy Optional declaration to MicroStdlib.swift test
This broke when we switched on materializeForSet emission for all
stored properties of structs.
2016-01-20 14:51:44 -08:00
Dmitri Gribenko
220bac09a7 Remove 'asserts' requirements from fixed compiler crash tests 2016-01-20 14:40:36 -08:00
Max Moiseev
9a018bd77d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-20 14:38:22 -08:00
Chris Lattner
888c415f06 Two compiler_crashers were fixed by recent changes, update them. 2016-01-20 11:04:54 -08:00
Chris Lattner
179abf3934 Merge pull request #1023 from practicalswift/swiftc-28220-swift-lvaluetype-get
[swiftc] Add test case for crash triggered in swift::LValueType::get(…)
2016-01-20 09:20:07 -08:00
Chris Lattner
0632a65736 Merge pull request #1024 from glessard/details1
silence some warnings in validation-test/stdlib/String.swift
2016-01-20 09:19:41 -08:00
Mark Lacey
24a70e17ea Revert "Sema: Always synthesize accessors for structs, unless they were imported from Clang"
This reverts commit 2b6ab633fc because it
at least breaks:
    Swift :: stdlib/SequenceType.swift.gyb
and possibly also results in some or all of these failures:
    Swift :: compiler_crashers/27944-swift-astvisitor.swift
    Swift :: compiler_crashers/28200-swift-typebase-getdesugaredtype.swift
    Swift :: stdlib/CollectionType.swift.gyb
    Swift :: stdlib/MicroStdlib.swift
2016-01-20 08:32:39 -08:00
Guillaume Lessard
d6571c645b Replace ++ by "+= 1" 2016-01-20 07:45:54 -07:00
Guillaume Lessard
0f46bd465d Unmutated vars changed to lets 2016-01-20 07:45:54 -07:00
practicalswift
cc13df11c4 [swiftc] Add test case for crash triggered in swift::LValueType::get(swift::Type)
Stack trace:

```
swift: /path/to/swift/lib/AST/ASTContext.cpp:3216: static swift::LValueType *swift::LValueType::get(swift::Type): Assertion `!objectTy->is<ErrorType>() && "cannot have ErrorType wrapped inside LValueType"' failed.
8  swift           0x0000000000f4b6df swift::LValueType::get(swift::Type) + 639
9  swift           0x000000000102fb4b swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 3899
10 swift           0x0000000000e9ea6c swift::constraints::ConstraintSystem::getTypeOfReference(swift::ValueDecl*, bool, bool, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*) + 1820
11 swift           0x0000000000ea0ea1 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 689
12 swift           0x0000000000efd081 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 897
13 swift           0x0000000000e9d927 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
14 swift           0x0000000000ea0b87 swift::constraints::ConstraintSystem::addOverloadSet(swift::Type, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocator*, swift::constraints::OverloadChoice*) + 327
18 swift           0x0000000000f7fc1e swift::Expr::walk(swift::ASTWalker&) + 46
19 swift           0x0000000000edcfd8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
20 swift           0x0000000000e17e10 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           0x0000000000e1e339 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
23 swift           0x0000000000e7f8e6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
24 swift           0x0000000000e0576d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
25 swift           0x0000000000cafccf swift::CompilerInstance::performSema() + 2975
27 swift           0x0000000000775367 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
28 swift           0x000000000076ff45 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28220-swift-lvaluetype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28220-swift-lvaluetype-get-a71661.o
1.	While type-checking expression at [validation-test/compiler_crashers/28220-swift-lvaluetype-get.swift:8:23 - line:8:24] RangeText="{d"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-20 13:13:28 +01:00
Slava Pestov
2b6ab633fc Sema: Always synthesize accessors for structs, unless they were imported from Clang
This fixes the issue that "SILGen: Correctly emit accessors synthesized to
witness protocol requirements" was meant to solve, but in a simpler way.

A better fix would be to first address the issue where @_transparent
function bodies are not serialized in some cases, and then only emit
synthesized accessors as needed, in the original version of this patch.
To fix the duplicate symbol issues, we would emit the synthesized
accessors with shared linkage, which would always work once serialized
bodies were available.

For resilient structs of course, we'll always need to emit accessors
anyway.
2016-01-20 02:11:53 -08:00
Slava Pestov
5d1da8b957 Fix for struct_add_remove_conformances accessing witness table directly
The test removes a public conformance, which is technically not resilient.
I will split up the test into two tests soon:

- client library adds conformance, library adds public conformance
- client library adds conformance, library removes *private* conformance
2016-01-20 01:50:17 -08:00
practicalswift
1614c8309e [swiftc] Add test case for crash triggered in swift::LValueType::get(swift::Type)
Stack trace:

```
swift: /path/to/swift/lib/AST/ASTContext.cpp:3218: static swift::LValueType *swift::LValueType::get(swift::Type): Assertion `!objectTy->is<LValueType>() && !objectTy->is<InOutType>() && "cannot have 'inout' or @lvalue wrapped inside an @lvalue"' failed.
8  swift           0x0000000000f4b682 swift::LValueType::get(swift::Type) + 546
9  swift           0x000000000102fb4b swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 3899
10 swift           0x0000000000ea1f3d swift::constraints::ConstraintSystem::simplifyType(swift::Type, llvm::SmallPtrSet<swift::TypeVariableType*, 16u>&) + 77
11 swift           0x0000000000eff165 swift::constraints::ConstraintSystem::finalize(swift::FreeTypeVariableBinding) + 2037
12 swift           0x0000000000f03fc6 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 374
13 swift           0x0000000000f071b9 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 6425
14 swift           0x0000000000f03f89 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 313
15 swift           0x0000000000f065bc swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3356
16 swift           0x0000000000f03f89 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 313
17 swift           0x0000000000f03d49 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 73
18 swift           0x0000000000e17f76 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>) + 614
19 swift           0x0000000000e1e339 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
24 swift           0x0000000000ec495a swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 106
25 swift           0x0000000000ec980e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
26 swift           0x0000000000e17fa5 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>) + 661
27 swift           0x0000000000e1e339 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
29 swift           0x0000000000e7f8e6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
30 swift           0x0000000000e0576d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
31 swift           0x0000000000cafccf swift::CompilerInstance::performSema() + 2975
33 swift           0x0000000000775367 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
34 swift           0x000000000076ff45 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28219-swift-lvaluetype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28219-swift-lvaluetype-get-50f344.o
1.	While type-checking expression at [validation-test/compiler_crashers/28219-swift-lvaluetype-get.swift:8:10 - line:9:1] RangeText="println(c
2.	While type-checking expression at [validation-test/compiler_crashers/28219-swift-lvaluetype-get.swift:9:1 - line:9:1] RangeText="_"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-20 10:10:11 +01:00
practicalswift
893a70eb25 [swiftc] Add test case for crash triggered in swift::ValueDecl::setType(swift::Type)
Stack trace:

```
swift: /path/to/swift/lib/AST/Decl.cpp:1753: void swift::ValueDecl::setType(swift::Type): Assertion `!hasType() && "changing type of declaration"' failed.
8  swift           0x0000000000fd680c swift::ValueDecl::setType(swift::Type) + 92
9  swift           0x0000000000fdfbf5 swift::EnumElementDecl::computeType() + 277
13 swift           0x0000000000e39286 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
16 swift           0x0000000000e7f79a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
17 swift           0x0000000000ea987c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
18 swift           0x0000000000e1e3ab swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
21 swift           0x0000000000e7e4ba swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
22 swift           0x0000000000e7e30e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
23 swift           0x0000000000e7eed8 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
25 swift           0x0000000000e05802 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
26 swift           0x0000000000cafccf swift::CompilerInstance::performSema() + 2975
28 swift           0x0000000000775367 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
29 swift           0x000000000076ff45 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28218-swift-valuedecl-settype-de68ab.o
1.	While type-checking getter for a at validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift:8:6
2.	While type-checking expression at [validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift:8:7 - line:8:37] RangeText="{enum a{case c(c(class c]func c"
3.	While type-checking 'a' at validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift:8:8
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-20 08:49:09 +01:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Dmitri Gribenko
a6352968a6 Mark a crash test as fixed 2016-01-19 20:22:10 -07:00
Dmitri Gribenko
c735c00aea Merge pull request #1013 from practicalswift/swiftc-28217-swift-diagnosticengine-emitdiagnostic
[swiftc] Add test case for crash triggered in swift::DiagnosticEngine::emitDiagnostic(…)
2016-01-19 14:42:43 -08:00
Dmitri Gribenko
2874743528 Annotate a crash test as crashing in the verifier 2016-01-19 13:37:22 -07:00
practicalswift
1fbef1f777 [swiftc] Add test case for crash triggered in swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&)
Stack trace:

```
swift: /path/to/swift/lib/AST/DiagnosticEngine.cpp:463: void formatDiagnosticText(llvm::StringRef, ArrayRef<swift::DiagnosticArgument>, llvm::raw_ostream &): Assertion `ArgIndex < Args.size() && "Out-of-range argument index"' failed.
9  swift           0x0000000000fe725b swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 2891
10 swift           0x0000000000fe64ef swift::DiagnosticEngine::flushActiveDiagnostic() + 319
11 swift           0x0000000000ec5b20 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 336
12 swift           0x0000000000eca8ee swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
13 swift           0x0000000000e19225 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>) + 661
14 swift           0x0000000000e1f5b9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
18 swift           0x0000000000e3a366 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
21 swift           0x0000000000e7f59a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
22 swift           0x0000000000e7f3ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
23 swift           0x0000000000e7ffb8 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
25 swift           0x0000000000e06a92 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
26 swift           0x0000000000cb0f4f swift::CompilerInstance::performSema() + 2975
28 swift           0x0000000000775357 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
29 swift           0x000000000076ff35 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28217-swift-diagnosticengine-emitdiagnostic-78c825.o
1.	While type-checking getter for b at validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift:8:6
2.	While type-checking 'b' at validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift:8:7
3.	While type-checking expression at [validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift:8:26 - line:8:26] RangeText="n"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-19 19:57:52 +01:00
practicalswift
fa7d206c85 [swiftc] Add test case for crash triggered in swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool)
Stack trace:

```
swift: /path/to/swift/lib/AST/Expr.cpp:204: void swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool)::PropagateAccessKind::visit(swift::Expr *, swift::AccessKind): Assertion `(AllowOverwrite || !E->hasLValueAccessKind()) && "l-value access kind has already been set"' failed.
9  swift           0x0000000000fec937 swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool) + 23
13 swift           0x0000000000eaeb10 swift::TypeChecker::callWitness(swift::Expr*, swift::DeclContext*, swift::ProtocolDecl*, swift::ProtocolConformance*, swift::DeclName, llvm::MutableArrayRef<swift::Expr*>, swift::Diag<>) + 2688
17 swift           0x0000000000f80c3e swift::Expr::walk(swift::ASTWalker&) + 46
18 swift           0x0000000000eaa826 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
19 swift           0x0000000000e1f62b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
21 swift           0x0000000000ec6dd8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 5128
22 swift           0x0000000000eca8ee swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
23 swift           0x0000000000e19225 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>) + 661
24 swift           0x0000000000e1f5b9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
25 swift           0x0000000000e20730 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
26 swift           0x0000000000e208d9 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
29 swift           0x0000000000e3a366 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
31 swift           0x0000000000e809c6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
32 swift           0x0000000000e069fd swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
33 swift           0x0000000000cb0f4f swift::CompilerInstance::performSema() + 2975
35 swift           0x0000000000775357 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
36 swift           0x000000000076ff35 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28216-swift-expr-propagatelvalueaccesskind-2422f6.o
1.	While type-checking declaration 0x596f8a0 at validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift:8:1
2.	While type-checking expression at [validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift:8:7 - line:8:11] RangeText="[[[]_"
3.	While type-checking expression at [validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift:8:7 - line:8:11] RangeText="[[[]_"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-19 10:48:53 +01:00
Slava Pestov
0d96017b0d Add some more detail to library evolution test readme 2016-01-18 23:27:50 -08:00
jopamer
19b4be7308 Merge pull request #1002 from practicalswift/swiftc-28215-swift-normalprotocolconformance-getwitness
[swiftc] Add test case for crash triggered in swift::NormalProtocolConformance::getWitness(…)
2016-01-18 12:21:53 -08:00
Slava Pestov
afe2893835 SIL: Mark alloc_global as having side effects
Otherwise it just gets optimized away.

Fixes <rdar://problem/24222892>.
2016-01-17 19:40:03 -08:00
Chris Lattner
a2ea7b1335 Recent fixes fixed this testcase as well. 2016-01-17 13:11:38 -08:00
practicalswift
7f4edbe32b [swiftc] Add test case for crash triggered in swift::NormalProtocolConformance::getWitness(swift::ValueDecl*, swift::LazyResolver*) const
Stack trace:

```
8  swift           0x000000000101d122 swift::NormalProtocolConformance::getWitness(swift::ValueDecl*, swift::LazyResolver*) const + 610
9  swift           0x0000000001055edb swift::ConformanceLookupTable::getSatisfiedProtocolRequirementsForMember(swift::ValueDecl const*, swift::NominalTypeDecl*, swift::LazyResolver*, bool) + 651
10 swift           0x0000000000fd4025 swift::ValueDecl::getSatisfiedProtocolRequirements(bool) const + 85
14 swift           0x0000000000f5b1a8 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const + 152
24 swift           0x0000000000f5b1a8 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const + 152
33 swift           0x0000000000f7d8d4 swift::Decl::walk(swift::ASTWalker&) + 20
34 swift           0x0000000001007e6e swift::SourceFile::walk(swift::ASTWalker&) + 174
35 swift           0x0000000001036dd4 swift::verify(swift::SourceFile&) + 52
36 swift           0x0000000000e047d2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1922
37 swift           0x0000000000caf3af swift::CompilerInstance::performSema() + 2975
39 swift           0x0000000000775047 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
40 swift           0x000000000076fc35 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28215-swift-normalprotocolconformance-getwitness.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28215-swift-normalprotocolconformance-getwitness-95a935.o
1.	While walking into decl 'b' at validation-test/compiler_crashers/28215-swift-normalprotocolconformance-getwitness.swift:8:1
2.	While walking into body of 'b' at validation-test/compiler_crashers/28215-swift-normalprotocolconformance-getwitness.swift:8:1
3.	While verifying overridden 'init' at validation-test/compiler_crashers/28215-swift-normalprotocolconformance-getwitness.swift:8:20
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-17 22:03:33 +01:00
Chris Lattner
5ba57cb498 Fix ExprRewriter::coerceClosureExprToVoid to be resilient to type checking
closures which have already been transformed into void conversion closures.

This fixes 28213-swift-expr-walk.swift/28187-llvm-foldingset-swift-constraints-constraintlocator.swift
2016-01-17 12:07:13 -08:00
practicalswift
53fdd7f51d [swiftc] Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&)
Stack trace:

```
swift: /path/to/llvm/include/llvm/ADT/PointerUnion.h:297: T llvm::PointerUnion3<swift::Expr *, swift::Stmt *, swift::Decl *>::get() const [PT1 = swift::Expr *, PT2 = swift::Stmt *, PT3 = swift::Decl *, T = swift::Stmt *]: Assertion `is<T>() && "Invalid accessor called"' failed.
9  swift           0x0000000000f7d4f3 swift::Expr::walk(swift::ASTWalker&) + 19
10 swift           0x0000000000ea84e6 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
11 swift           0x0000000000e1d2ab swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
14 swift           0x0000000000ec4f70 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 6448
15 swift           0x0000000000ec854e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
16 swift           0x0000000000e16ea5 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>) + 661
17 swift           0x0000000000e1d239 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
19 swift           0x0000000000e7e7d6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
20 swift           0x0000000000e0467d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
21 swift           0x0000000000caf3af swift::CompilerInstance::performSema() + 2975
23 swift           0x0000000000775047 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
24 swift           0x000000000076fc35 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28213-swift-expr-walk.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28213-swift-expr-walk-e0f871.o
1.	While type-checking expression at [validation-test/compiler_crashers/28213-swift-expr-walk.swift:8:1 - line:8:14] RangeText="{{{l->Void in{"
2.	While type-checking expression at [validation-test/compiler_crashers/28213-swift-expr-walk.swift:8:3 - line:8:14] RangeText="{l->Void in{"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-17 20:39:56 +01:00
Chris Lattner
6ea637f698 Fix 28203-swift-typebase-getdesugaredtype.swift by being more careful about setting an errortype on an AssociatedTypeDecl when type checking of the containing protocoltype has failed. 2016-01-17 11:37:35 -08:00
Chris Lattner
d101ccdf98 Fix 28203-swift-typebase-getdesugaredtype.swift by being more careful about
setting an errortype on an AssociatedTypeDecl when type checking of the
containing protocoltype has failed.
2016-01-17 11:37:35 -08:00
Erik Eckstein
e369c95cce tests: temporarily disable the test_global_change_size test in optimized mode.
Reason: rdar://problem/24222892
2016-01-17 10:37:18 -08:00
Chris Lattner
4e1c4d8bf3 Merge pull request #1000 from practicalswift/swiftc-28209-swift-protocoldecl-requiresclassslow
[swiftc] Add test case for crash triggered in swift::ProtocolDecl::requiresClassSlow()
2016-01-17 10:05:52 -08:00
Chris Lattner
779f47b72f Merge pull request #999 from practicalswift/swiftc-28210-swift-declcontext-getprotocolself
[swiftc] Add test case for crash triggered in swift::DeclContext::getProtocolSelf()
2016-01-17 10:05:25 -08:00
Erik Eckstein
f213f444eb tests: 32-bit platforms don't like dead beef 2016-01-17 09:49:15 -08:00
Erik Eckstein
beff34c1b6 test: Temporarily disable the XCTest because it fails to load a dylib.
rdar://problem/24222804
2016-01-17 09:48:09 -08:00
practicalswift
42e60dee8a [swiftc] Add test case for crash triggered in swift::DeclContext::getProtocolSelf() const
Stack trace:

```
4  swift           0x0000000000fdeb0e swift::DeclContext::getProtocolSelf() const + 30
6  swift           0x0000000000e32460 swift::configureImplicitSelf(swift::TypeChecker&, swift::AbstractFunctionDecl*) + 160
9  swift           0x0000000000e3288c swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 780
12 swift           0x000000000100b642 swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::pair<llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >) + 1122
13 swift           0x0000000001012c1a swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 3738
14 swift           0x0000000000e5964b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
15 swift           0x0000000000e157d8 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 120
20 swift           0x0000000000f7d50e swift::Expr::walk(swift::ASTWalker&) + 46
21 swift           0x0000000000e16c87 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>) + 119
22 swift           0x0000000000e1d239 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
24 swift           0x0000000000e7e7d6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
25 swift           0x0000000000e0467d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
26 swift           0x0000000000caf3af swift::CompilerInstance::performSema() + 2975
28 swift           0x0000000000775047 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
29 swift           0x000000000076fc35 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28210-swift-declcontext-getprotocolself.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28210-swift-declcontext-getprotocolself-860fc9.o
1.	While type-checking expression at [validation-test/compiler_crashers/28210-swift-declcontext-getprotocolself.swift:7:55 - line:7:57] RangeText="{<T"
2.	While type-checking '<' at validation-test/compiler_crashers/28210-swift-declcontext-getprotocolself.swift:7:48
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-17 18:06:21 +01:00