Commit Graph

7628 Commits

Author SHA1 Message Date
Max Moiseev
40b1a0b7e0 [stdlib] all sorts of require renamed back to precondition 2016-02-19 18:21:29 -08:00
Daniel Duan
e0cc095063 [Parser] updated tests for "expected declaration" companion note 2016-02-19 11:05:03 -08:00
Dmitri Gribenko
b90470e2fe Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-19 09:51:53 -08:00
Dmitri Gribenko
98561f6137 stdlib: joinWithSeparator(_:) => join(separator:) 2016-02-18 22:30:57 -08:00
Dmitri Gribenko
a73390c06d stdlib tests: replace '__FILE__' and '__LINE__' with '#file' and '#line' 2016-02-18 18:48:29 -08:00
Dmitri Gribenko
0f36bec31f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-18 16:41:35 -08:00
John McCall
38498bd7fd This test is no longer crashing. 2016-02-18 01:45:50 -08:00
Dmitri Gribenko
62fa71d74d Merge pull request #1344 from dduan/0038
[SILGen] add a crasher in Type Lowering
2016-02-18 00:43:21 -08:00
Dmitri Gribenko
65d840c0ae stdlib: lowercase cases in Optional and ImplicitlyUnwrappedOptional 2016-02-18 00:40:33 -08:00
Daniel Duan
f2e3d0be23 [SILGen] add a crasher in Type Lowering 2016-02-17 22:40:02 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Dmitri Gribenko
0795970fa7 Merge pull request #1096 from mattrajca/master
Added an an overlay for IOKit that adds the kIOReturnError* constants
2016-02-17 09:11:25 -08:00
Luke Larson
f53db0ebd3 [rth] Add resilience test helper utility 2016-02-16 18:52:34 -08:00
Dmitri Gribenko
d7d87a157b Merge pull request #1328 from practicalswift/swiftc-28255-swift-decl-dump
[swiftc] Add test case for crash triggered in swift::Decl::dump(…)
2016-02-16 14:28:09 -08:00
practicalswift
ef01faf32d [swiftc] Add test case for crash triggered in swift::Decl::dump(llvm::raw_ostream&, unsigned int) const
Stack trace:

