Commit Graph

1202 Commits

Author SHA1 Message Date
Chris Lattner
45f2cfaaa0 Implement SE-0099, but where the migration diagnostics are left as warnings
for now.  I'll upgrade them to errors in a week or two to give downstream
projects a chance to update.
2016-07-02 15:44:57 -07:00
Saleem Abdulrasool
83901998c9 Port for PS4
Add support for the PS4 OS.  Update the standard library and add a target unit
test.
2016-06-30 20:14:50 -07:00
swift-ci
1419fc962c Merge pull request #3178 from CodaFi/leak-by-example 2016-06-30 18:24:51 -07:00
Dmitri Gribenko
b8ba955198 stdlib: add a prototype implementation of a persistent vector 2016-06-30 00:49:02 -07:00
Robert Widmann
56f495c170 [WIP] Enable leaks tracking
This is part 1 of many to enable leaks tracking in the unit test suite.
 To compile with leak tracking enabled run

swift/utils/build-script -- --swift-runtime-enable-leak-checker
2016-06-28 19:22:54 -07:00
Rintaro Ishizaki
37dccea4bc [StdlibUnitTest] Fix argument order of defaulted parameters 2016-06-29 11:13:16 +09:00
Austin Zheng
dfcc13dc69 [stdlib] Bounds checks and tests for Unsafe*BufferPointer
Changes:
- Added bounds checks to Unsafe*BufferPointer's subscript getter and setter
- Added tests for Unsafe*BufferPointer's subscript getter for all four range types
2016-06-20 21:41:20 -07:00
Dmitri Gribenko
0892c2210e stdlib tests: fix indentation 2016-06-19 17:54:24 -07:00
swift-ci
004d85e448 Merge pull request #3043 from modocache/pr-2057-linux-sdk-overlay-fix 2016-06-18 18:41:37 -07:00
swift-ci
8f632a467c Merge pull request #3056 from austinzheng/az-fix-tests 2016-06-18 18:41:36 -07:00
Dmitri Gribenko
5dd3ce9195 Merge pull request #3020 from modocache/sr-1738-add-swift-library-shared-static-args
[SR-1738] add_swift_library takes SHARED/STATIC arg
2016-06-18 15:38:57 -07:00
Austin Zheng
f074bf7f03 [stdlib] Fixing several collection-related tests
Changes:
- Parameterized a number of tests in CheckCollectionType.swift.gyb expected to crash during one or more runthroughs
- Fixed an issue with the tests uncovered by this change
2016-06-17 22:35:00 -07:00
Austin Zheng
9138b73097 [stdlib] Addressing Dmitri Gribenko's feedback re #2993
Changes:
- Moved only-used-once helper methods into call sites
- Parameterized tests that might expect a crash
- Fixed some comments and formatting; renamed some test helper APIs
2016-06-17 00:26:27 -07:00
Brian Gesiak
83daa49a5a [CMake] Only build StdlibUnittest when SDK overlay is built
On Linux it used to be possible to build only the stdlib, without the
SDK overlays, like so:

```
utils/build-script -- --build-swift-stdlib --build-swift-sdk-overlay=0
```

However this invocation now results in the following error:

```
+ /usr/bin/cmake --build /home/modocache/GitHub/apple/build/Ninja-ReleaseAssert/swift-linux-x86_64 -- -j8 all swift-stdlib-linux-x86_64
ninja: error: '/home/modocache/GitHub/apple/swift/stdlib/private/SwiftPrivatePthreadExtras/swiftGlibc-linux-x86_64', needed by 'stdlib/private/SwiftPrivatePthreadExtras/linux/x86_64/SwiftPrivatePthreadExtras.o', missing and no known rule to make it
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
```

The problem is that SwiftPrivatePthreadExtras is always built, regardless
of whether the SDK overlay is built. I believe there's an explicit check
against this for Darwin platforms to prevent the same error.

