Commit Graph

2015 Commits

Author SHA1 Message Date
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
Maxwell Swadling
b1857d2452 [stdlib] added flatMap
fixes rdar://problem/19338087

Swift SVN r25378
2015-02-18 22:58:35 +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
4c8fad7f40 tests: add (failing) tests for mandatory inlining of && and ||
Swift SVN r25261
2015-02-13 01:14:13 +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
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
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
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
Dmitri Hrybenko
a35767757e StdlibUnittest: add an asertion, expectUnreachable()
Swift SVN r25090
2015-02-09 05:39:26 +00:00
Dmitri Hrybenko
82828ae5a4 tests: use line-directive to run generated tests
Swift SVN r25026
2015-02-06 01:10:58 +00:00
Dmitri Hrybenko
e4b1cbeb64 stdlib: remove .null() static factories on unsafe pointers
These APIs are redundant with nil literals and the default initializer.

rdar://19159145

Swift SVN r24957
2015-02-04 11:17:55 +00:00
Dmitri Hrybenko
34d393bd22 stdlib: stop using AutoreleasingUnsafeMutablePointer.null()
Swift SVN r24956
2015-02-04 11:17:54 +00:00
Dmitri Hrybenko
f04e0d9748 tests: simplify RUN lines
Swift SVN r24954
2015-02-04 11:17:53 +00:00
Dmitri Hrybenko
5bc75e821a Use a relative path for the in-tree symlink
Swift SVN r24953
2015-02-04 11:17:52 +00:00
Dave Abrahams
f16398c6db [stdlib] Clean up unintentionally committed dump()s
Swift SVN r24937
2015-02-04 03:21:18 +00:00
Dave Abrahams
ed8c302a93 [stdlib] Move tests that challenge a debug compiler
...into the validation suite.  This is the wrong solution but at least
the bots will continue to run all the tests and we won't regress.

Swift SVN r24934
2015-02-04 01:53:14 +00:00
Joe Pamer
9c2bc50acd In some cases, the same type error will result in different diagnostics being emitted between ARM and x86 targets.
Addressing rdar://problem/19434979 will allow us to swizzle expected errors based on build configuration options,
but until I can push that change we should generalize a few of the expected errors in the FixedPointDiagnostics test,
and re-enable the test on ARM.

Swift SVN r24910
2015-02-03 00:35:09 +00:00
Dmitri Hrybenko
9ade11ae39 XFAIL FixedPointDiagnostics.swift.gyb on armv7 in addition to arm64
<rdar://problem/19677545> Type checker diagnostics differ between
platforms for "var a: UInt8 = -(1)"

Swift SVN r24891
2015-02-02 07:14:36 +00:00
Dmitri Hrybenko
3407325ad4 XFAIL FixedPointDiagnostics.swift.gyb for arm64 because of:
<rdar://problem/19677545> Type checker diagnostics differ between
platforms for "var a: UInt8 = -(1)"

Swift SVN r24884
2015-02-01 06:05:48 +00:00
Dmitri Hrybenko
8ab8730f73 tests: update CoreAudio test for 32-bit iOS simulator
Swift SVN r24845
2015-01-30 05:10:32 +00:00
Dmitri Hrybenko
cc12389c2e tests: update CoreAudio test for 32-bit iOS simulator
Swift SVN r24844
2015-01-30 05:07:03 +00:00
Dmitri Hrybenko
1ca5bc414e stdlib: add an overlay for AudioBufferList
AudioBufferList contains a fake flexible array member, and is not
imported in a useable way.

rdar://18536929

Swift SVN r24843
2015-01-30 04:17:49 +00:00
Dmitri Hrybenko
203175909d StdlibUnittest: add a command line option to run specific tests
rdar://19572835

Swift SVN r24841
2015-01-30 04:17:44 +00:00
Dmitri Hrybenko
f4e35f90eb stdlib: remove Unsafe[Mutable]Pointer.null()
This API is redundant with nil literals and the default initializer.

rdar://19159145

Swift SVN r24796
2015-01-28 08:42:28 +00:00
Dmitri Hrybenko
b7e61965eb Remove redundant test
Swift SVN r24696
2015-01-24 00:12:21 +00:00
Dmitri Hrybenko
cb2870c230 Update Unicode data files to 7.0.0
rdar://17561742

Swift SVN r24692
2015-01-23 22:17:45 +00:00
Dmitri Hrybenko
7209392bb4 stdlib/Unicode: fix encoding U+20000 and higher to UTF-16
UTF16.{leadSurrogate,trailSurrogate} were converting intermediate
results to UInt16 too soon, causing a trap on U+20000 and higher.

rdar://19156359

Swift SVN r24678
2015-01-23 04:47:02 +00:00
Dmitri Hrybenko
3087d186cb tests: use a more appropriate test name and remove a redundant test
Swift SVN r24676
2015-01-23 03:29:31 +00:00
Dmitri Hrybenko
bbf79427ac stdlib: remove bitwise operations on Bool
Bitwise operations on Bool are redundant with other logic operations
that stdlib already provides.  The only reason to have them was to avoid
branching in the short-circuiting && and ||.

