Commit Graph

3633 Commits

Author SHA1 Message Date
Graham Batty
dd92de792f Use ICU to implement basic string functions.
Swift SVN r25803
2015-03-06 19:15:34 +00:00
Dmitri Hrybenko
99904a02b5 Revert "XFAIL for <rdar://problem/20035755> Swift.stdlib.HashingAvalanche.swift test failure on incremental RA"
This reverts commit r25753. The failure is caused by unstable iOS
testing tools.

Swift SVN r25754
2015-03-04 08:47:35 +00:00
Andrew Trick
35b9707184 XFAIL for <rdar://problem/20035755> Swift.stdlib.HashingAvalanche.swift test failure on incremental RA
Swift SVN r25753
2015-03-04 08:40:29 +00:00
Graham Batty
98be432723 Updating tests and flags for linux
Swift SVN r25714
2015-03-03 18:26:20 +00:00
Doug Gregor
57a056dcef Revert "stdlib: add an experimental serialization API"
This reverts commit r25678, which breaks the build:

/Users/dgregor/Projects/Apple/swift/stdlib/serialization/MsgPack.swift:117:34: error: integer literal overflows when stored into 'Int'
    } else if utf8Bytes.count <= 0xffff_ffff {
                                 ^
/Users/dgregor/Projects/Apple/swift/stdlib/serialization/MsgPack.swift:139:34: error: integer literal overflows when stored into 'Int'
    } else if dataBytes.count <= 0xffff_ffff {
                                 ^
/Users/dgregor/Projects/Apple/swift/stdlib/serialization/MsgPack.swift:160:24: error: integer literal overflows when stored into 'Int'
    } else if count <= 0xffff_ffff {
                       ^
/Users/dgregor/Projects/Apple/swift/stdlib/serialization/MsgPack.swift:189:31: error: integer literal overflows when stored into 'Int'
    } else if mappingCount <= 0xffff_ffff {
                              ^
/Users/dgregor/Projects/Apple/swift/stdlib/serialization/MsgPack.swift:235:29: error: integer literal overflows when stored into 'Int'
    } else if data.count <= 0xffff_ffff {
                            ^

Swift SVN r25693
2015-03-02 22:41:29 +00:00
Dmitri Hrybenko
581dc3c35d stdlib: split topic-focused modules out of StdlibUnittest
The new modules are:

* SwiftUnstable -- assorted additions to the core standard library
  (more algorithms etc.)

* SwiftUnstableDarwinExtras -- proposed additions to the Darwin overlay,
  not yet reviewed by the Darwin team.

* SwiftUnstablePthreadExtras -- wrappers that make it possible to
  use pthread in Swift (they work around the lack of block-based API in
  pthread).  In future these could be possibly folded into the Darwin
  overlay as well.

These APIs are useful without StdlibUnittest for writing automation
tools in Swift.  Just like SwiftExperimental, none of these modules are
exposed to extrenal users.

Also, since these new modules can be compiled with -sil-serialize-all
(unlike StdlibUnittest, where we can't apply the flag because of
compiler bugs), standard library tests that need to run optimized code
(like AtomicInt.swift) are *much* faster now.

Swift SVN r25679
2015-03-02 10:38:42 +00:00
Dmitri Hrybenko
1a7f8f71a3 stdlib: add an experimental serialization API
The primary motivation for doing this is that NSCoding does not work
with struts and Swift containers.  Making everything classes just to
satisfy NSCoding forces unnatural code.

This API requires two times (!) less boilerplate than NSCoding, since
the same method is used for serialization and deserialization.  This API
is also more type-safe, it does not require the user to write 'as' type
casts, unlike NSCoding.

Please take a look at validation-test/stdlib/Serialization.swift to see
the intended use pattern.

The performance of the underlying implementation is already decent, and
there's a lot of room for improvement.

These APIs will be used for writing automation tools in Swift.  Just
like SwiftExperimental, this module is not exposed to extrenal users.

Swift SVN r25678
2015-03-02 10:38:25 +00:00
Dave Abrahams
47288e357b [stdlib] Replace aString.toInt() with Int(aString)
Swift SVN r25636
2015-02-28 06:01:03 +00:00
Dmitri Hrybenko
822a1a2833 StdlibUnittest: allow to feed custom stdin input into a test
Will be used to test readLine().

rdar://15911365

Swift SVN r25597
2015-02-27 05:59:28 +00:00
Dave Abrahams
ab07daa73d [stdlib] Drop validation tests for numeric parsing
The smoke tests can give us enough checking.

Swift SVN r25587
2015-02-27 02:08:44 +00:00
Dave Abrahams
bd12dcf135 [stdlib] Add integer parsing
Addresses <rdar://17232531>; floating point still remains to be done.

Swift SVN r25549
2015-02-26 11:22:35 +00:00
Chris Lattner
e120cd5cf0 revert changes to testsuite for if/let pattern restriction.
Swift SVN r25512
2015-02-24 20:41:12 +00:00
Graham Batty
7346a9733d Update test and validation-test flags for linux.
Swift SVN r25506
2015-02-24 18:55:42 +00:00
Dave Abrahams
1badcbc14b [stdlib] Rename Slice => ArraySlice
Leave room for a generic Slice type in a later release.

Swift SVN r25493
2015-02-24 00:18:58 +00:00
Dmitri Hrybenko
10d8533e4b XFAIL the new regressions under AddressSanitizer
<rdar://problem/19919467> Interpreter/repl.swift regressed under ASan
<rdar://problem/19919459>
compiler_crashers/0214-swift-typebase-gettypeofmember.swift regressed
under ASan

Swift SVN r25483
2015-02-23 10:34:31 +00:00
Dave Abrahams
2cf5650b48 [stdlib] Fix two problems with Character<=>String
<rdar://problem/19803733> String#append(Character) is broken in Swift 1.2 (beta)
<rdar://problem/19809905> Swift 1.2: join does not work with Emoji strings

Swift SVN r25449
2015-02-21 01:14:14 +00:00
Chris Lattner
670dfcc6ab final validation test adjustments, it actually passes after these changes.
Swift SVN r25446
2015-02-21 00:19:29 +00:00
Chris Lattner
6712817f89 additional changes for the validation testsuite, that I missed
in the previous pass.


Swift SVN r25444
2015-02-21 00:12:43 +00:00
Chris Lattner
6d0a7c39e8 adjust the validation tests to the new if/let syntactic restrictions.
Thanks to Dmitri for doing almost all of this.


Swift SVN r25443
2015-02-20 23:56:30 +00:00
Dave Abrahams
cb68f83129 [stdlib] Fix OpenCL overlay test
Just replace it with a translation of some C sample code, and switch up
the way the kernel args are passed

Swift SVN r25426
2015-02-20 15:24:31 +00:00
Dave Abrahams
257c6d3e8c [stdlib] VarArgs overlay forwarding for OpenCL
Fixes <rdar://19051606> (OpenCL variadic clSetKernelArgsListAPPLE function unavailable)

Swift SVN r25412
2015-02-20 03:19:56 +00:00
Doug Gregor
a3b4b0903b Teach TypeChecker::resolveTypeInContext to use interface types more often.
When referring to a type declaration that is a member of some nominal
type, we were relying on substitution into the non-interface type,
which is silly. Use the interface type here.

Other than some type-printing differences, this should be NFC.

Slight regression in two compiler crashes that had been fixed in the
previous commit; I'll look into these shortly.

Swift SVN r25385
2015-02-19 00:58:44 +00:00
Doug Gregor
a34a457ce7 Teach TypeDecl::getDeclared(Interface)Type() about ErrorType.
Propagate the error rather than crashing. Fixes 25 crashes from the
test suite, covered by rdar://problem/19883429.

Swift SVN r25384
2015-02-19 00:58:42 +00:00
Maxwell Swadling
b1857d2452 [stdlib] added flatMap
fixes rdar://problem/19338087

Swift SVN r25378
2015-02-18 22:58:35 +00:00
Doug Gregor
3805e18090 Explicitly track the mapping from dependent types to their opened type variables.
Previously, we were reconstructing this mapping from the "full" opened
type produced by declaration references. However, when dealing with
same-type constraints between associated types and type parameters, we
could end up with an incomplete mapping, which let archetypes slip
through. Most of the churn here is sorting out the locators we need to
use to find the opened-type information. Fixes rdar://problem/18208283
and at least 3 dupes of it that I've found so far.

Swift SVN r25375
2015-02-18 19:41:40 +00:00
Dmitri Hrybenko
05906dbc16 Annotate crash tests that don't crash when the compiler is built without
assertions

Swift SVN r25350
2015-02-17 05:04:20 +00:00
Dmitri Hrybenko
d14dd26372 Annotate a crash test that does not crash anymore
Swift SVN r25348
2015-02-17 03:49:58 +00:00
Dmitri Hrybenko
51db8ec975 tests: dissolve PrimitiveDataTypes.swift in other test files
Swift SVN r25345
2015-02-17 03:27:24 +00:00
Dmitri Hrybenko
90b6348029 Annotate crasher tests where ASan does not detect issues anymore
Swift SVN r25297
2015-02-14 13:07:14 +00:00
Dmitri Hrybenko
8459b8418f Annotate two crash tests that don't crash anymore
Swift SVN r25296
2015-02-14 12:59:19 +00:00
Dmitri Hrybenko
f6faf8ad81 sil-opt: implement partial AST verification
... and use it to parallelize the parse_stdlib.sil test, which was
taking too long.

Swift SVN r25295
2015-02-14 11:48:11 +00:00
Jordan Rose
e635d6a993 In the spirit of r25276, break circularity with generic functions, too.
Also beef up the main test case a little.

I don't have a Radar, but this fixes 177 compiler_crashers!

Swift SVN r25281
2015-02-13 19:59:48 +00:00
Jordan Rose
b2dd3cea7c Update compiler_crashers for r25276.
Swift SVN r25277
2015-02-13 19:20:21 +00:00
Dmitri Hrybenko
4c8fad7f40 tests: add (failing) tests for mandatory inlining of && and ||
Swift SVN r25261
2015-02-13 01:14:13 +00:00
Dmitri Hrybenko
e0abaec0a7 tests: remove -verify from a stdlib parsing test, it is a no-op here
sil-opt -verify does diagnostic verification, like swift -verify.

Swift SVN r25260
2015-02-13 01:14:10 +00:00
Dmitri Hrybenko
d65d46562a tests: merge two tests for fixed point types
Swift SVN r25233
2015-02-12 11:26:01 +00:00
Dmitri Hrybenko
1dec9814bb Revert a chain of work-in-progress commits implementing readLine() that
I committed by mistake.

Swift SVN r25224
2015-02-12 02:33:21 +00:00
Dmitri Hrybenko
38a14768e7 Annotate a crasher test that is not crashing anymore
Swift SVN r25223
2015-02-12 02:29:00 +00:00
Dmitri Hrybenko
74e5b71b0f wip
Swift SVN r25222
2015-02-12 02:29:00 +00:00
Dmitri Hrybenko
cdb7850e0a stdlibunittest stdin wip
Swift SVN r25221
2015-02-12 02:28:59 +00:00
Dmitri Hrybenko
4bc91af128 Annotate that 0002-rdar19792768.swift only crashes with assertions
enabled

Swift SVN r25189
2015-02-11 19:36:42 +00:00
Ben Langmuir
afd4f98a6b Add XFAIL: no_asserts to compiler_crashers_2/0001-rdar19792730.swift
Swift SVN r25181
2015-02-11 17:33:30 +00:00
Dmitri Hrybenko
64ffcf43bf tests: check that array generators traverse a snapshot of the array
Swift SVN r25172
2015-02-11 07:12:26 +00:00
Dmitri Hrybenko
a99093581b stdlib: change {Dictionary,Set}.Generator to value semantics
Generator observes a snapshot of the collection.  Mutating the
collection should not have any effect on existing generators.

rdar://19726013

Swift SVN r25171
2015-02-11 07:12:25 +00:00
Dmitri Hrybenko
b76f6b27ec Add tests for compiler crasher bugs that I filed recently
If these tests start passing, we would conveniently know which bugs we
can close.

Swift SVN r25170
2015-02-11 07:12:19 +00:00
Dmitri Hrybenko
6f6ca68aaf stdlib: mark closures in Array.map() and Array.filter() with @noescape
rdar://19389247

Swift SVN r25131
2015-02-10 19:54:28 +00:00
Joe Groff
63463f54ac SIL: Mangle the static-ness of declarations.
This lets us disambiguate the symbols for static and instance properties, and enables us to eventually leave the useless "self" type mangling out of method symbols. Fixes rdar://19012022 and dupes thereof, including crasher #1341.

Swift SVN r25111
2015-02-10 02:37:35 +00:00
Denis Vnukov
152df92966 [CodeCompletion] Code Completion String getName should always return non-empty string value for
valid code completions. Code completion tests call and validate getName’s result. 

A minor fix for code completion fro subscripts.



Swift SVN r25101
2015-02-09 22:32:05 +00:00
Dmitri Hrybenko
a35767757e StdlibUnittest: add an asertion, expectUnreachable()
Swift SVN r25090
2015-02-09 05:39:26 +00:00
Dmitri Hrybenko
a477e5a857 Simplify substitutions used in the parse_stdlib.sil test
Swift SVN r25087
2015-02-09 00:25:27 +00:00