Commit Graph

1442 Commits

Author SHA1 Message Date
Chris Lattner
42bc090d43 Fix compiler_crashers/28218-swift-valuedecl-settype.swift
In some completely insane cases, typechecking an EnumElementDecl
can recursively reference itself.  Make sure to produce an error
and bail out when this happens.
2016-02-09 21:46:56 -08:00
Chris Lattner
c70923e1fb Fix compiler_crashers/28220-swift-lvaluetype-get.swift by being more
careful about type transforming that produces an ErrorType.
2016-02-09 21:34:15 -08:00
Slava Pestov
6f7701481c Merge pull request #1075 from dduan/sema_circularity_pr
[Sema] implement better type circularity check
2016-02-08 11:04:28 -08:00
Daniel Duan
6bf8bde92b update tests to reflect changes in previous commit 2016-02-07 22:10:47 -08:00
practicalswift
e9a7b8a1a0 [swiftc] Mark twelve crashes as duplicates of other crashes in the repo.
Two crashes are defined as duplicate if they give the same output for:

$ swiftc FILENAME 2>&1 | \
    grep -E "0x[0-9a-f]" | \
    grep -E '(swift|llvm)::' | \
    grep -vE '(llvm::sys::|frontend_main)' | \
    awk '{ $1=$2=$3=""; print $0 }' | \
    sed 's/^ *//g' | \
    grep -E '(swift|llvm)::' | \
    head -1