The solution, implemented here, is to add the same check for Linux.
2016-06-16 14:29:30 -04:00
Austin Zheng
51f19eafdf [stdlib] Adding new indices model tests (#2991)
* [stdlib] Adding new tests for collection indices

Changes:
- Added tests for 'index(next:)'
- Added tests for all 'formIndex' API variants
- Modified existing tests to better test bidirectional collections

* Fixes reflecting review feedback
2016-06-16 10:53:47 -07:00
Brian Gesiak
328de9e280 [SR-1738] add_swift_library takes SHARED/STATIC arg
As a first step to allowing the build script to build *only*
static library versions of the stdlib, change `add_swift_library`
such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`.

Ideally, only these flags would be used to determine whether to
build shared, static, or object libraries, but that is not currently
the case -- `add_swift_library` also checks whether the library
`IS_STDLIB` before performing certain additional actions. This will be
cleaned up in a future commit.
2016-06-16 13:15:58 -04:00
Austin Zheng
4872e546b0 [stdlib] Adding tests for removeSubrange overloads for range types 2016-06-14 23:57:49 -07:00
Austin Zheng
6042ee0244 [gardening] Add .self to suppress compiler warnings 2016-06-14 18:24:29 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Doug Gregor
2807a17eb8 [Type checker SR-899] Warning on missing ".self" for single-parameter functions.
Due to a modeling error in the type checker's folding of type
references into type expressions, code such as "strideof(Int)" would
be accepted without the required ".self". Commit
4a60b6cbf4 fixes the modeling issue but
left the historical accepts-invalid; now, diagnose these cases with a
warning + Fix-It to ease the transition.

Fixes SR-899.
2016-06-12 22:31:59 -07:00
practicalswift
c74273dfd1 [gardening] Remove "-*- swift -*-" from non-.gyb file. 2016-06-12 19:03:54 +02:00
Dmitri Gribenko
6f139d7b5a Merge pull request #2975 from trentxintong/MISC
Limit inlining for stdlibunittest. This saves a lot of compilation time
2016-06-09 18:29:44 -07:00
Xin Tong
6430525edc Limit inlining for stdlibunittest. This saves a lot of compilation time
for some of the stdlibunittests.

i.e. For the FixPoint benchmark, from 256s on my machine to 27s.

rdar://26688483
2016-06-09 16:04:43 -07:00
Dmitri Gribenko
837fc58861 Merge pull request #2947 from practicalswift/fix-rangeselection-header
[gardening] Fix recently introduced header.
2016-06-09 01:12:32 -07:00
Dave Abrahams
4fbed473e2 Add a missing @discardableResult 2016-06-08 11:35:16 -07:00
practicalswift
13e7e8db87 [gardening] Fix recently introduced header. 2016-06-08 09:40:10 +02:00
Austin Zheng
fa6c028edf Adding tests for replaceSubrange overloads for range types (#2774) 2016-06-07 14:21:30 -07:00
Dmitri Gribenko
8f118750a4 StdlibUnittest: add tests for expectEqual() on tuples 2016-06-04 02:33:30 -07:00
Dmitri Gribenko
fb6fb95fe2 Merge pull request #2801 from natecook1000/nc-nextup
[stdlib] Fix error in nextUp and nextDown
2016-06-02 14:31:45 -07:00
swift-ci
7c98b492e8 Merge pull request #2841 from ahoppen/SR-1236-tests-update 2016-06-02 11:38:34 -07:00
Nate Cook
b76630735a [stdlib] Add tests for FloatingPoint's nextUp and nextDown 2016-06-02 11:11:07 -05:00
Alex Hoppen
2108a235df [Tests] Update existing tests for the upcoming implementation of SE-0036 2016-06-02 17:50:55 +02:00
rintaro ishizaki
6401324993 [stdlib] Apply tail style "where" clause to stdlib/{internal,private} 2016-06-02 12:01:21 +09:00
Dmitri Gribenko
a1e73a6b0d CMake: remove dead code 2016-05-31 21:57:07 -07:00
Vivian Kong
59e80c5dda Change the type of _stdlib_fd_set._data to [UInt] so that it also works correctly for 64-bit big-endian systems. 2016-05-24 20:03:56 -04:00
Bryan Chan
85fde8b1fb Add support for Linux s390x. LLVM's Swift calling convention support is used to ensure correct operations of C++ code in the runtime. This patch also includes some (incomplete) changes to enum handling to make enums work in most common cases. 2016-05-24 20:03:28 -04:00
Dmitri Gribenko
296e2ae835 stdlib: implement reverse() as proposed in SE-0078 2016-05-24 00:37:28 -07:00
David Farler
8f86719f9f Add more Remote Mirror closure tests with different arity/capture count 2016-05-23 16:34:54 -07:00
Dmitri Gribenko
34ee9790db Merge pull request #2643 from apple/stdlib-unittest-fail-if-child-crashes-at-exit
[WIP] StdlibUnittest: fail if child crashes at exit
2016-05-22 18:42:27 -07:00
Dmitri Gribenko
9574d03dfa StdlibUnittest: ask the child process to terminate, and check its termination status
If a child process crashes outside of a test context, the parent process
should signal test failure. This behavior is a sign of something bad
happening in the child (for example, memory corruption), and should not
go unnoticed.
2016-05-22 17:17:16 -07:00
Dmitri Gribenko
312545bfba Merge pull request #2537 from russbishop/se0017
[stdlib] SR-1485: Implement SE-0017: Change Unmanaged to use UnsafePointer
2016-05-22 17:02:57 -07:00
Russ Bishop
3da2492da9 SR-1485: Change Unmanaged to use UnsafePointer 2016-05-22 15:12:09 -07:00
Dmitri Gribenko
27a6be9897 StdlibUnittest: add labels to boolean return values 2016-05-22 14:37:53 -07:00
Dmitri Gribenko
d7dd6bdae3 StdlibUnittest: replace a magic value with an optional 2016-05-22 14:37:53 -07:00
Dmitri Gribenko
cd312ae12c StdlibUnittest: refactor child I/O code
Detangle protocol parsing logic from I/O handling.
2016-05-22 14:37:53 -07:00
David Farler
a38a4ce596 SwiftRemoteMirror: Turn on reflection metadata by default
Flip the enable flags to disable and make these IRGen options
true by default.

rdar://problem/26206547
2016-05-21 17:40:37 -07:00
Dmitri Gribenko
227cfa1695 StdlibUnittest: add a simple API for race tests 2016-05-20 14:23:31 -07:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
David Farler
e42fd92fbb SwiftReflectionTest: Don't exit until the parent asks for an instance
Child processes were exiting too early before the parent has a chance
to read a null pointer from the child, indicating that there are no
more instances to reflect. This wasn't a problem on OS X because the
I/O latency is so small compared to the iOS simulator, where the
problem would come up under heavy load. This makes the end-to-end
remote mirror tests deterministic again.

rdar://problem/26230879
2016-05-18 02:27:53 -07:00
Dmitri Gribenko
b7984be446 stdlib: always check that IteratorProtocol.next() repeatedly returns nil
This is required by SE-0052.
2016-05-15 23:55:48 -07:00