rdar://19340952

Surprisingly, replacing & and | in the standard library with && and ||
brought performance improvements and no significant performance
regressions:

RecursiveOwnedParameter 1.14
SelectionSort 1.19

Swift SVN r24674
2015-01-23 03:09:55 +00:00
Dmitri Hrybenko
2d12d510f2 Lowercase the first character in compiler diagnostics for consistency
Swift SVN r24634
2015-01-22 06:19:14 +00:00
Dmitri Hrybenko
9257f00d27 Update validation tests for compiler changes
Swift SVN r24633
2015-01-22 06:03:46 +00:00
Maxwell Swadling
007e94c571 [stdlib] updated error message in validation tests
Swift SVN r24616
2015-01-21 23:35:56 +00:00
Flash Sheridan
3a074e5a50 Assign the result of binary operations to a variable, in preparation for checking its type in my next check-in.
Ugly (both in layout and functionality) workaround for Gyb rdar://15928178, using operator if/else if/else instead of if/elif statements;
this was fiddly to get working, hence the separate check-in.
Sharpen the expected error string for mixed type operators, and add an expected warning and note for assigning the result of
an assignment, which is righteous since we're not C.
Approved by Dmitri.


Swift SVN r24586
2015-01-21 03:54:48 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Chris Willmore
68dd563fbf <rdar://problem/18311362> TLF: Eliminate implicit bridging conversions
Require 'as' when converting from Objective-C type to native type (but
continue to allow implicit conversion from native to Objective-C). This
conversion constraint is called ExplicitConversion; all implicit
conversions are covered by the existing Conversion constraint. Update
standard library and tests to match.

Swift SVN r24496
2015-01-18 00:07:45 +00:00
Flash Sheridan
420b05735e Purely cosmetic changes, with a count comment and noting what each %end is closing, to make it easier to track (in both the gyb source and the Swift output) the functional changes I'm struggling with.
Swift SVN r24494
2015-01-17 03:44:43 +00:00
Andrew Trick
e2760a7036 Add a return statement to Variant[Set|Dictionary]Storage.removeAtIndex.
This fast path is only taken when the code is specialized.
Fixes <rdar://problem/19331717> Optimizer breaks Set<T> and Dictionary<K, V>

Swift SVN r24479
2015-01-16 21:10:48 +00:00
David Farler
87c3d7421f Refine static func and var syntax
rdar://problem/17198298

- Allow 'static' in protocol property and func requirements, but not 'class'.
- Allow 'static' methods in classes - they are 'class final'.
- Only allow 'class' methods in classes (or extensions of classes)
- Remove now unneeded diagnostics related to finding 'static' in previously banned places.
- Update relevant diagnostics to make the new rules clear.

Swift SVN r24260
2015-01-08 03:03:29 +00:00
Chris Willmore
03a6190a1f <rdar://problem/19031957> Change failable casts from "as" to "as!"
Previously the "as" keyword could either represent coercion or or forced
downcasting. This change separates the two notions. "as" now only means
type conversion, while the new "as!" operator is used to perform forced
downcasting. If a program uses "as" where "as!" is called for, we emit a
diagnostic and fixit.

Internally, this change removes the UnresolvedCheckedCastExpr class, in
favor of directly instantiating CoerceExpr when parsing the "as"
operator, and ForcedCheckedCastExpr when parsing the "as!" operator.

Swift SVN r24253
2015-01-08 00:33:59 +00:00
Flash Sheridan
c5ebf4f2b5 Add tests for Float80, but only on the desktop; which is tricky, since Gyb doesn't know its destination.
Now 3835 tests.  Reviewed by Dmitri.

Swift SVN r24237
2015-01-07 04:58:25 +00:00
Dmitri Hrybenko
d7179e3c03 Consolidate arithmetic trap tests
Reduces iOS testing time by 25 seconds (machine time, not wall clock
time).

Swift SVN r24086
2014-12-22 23:58:41 +00:00
Flash Sheridan
c11eb40008 Iterate over more documented operators, now that the documentation has improved; now 3460 tests.
Replace hard-coded lists of real-number types, and of arithmetic and logical operators I’m testing, with lists added to SwiftIntTypes.py, which becomes a bit of a misnomer.  
Separate them into ones which only work on integer types, and those which also allow reals.
Do a double loop, over just the integers and then the reals as well.
Change the run line to allow importing StdlibUnittest with help from Dmitri, which I won't actually need until I do result type checking.

Approved by Dmitri.

Swift SVN r24029
2014-12-19 04:20:03 +00:00
Joe Pamer
dc338c2a71 Update wording of some new diagnostics.
Swift SVN r23783
2014-12-08 21:56:52 +00:00