2016-02-07 21:40:09 -08:00
practicalswift
29b93b4b19 [swiftc] Add test case for crash triggered in swift::TypeChecker::typeCheckDecl(swift::Decl*, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:3991: void (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl *): Assertion `!FD->getType()->hasTypeParameter()' failed.
10 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
11 swift           0x0000000000e5e7c5 swift::addTrivialAccessorsToStorage(swift::AbstractStorageDecl*, swift::TypeChecker&) + 469
12 swift           0x0000000000e626c4 swift::maybeAddAccessorsToVariable(swift::VarDecl*, swift::TypeChecker&) + 852
13 swift           0x0000000000e018f9 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 2297
14 swift           0x0000000000df81bf swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool) + 15
15 swift           0x0000000000e629ab swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) + 539
16 swift           0x0000000000e0c109 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1417
19 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
22 swift           0x0000000000e4daaa swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
23 swift           0x0000000000e7724c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
24 swift           0x0000000000deb87b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
25 swift           0x0000000000dec9b2 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 162
26 swift           0x0000000000decb8b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
31 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
32 swift           0x0000000000dd2732 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1490
33 swift           0x0000000000c7936f swift::CompilerInstance::performSema() + 2975
35 swift           0x0000000000777461 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
36 swift           0x0000000000772045 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/28250-swift-typechecker-typecheckdecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28250-swift-typechecker-typecheckdecl-302629.o
1.	While type-checking 'B' at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:1
2.	While type-checking expression at [validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:17 - line:9:9] RangeText="{struct d{typealias e:B
3.	While type-checking 'd' at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:18
4.	While type-checking getter for t at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:9:5
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-07 21:40:09 -08:00
Chris Lattner
cfba369f94 Merge pull request #1226 from practicalswift/swiftc-28251-swift-typechecker-addimplicitconstructors
[swiftc] Add test case for crash triggered in swift::TypeChecker::addImplicitConstructors(…)
2016-02-07 09:38:54 -08:00
Michael Gottesman
de7ecf16a0 Disable this evolution test on ASAN builders for now to get all of the bots green. 2016-02-07 09:08:03 -08:00
practicalswift
c64e1049ac [swiftc] Add test case for crash triggered in swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:6690: void swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl *): Assertion `!classDecl->hasSuperclass() || classDecl->getSuperclass()->getAnyNominal()->isInvalid() || classDecl->getSuperclass()->getAnyNominal() ->addedImplicitInitializers()' failed.
8  swift           0x0000000000e10c96 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 4390
9  swift           0x0000000000e03522 swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5986
10 swift           0x0000000000e0575f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1903
11 swift           0x000000000100c57c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2892
12 swift           0x000000000100af30 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
13 swift           0x0000000000e2cabb swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
16 swift           0x0000000000e5643e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
18 swift           0x0000000000e573b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
19 swift           0x0000000000e5634a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
20 swift           0x0000000000e030ea swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4906
21 swift           0x0000000000e0575f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1903
26 swift           0x0000000000e0a966 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
27 swift           0x0000000000dd6722 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1490
28 swift           0x0000000000c7c65f swift::CompilerInstance::performSema() + 2975
30 swift           0x0000000000777ce1 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
31 swift           0x00000000007728c5 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/28251-swift-typechecker-addimplicitconstructors.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28251-swift-typechecker-addimplicitconstructors-e1f071.o
1.	While type-checking 'w' at validation-test/compiler_crashers/28251-swift-typechecker-addimplicitconstructors.swift:8:1
2.	While resolving type a at [validation-test/compiler_crashers/28251-swift-typechecker-addimplicitconstructors.swift:8:16 - line:8:16] RangeText="a"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-07 09:59:58 +01:00
jopamer
b11f7dbade Merge pull request #1224 from practicalswift/swiftc-28250-swift-typechecker-typecheckdecl
[swiftc] Add test case for crash triggered in swift::TypeChecker::typeCheckDecl(…)
2016-02-06 21:53:55 -08:00
Michael Gottesman
34904f9edb Disable evolution test that is failing in ASAN in the clang importer so I can land the stable merge. rdar://24540778. 2016-02-06 18:25:25 -08:00
Michael Gottesman
4691d741a3 Disable some SourceKit/IDE tests that fail with ASAN until after the stable merge. rdar://24540771. 2016-02-06 18:24:51 -08:00
practicalswift
6779a99b55 [swiftc] Add test case for crash triggered in swift::TypeChecker::typeCheckDecl(swift::Decl*, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:3991: void (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl *): Assertion `!FD->getType()->hasTypeParameter()' failed.
10 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
11 swift           0x0000000000e5e7c5 swift::addTrivialAccessorsToStorage(swift::AbstractStorageDecl*, swift::TypeChecker&) + 469
12 swift           0x0000000000e626c4 swift::maybeAddAccessorsToVariable(swift::VarDecl*, swift::TypeChecker&) + 852
13 swift           0x0000000000e018f9 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 2297
14 swift           0x0000000000df81bf swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool) + 15
15 swift           0x0000000000e629ab swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) + 539
16 swift           0x0000000000e0c109 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1417
19 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
22 swift           0x0000000000e4daaa swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
23 swift           0x0000000000e7724c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
24 swift           0x0000000000deb87b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
25 swift           0x0000000000dec9b2 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 162
26 swift           0x0000000000decb8b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
31 swift           0x0000000000e06976 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
32 swift           0x0000000000dd2732 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1490
33 swift           0x0000000000c7936f swift::CompilerInstance::performSema() + 2975
35 swift           0x0000000000777461 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
36 swift           0x0000000000772045 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/28250-swift-typechecker-typecheckdecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28250-swift-typechecker-typecheckdecl-302629.o
1.	While type-checking 'B' at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:1
2.	While type-checking expression at [validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:17 - line:9:9] RangeText="{struct d{typealias e:B
3.	While type-checking 'd' at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:8:18
4.	While type-checking getter for t at validation-test/compiler_crashers/28250-swift-typechecker-typecheckdecl.swift:9:5
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-06 20:47:03 +01:00
practicalswift
4cabee2e83 [swiftc] Mark twelve crashes as duplicates of other crashes in the repo.
Two crashes are defined as duplicate if they give the same output for:

$ swiftc FILENAME 2>&1 | \
    grep -E "0x[0-9a-f]" | \
    grep -E '(swift|llvm)::' | \
    grep -vE '(llvm::sys::|frontend_main)' | \
    awk '{ $1=$2=$3=""; print $0 }' | \
    sed 's/^ *//g' | \
    grep -E '(swift|llvm)::' | \
    head -1
2016-02-06 14:38:11 +01:00
Dmitri Gribenko
6a87399a2f Merge pull request #1210 from glessard/string-validation-test-predicates
[test] more accurate skip conditions in String validation tests
2016-02-05 16:07:43 -08:00
Slava Pestov
44951f0bd3 These two Evolution tests are failing with optimizations enabled
I'll investigate shortly.
2016-02-05 12:50:05 -08:00
practicalswift
824c8068e6 [swiftc] Add test case for crash triggered in swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*)
Stack trace:

```
swift: /path/to/swift/include/swift/AST/Decl.h:4461: void swift::AbstractFunctionDecl::setGenericSignature(swift::GenericSignature *): Assertion `!this->GenericSig && "already have signature?"' failed.
8  swift           0x0000000000e3f6ca swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 3658
13 swift           0x0000000000e1ffc6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
14 swift           0x0000000000debd82 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1490
15 swift           0x0000000000c93bcf swift::CompilerInstance::performSema() + 2975
17 swift           0x0000000000777121 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
18 swift           0x0000000000771d05 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/28249-swift-typechecker-validategenericfuncsignature.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28249-swift-typechecker-validategenericfuncsignature-baa5eb.o
1.	While type-checking 'S' at validation-test/compiler_crashers/28249-swift-typechecker-validategenericfuncsignature.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-02-05 20:43:53 +01:00
Guillaume Lessard
99b703e8a4 Improve xfail and skip with better test predicates 2016-02-05 10:21:44 -07:00
practicalswift
e71ec0b278 [swiftc] Add test case for crash triggered in swift::DynamicSelfType::get(swift::Type, swift::ASTContext const&)
Stack trace:

```
4  swift           0x0000000000f39519 swift::DynamicSelfType::get(swift::Type, swift::ASTContext const&) + 25
6  swift           0x0000000000e1a530 swift::configureImplicitSelf(swift::TypeChecker&, swift::AbstractFunctionDecl*) + 160
11 swift           0x0000000000e1bd70 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 5920
12 swift           0x0000000001021a2c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2892
13 swift           0x00000000010203e0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
14 swift           0x0000000000e4211b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
17 swift           0x0000000000e6ba9e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
19 swift           0x0000000000e6ca14 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
20 swift           0x0000000000e6b9aa swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
21 swift           0x0000000000f006e2 swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 146
22 swift           0x0000000000eff96d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
23 swift           0x0000000000e173d9 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137
24 swift           0x0000000000e1aa95 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1093
28 swift           0x0000000000e6ba9e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
30 swift           0x0000000000e6ca14 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
31 swift           0x0000000000e6b9aa swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
34 swift           0x0000000000e1ffc6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
38 swift           0x0000000000e67246 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
39 swift           0x0000000000debded swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1597
40 swift           0x0000000000c93bcf swift::CompilerInstance::performSema() + 2975
42 swift           0x0000000000777121 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
43 swift           0x0000000000771d05 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/28248-swift-dynamicselftype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28248-swift-dynamicselftype-get-e744d3.o
1.	While type-checking 'b' at validation-test/compiler_crashers/28248-swift-dynamicselftype-get.swift:7:4
2.	While resolving type a at [validation-test/compiler_crashers/28248-swift-dynamicselftype-get.swift:7:11 - line:7:11] RangeText="a"
3.	While resolving type d at [validation-test/compiler_crashers/28248-swift-dynamicselftype-get.swift:7:38 - line:7:38] RangeText="d"
4.	While type-checking 'a' at validation-test/compiler_crashers/28248-swift-dynamicselftype-get.swift:7:13
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-05 17:16:11 +01:00
Dmitri Gribenko
0646b00498 Mark Evolution tests as executable 2016-02-04 17:17:41 -08:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Slava Pestov
99b0e77d35 Merge pull request #1160 from gregomni/generic-func-args
[Sema] Extend callee diagnosis to complex args including generics, e.g. (Void) -> T
2016-02-03 22:55:15 -08:00
gregomni
6b30695869 Extend callee diagnosis to complex args including generics, e.g. (Void) -> T
Correctly determine callee closeness for func/ops that include generics
as part of more complicated parameters, i.e. tuple or closure args
containing generics as elements or args/results. Still only handling
single archetypes.

Also added code to check generic substitutions already made in the callee
parameters, which further helps diagnosis.
2016-02-03 22:54:19 -08:00
practicalswift
6f84004e41 [swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::SolverScope::~SolverScope()
Stack trace:

```
4  swift           0x0000000000ee0c96 swift::constraints::ConstraintSystem::SolverScope::~SolverScope() + 582
5  swift           0x0000000000ee5e6b swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3915
6  swift           0x0000000000ee3605 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
7  swift           0x0000000000ee33b9 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 73
8  swift           0x0000000000df4b56 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
9  swift           0x0000000000dfafa9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
10 swift           0x0000000000dfc152 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 162
11 swift           0x0000000000dfc32b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
16 swift           0x0000000000e16116 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
19 swift           0x0000000000e5d23a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
20 swift           0x0000000000e869dc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
21 swift           0x0000000000dfb01b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
23 swift           0x0000000000e5d386 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
24 swift           0x0000000000de1f5d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1597
25 swift           0x0000000000c8b4df swift::CompilerInstance::performSema() + 2975
27 swift           0x00000000007769f1 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
28 swift           0x00000000007715d5 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/28247-swift-constraints-constraintsystem-solverscope-solverscope.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28247-swift-constraints-constraintsystem-solverscope-solverscope-c50a21.o
1.	While type-checking expression at [validation-test/compiler_crashers/28247-swift-constraints-constraintsystem-solverscope-solverscope.swift:7:1 - line:7:31] RangeText="{func a(a)class a{var _=a(a{{a{"
2.	While type-checking 'a' at validation-test/compiler_crashers/28247-swift-constraints-constraintsystem-solverscope-solverscope.swift:7:11
3.	While type-checking expression at [validation-test/compiler_crashers/28247-swift-constraints-constraintsystem-solverscope-solverscope.swift:7:25 - line:7:31] RangeText="a(a{{a{"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-03 22:20:34 +01:00
Dmitri Gribenko
b728b89b9d Merge pull request #1126 from harlanhaskins/profdata-merge
[coverage] Automatic merger for LLVM profile data
2016-02-03 11:02:47 -08:00
Dmitri Gribenko
0327fc3077 Merge pull request #1187 from glessard/increments
silence some warnings in validation-test/stdlib/Algorithm.swift
2016-02-03 10:37:06 -08:00
Dmitri Gribenko
00bde09962 Merge pull request #1186 from glessard/cite-bugreports
Cite bug reports in xfail annotations
2016-02-03 10:36:47 -08:00
Guillaume Lessard
f6e00cba4f Cite bug reports in xfail annotations 2016-02-03 11:29:38 -07:00
Guillaume Lessard
a4a338beb1 Replace ++ by "+= 1" 2016-02-03 11:23:36 -07:00
Dmitri Gribenko
084e284c3f Mark a crash test as fixed 2016-02-02 17:03:54 -08:00
Chris Lattner
1e380ac991 my fix fixed this testcase too. 2016-02-01 22:31:21 -08:00
Chris Lattner
94dd92fcb8 Fix compiler_crashers 22725 & 28236 by reworking parameter parsing error
recovery a bit.
2016-02-01 20:50:32 -08:00
Chris Lattner
7c97117d77 Fix IDE crashers 027, 066, and 068.
Expand the "skip" functions in the parser to be more careful about
not skipping passed a #endif or a code completion token, since they
are synchronization points for the parser.

The fix was to change Parser::delayParseFromBeginningToHere to use
a manual loop instead of skipUntil (which can stop early for non-EOF
tokens).
2016-02-01 16:36:28 -08:00
Chris Lattner
9b503272a4 fix compiler_crashers/28232-swift-typechecker-typecheckfunctionbodyuntil.swift 2016-01-31 21:46:34 -08:00
Chris Lattner
d0a9479d46 Fix compiler_crashers/28246-swift-expr-propagatelvalueaccesskind.swift
Teach CSApply that InOutExpr around an UnresolvedType shouldn't propagate
lvalue access kinds.
2016-01-31 21:08:38 -08:00
practicalswift
49fc0df3d8 Update revision. 2016-01-31 11:08:31 +01:00
practicalswift
6c18974ff5 [swiftc] Add test case for crash triggered in swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool)
Stack trace:

```
swift: /path/to/swift/lib/AST/Expr.cpp:207: void swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool)::PropagateAccessKind::visit(swift::Expr *, swift::AccessKind): Assertion `E->getType()->isAssignableType() && "setting access kind on non-l-value"' failed.
9  swift           0x0000000000fe9127 swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool) + 23
12 swift           0x0000000000f7cda5 swift::Expr::walk(swift::ASTWalker&) + 69
13 swift           0x0000000000e86d26 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
14 swift           0x0000000000dfb2fb swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
17 swift           0x0000000000ea1969 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 105
18 swift           0x0000000000ea640e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 3934
19 swift           0x0000000000df4ef5 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
20 swift           0x0000000000dfb289 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
23 swift           0x0000000000e5ca15 swift::TypeChecker::typeCheckDestructorBodyUntil(swift::DestructorDecl*, swift::SourceLoc) + 181
24 swift           0x0000000000e5bf7b swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 27
25 swift           0x0000000000e5cb58 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
27 swift           0x0000000000de2532 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1746
28 swift           0x0000000000c8b0ff swift::CompilerInstance::performSema() + 2975
30 swift           0x00000000007766d7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
31 swift           0x00000000007712b5 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/28246-swift-expr-propagatelvalueaccesskind.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28246-swift-expr-propagatelvalueaccesskind-47a5b0.o
1.	While type-checking 'deinit' at validation-test/compiler_crashers/28246-swift-expr-propagatelvalueaccesskind.swift:8:9
2.	While type-checking expression at [validation-test/compiler_crashers/28246-swift-expr-propagatelvalueaccesskind.swift:8:16 - line:8:19] RangeText="{&.T"
3.	While type-checking expression at [validation-test/compiler_crashers/28246-swift-expr-propagatelvalueaccesskind.swift:8:17 - line:8:19] RangeText="&.T"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-31 10:36:43 +01:00
David Farler
8a5ed405bf Make var parameters an error for Swift 3
This finishes up revisions to SE-0003 - only var function parameters
are disallowed for Swift 3.
2016-01-30 12:39:17 -08:00
Chris Lattner
a63be90828 fix compiler_crashers/28219-swift-lvaluetype-get.swift
Not all types are l-valuable, notably InoutType's.  This seems like a
weird restriction to put in the type checker, but it is the cleanest
solution to this.  The better solution would be to change how
inoutexpr/inouttype are represented completely... maybe someday.
2016-01-29 23:18:33 -08:00
Chris Lattner
edec3cc519 simplify this testcase, NFC. 2016-01-29 23:18:33 -08:00
Chris Lattner
ff34db7950 fix a few compiler crashers
These were due to CSDiags not reverting the semantic expr embedded in CollectionExprs
when retypechecking them.
2016-01-29 21:13:57 -08:00
Dmitri Gribenko
27f422fe39 StdlibUnittest: move logging wrappers for collections to StdlibCollectionUnittest 2016-01-29 19:38:37 -07:00
Dmitri Gribenko
d7b05d647b Really mark the crash test as fixed 2016-01-29 19:38:36 -07:00
Chris Lattner
2715a9e46e Another testcase fixed by recent patches. 2016-01-29 17:04:26 -08:00
David Farler
3f635d04c7 Reinstante var bindings in refutable patterns, except function parameters.
This reverts commits: b96e06da44,
                      8f2fbdc93a,
                      93b6962478,
                      64024118f4,
                      a759ca9141,
                      3434f9642b,
                      9f33429891,
                      47c043e8a6.

This commit leaves 'var' on function parameters as a warning to be
merged into Swift 2.2. For Swift 3, this will be an error, to be
converted in a follow-up.
2016-01-29 15:27:08 -08:00
Chris Lattner
58e33ee374 My previous patch fixed this too accidentally, update the test. 2016-01-29 14:57:57 -08:00
Chris Lattner
9bacb09708 Fix 24969-swift-vardecl-emitlettovarnoteifsimple.swift
A use can happen in an initializer declcontext, which has no containing method body.
2016-01-29 14:40:11 -08:00
Chris Lattner
d12a4b988d Fix 28244-swift-valuedecl-isinstancemember.swift
Formerly we stopped type checking a PatternBindingDecl when it was marked
as invalid.  This prevented semantic analysis from doing things like expanding
"stored" properties in protocols into computed properties with getters and setter,
causing downstream problems.

Stop doing this, and instead do a bit of work to silence the downstream errors in
a more narrow way.
2016-01-29 14:32:55 -08:00
Dmitri Gribenko
cf7e3f6df4 stdlib: Range.contains: fix coding style and make the function public
... so that it actually has a chance to get referenced in the witness
table.

But since the function is in a constrained extension, it can't be.
2016-01-29 13:24:59 -08:00
Dmitri Gribenko
a5a70dd14c StdlibUnittest: use ResettableValue more, removing error-prone boilerplate from tests 2016-01-29 13:24:59 -08:00