```
13 swift           0x0000000000f2f1a8 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const + 152
18 swift           0x0000000000f2f1a8 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const + 152
27 swift           0x0000000000f6d024 swift::Decl::walk(swift::ASTWalker&) + 20
28 swift           0x0000000001000a6e swift::SourceFile::walk(swift::ASTWalker&) + 174
29 swift           0x0000000000f53324 swift::verify(swift::SourceFile&) + 52
30 swift           0x0000000000dcd4e4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1492
31 swift           0x0000000000c8023f swift::CompilerInstance::performSema() + 2975
33 swift           0x0000000000774691 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
34 swift           0x000000000076f1d5 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/28255-swift-decl-dump.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28255-swift-decl-dump-ac2682.o
1.	While walking into decl 'Q' at validation-test/compiler_crashers/28255-swift-decl-dump.swift:8:1
2.	While walking into body of 'Q' at validation-test/compiler_crashers/28255-swift-decl-dump.swift:8:1
3.	While verifying overridden 'init' at validation-test/compiler_crashers/28255-swift-decl-dump.swift:8:23
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-16 22:30:17 +01:00
Brian Gesiak
42215042ae [validation-test] More granular FixedPoint tests
`FixedPoint.swift.gyb` generates a massive amount of assertions:
one for each `Int` type (such as `UInt8` and `Int64`) as a source,
to one of each `Int` type as a destination, for each of 27 bit
patterns. By my math that's 8 * 8 * 27 == 1728 assertions.
As a result, when one of those assertions fails, it's difficult to
tell what went wrong.

Split each assertion into its own test case. This makes the test
take a little longer to run, but it produces much more valuable
output when it fails.
2016-02-16 12:03:49 -05:00
Dmitri Gribenko
0e1c488f9a stdlib: print, debugPrint: 'toStream:' => 'to:' 2016-02-15 23:48:02 -08:00
Dmitri Gribenko
25cc2d5695 stdlib: add first argument labels to Set and Dictionary 2016-02-15 23:48:02 -08:00
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Slava Pestov
1e2285935f Merge pull request #1229 from gregomni/generic-func-args
[Sema] Extend callee diagnoses to non-conforming complex args including generics.
2016-02-15 12:13:37 -08:00
Dmitri Gribenko
63c11c2e79 Fix the test for the case when StdlibUnittest is built with -sil-serialize-all 2016-02-15 11:02:24 -08:00
Dmitri Gribenko
f93ca42345 Add a basic execution tests for method overrides and overloads 2016-02-14 23:36:16 -08:00
gregomni
10370a5c0f Extend callee diagnoses to non-conforming complex args including generics.
Previously, type checking arguments worked fine if the entire arg was
UnresolvedType, but if the type just contained UnresolvedType, the
constraint system always failed via explicitly constraining to
unresolved.

Now in TypeCheckConstraints, if the solution allows for free variables
that are UnresolvedType, then also convert any incoming UnresolvedTypes
into variables. At worst, in the solution these just get converted back
into the same Unresolved that they started with.

This change allows for incorrect tuple/function type possibilities to
make it back out to CSDiag, where they can be more precisely diagnosed
with callee info. The rest of the changes are to correctly figure
out the failure info when evaluating more types of Types.

New diagnosis for a partial part of an arg type not confroming. Tests
added for that. Expected errors changed in several places where we
now get real types in the diagnosis instead of '(_)' unresolved.
2016-02-14 11:32:14 -08:00
Dmitri Gribenko
d43b038e3e Properly set the 'no_asan' feature in the validation testsuite 2016-02-13 19:06:50 -08:00
Dmitri Gribenko
7e9b8fe325 Fix Evolution tests in the mode when StdlibUnittest is built with -sil-serialize-all 2016-02-13 18:37:27 -08:00
Slava Pestov
c823974f85 Fix add_conformance evolution tests to pass with optimized builds
Even dynamically casting a generic parameter to a protocol type is only
guaranteed to succeed for conformances available at build time.

Since we can't express conditional availability of conformances yet,
this part of the test is useless, so redo it.
2016-02-13 18:21:58 -08:00
Chris Lattner
a7dea79553 update validation test for diagnostics change. 2016-02-12 17:41:21 -08:00
Slava Pestov
27aad39c79 This test already passes on master 2016-02-11 23:51:47 -08:00
Slava Pestov
c83be882be Merge pull request #1283 from practicalswift/swiftc-28254-swift-enumelementdecl-getargumentinterfacetype
[swiftc] Add test case for crash triggered in swift::EnumElementDecl::getArgumentInterfaceType()
2016-02-11 23:32:41 -08:00
Slava Pestov
3aacf5d805 ArchetypeBuilder: Allow generic signature superclass constraints to contain type parameters
There was a diagnostic to catch these, but it wasn't triggered
reliably, and it sounds like users were already relying on this
feature working in the few cases where it did.

So instead, just map an archetype's superclass into context
when building the archetype.

Recursion is still not allowed and is diagnosed, for example
<T, U where T : C<U>, U : C<T>>.

Note that compiler_crashers_fixed/00022-no-stacktrace.swift no
longer produces a diagnostic in Sema, despite the fact that the
code is invalid. It does diagnose in IRGen when we map the
type into context. Diagnosing in Sema requires fixing the
declaration checker to correctly handle recursion through a
generic signature. Right now, if recursion is detected, we bail
out, but do not always diagnose. Alternatively, we could
prohibit unbound generic types from appearing in generic
signatures.

This is a more principled fix for rdar://problem/24590570.
2016-02-11 23:23:26 -08:00
practicalswift
36267e37b6 [swiftc] Add test case for crash triggered in swift::EnumElementDecl::getArgumentInterfaceType() const
Stack trace:

```
swift: /path/to/llvm/include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::AnyFunctionType, Y = swift::TypeBase]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
8  swift           0x0000000000fcfc9d swift::EnumElementDecl::getArgumentInterfaceType() const + 157
10 swift           0x0000000000dfa99c swift::TypeChecker::checkDeclCircularity(swift::NominalTypeDecl*) + 268
12 swift           0x0000000000df9296 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
13 swift           0x0000000000dc613a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1178
14 swift           0x0000000000c7970f swift::CompilerInstance::performSema() + 2975
16 swift           0x0000000000774901 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
17 swift           0x000000000076f445 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/28254-swift-enumelementdecl-getargumentinterfacetype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28254-swift-enumelementdecl-getargumentinterfacetype-6528cf.o
1.	While type-checking 'B' at validation-test/compiler_crashers/28254-swift-enumelementdecl-getargumentinterfacetype.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-12 07:29:48 +01:00
practicalswift
97d840f06f [swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::matchDeepEqualityTypes(swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSSimplify.cpp:976: ConstraintSystem::SolutionKind swift::constraints::ConstraintSystem::matchDeepEqualityTypes(swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder): Assertion `(bool)nominal1->getParent() == (bool)nominal2->getParent() && "Mismatched parents of nominal types"' failed.
8  swift           0x0000000000ebd1e8 swift::constraints::ConstraintSystem::matchDeepEqualityTypes(swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder) + 1000
9  swift           0x0000000000ebda5b swift::constraints::ConstraintSystem::simplifyRestrictedConstraint(swift::constraints::ConversionRestrictionKind, swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 1019
10 swift           0x0000000000ebb264 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 9988
11 swift           0x0000000000ec502c swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 652
12 swift           0x0000000000e5f857 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
13 swift           0x0000000000e62464 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*> >*) + 3252
14 swift           0x0000000000e62de7 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 519
15 swift           0x0000000000ec5143 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 931
16 swift           0x0000000000e5f857 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
19 swift           0x0000000000f665d5 swift::Expr::walk(swift::ASTWalker&) + 69
20 swift           0x0000000000ea3e48 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
21 swift           0x0000000000dd7b30 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
22 swift           0x0000000000dde0e9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
26 swift           0x0000000000e4064a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
27 swift           0x0000000000e4049e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
28 swift           0x0000000000e41068 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
30 swift           0x0000000000dc61b4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
31 swift           0x0000000000c7970f swift::CompilerInstance::performSema() + 2975
33 swift           0x0000000000774901 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
34 swift           0x000000000076f445 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/28253-swift-constraints-constraintsystem-matchdeepequalitytypes.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28253-swift-constraints-constraintsystem-matchdeepequalitytypes-09a3bc.o
1.	While type-checking getter for b at validation-test/compiler_crashers/28253-swift-constraints-constraintsystem-matchdeepequalitytypes.swift:12:5
2.	While type-checking expression at [<invalid loc> - <invalid loc>]
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-11 23:21:40 +01:00
practicalswift
18815fefe0 [swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::assignFixedType(swift::TypeVariableType*, swift::Type, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/ConstraintGraph.cpp:207: void swift::constraints::ConstraintGraphNode::addFixedBinding(swift::TypeVariableType *): Assertion `!adjacency.FixedBinding && "Already marked as a fixed binding?"' failed.
9  swift           0x0000000000e5e66e swift::constraints::ConstraintSystem::assignFixedType(swift::TypeVariableType*, swift::Type, bool) + 382
10 swift           0x0000000000eb9c3e swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 4318
11 swift           0x0000000000ebc2cc swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 14188
12 swift           0x0000000000ebf8f2 swift::constraints::ConstraintSystem::simplifyFixConstraint(swift::constraints::Fix, swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 482
13 swift           0x0000000000ec4eeb swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 331
14 swift           0x0000000000ecdeaa swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3242
15 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
16 swift           0x0000000000ecf533 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 9011
17 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
18 swift           0x0000000000ecdf70 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3440
19 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
20 swift           0x0000000000ecf533 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 9011
21 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
22 swift           0x0000000000ecdf70 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3440
23 swift           0x0000000000ecb8e5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
24 swift           0x0000000000e89968 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 120
25 swift           0x0000000000dd7cc5 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
26 swift           0x0000000000dde0e9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
29 swift           0x0000000000e4199a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
30 swift           0x0000000000e6b20c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
31 swift           0x0000000000dde15b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
33 swift           0x0000000000e41ae6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
34 swift           0x0000000000dc611d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149
35 swift           0x0000000000c7970f swift::CompilerInstance::performSema() + 2975
37 swift           0x0000000000774901 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2481
38 swift           0x000000000076f445 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/28252-swift-constraints-constraintsystem-assignfixedtype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28252-swift-constraints-constraintsystem-assignfixedtype-98f056.o
1.	While type-checking expression at [validation-test/compiler_crashers/28252-swift-constraints-constraintsystem-assignfixedtype.swift:8:1 - line:8:21] RangeText="{println(""""?struct{"
2.	While type-checking expression at [validation-test/compiler_crashers/28252-swift-constraints-constraintsystem-assignfixedtype.swift:8:2 - line:8:14] RangeText="println(""""?"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-02-11 22:31:32 +01:00
Brian Gesiak
cc3165a0a9 [validation-test] Fix Swift 3 warnings in .gyb
Silence Swift 3 migration warnings:

- Replace `--` and `++` with `-= 1` and `+= 1`.
- Replace screaming snake case identifiers with `#file` and `#line`.
2016-02-11 11:42:59 -05:00
Max Moiseev
55fde4c923 making tests pass 2016-02-10 16:08:40 -08:00
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