Commit Graph

129 Commits

Author SHA1 Message Date
taylor swift
c85880899d implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods 2017-11-17 21:28:03 -08:00
Lance Parker
1c32c22304 Skip inconsistent ArrayNew tests 2017-09-27 12:52:07 -07:00
Max Moiseev
2686865c86 [test] XFAIL NewArray test cases for iOS and tvOS devices
<rdar://problem/33926468>
2017-08-18 16:25:38 -07:00
Joe Shajrawi
66d0df6bae Revert "Temporary disable failing armv7 tests"
This reverts commit 78e5e25215.
2017-08-15 13:43:57 -07:00
Joe Shajrawi
78e5e25215 Temporary disable failing armv7 tests 2017-08-08 15:22:14 -07:00
Michael Gottesman
ab6a4f5249 Disable some failing tests.
rdar://33358110
2017-07-19 16:25:39 -07:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Jordan Rose
88a4fbbbd7 [test] Update existing tests for array parameters with nullability.
No functionality change. These parameters were IUOs before; now
they're (correctly) true optionals.
2016-11-14 13:15:17 -08:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Dmitri Gribenko
987acd375d stdlib: make tests rely on Array implementation details less 2016-08-07 14:20:36 -07:00
Doug Gregor
b9363fe6bd [SE-0111] Enable SE-0111 by default. 2016-07-29 17:28:24 -07:00
Andrew Trick
a18d490d6a Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3773)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 14:21:15 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
Joe Groff
21c15d8fe9 Update validation tests for id-as-Any. 2016-07-25 06:40:37 -07:00
Andrew Trick
5a8271c621 Rename UnsafePointer allocate & deallocate. (#3608)
As proposed in SE-0107: UnsafeRawPointer:
Rename 'init(allocatingCapacity:)' to 'UnsafeMutablePointer.allocate(capacity:)'
Rename 'deallocateCapacity' to 'deallocate(capacity:)'

`allocate` should not be an initializer. It's primary function is to allocate
memory, not initialize a pointer.
2016-07-19 11:48:18 -07:00
Dave Abrahams
b21d8bea92 [stdlib] Bridging [aClass] to ObjC in O(1) (redux #2)
There's no need for a deferred conversion in these cases.

This time committing ALL the changes needed to get the validation tests to pass.
2016-07-14 12:45:54 -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
Rintaro Ishizaki
1bdce7ced6 [lit] Add substitutions: %utils and %line-directive
%utils => ${SWIFT_SOURCE_DIR}/utils
%line-directive => ${SWIFT_SOURCE_DIR}/utils/line-directive
2016-06-11 02:41:15 +09:00
Rintaro Ishizaki
4d686a424f [Parser] Don't report AttrsRequiringFoundation in inactive config block
Fixes rdar://problem/23487944
2016-05-26 02:43:21 +09:00
Rintaro Ishizaki
9c55ad1396 [stdlib] Enable ArrayNew.swift.gyb validation test on non-Darwin platforms 2016-05-16 22:44:24 +09:00
practicalswift
c2107f456c [gardening] "[ a, b ]" → "[a, b]" (#2227) 2016-04-17 21:02:18 +02:00
Jordan Rose
315761c4cf [ClangImporter] Don't assume inner pointers are nullable.
Some inner pointers are explicitly annotated as _Nonnull, and we
should believe that. This is important when passing, say, pointers
to arrays.
2016-04-11 20:06:41 -07:00
Jordan Rose
bc83940301 Make pointer nullability explicit using Optional.
Implements SE-0055: https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md

- Add NULL as an extra inhabitant of Builtin.RawPointer (currently
  hardcoded to 0 rather than being target-dependent).
- Import non-object pointers as Optional/IUO when nullable/null_unspecified
  (like everything else).
- Change the type checker's *-to-pointer conversions to handle a layer of
  optional.
- Use 'AutoreleasingUnsafeMutablePointer<NSError?>?' as the type of error
  parameters exported to Objective-C.
- Drop NilLiteralConvertible conformance for all pointer types.
- Update the standard library and then all the tests.

I've decided to leave this commit only updating existing tests; any new
tests will come in the following commits. (That may mean some additional
implementation work to follow.)

The other major piece that's missing here is migration. I'm hoping we get
a lot of that with Swift 1.1's work for optional object references, but
I still need to investigate.
2016-04-11 20:06:38 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Dmitri Gribenko
8f48d85d9e Array tests: split Objective-C-independent tests into a new file
And also merge the small test/1_stdlib/ArrayCore.swift test into it.
2016-03-21 23:27:03 -07:00
Doug Gregor
d92ae77076 Eliminate most remaining uses of _convertNSFooToFoo and _convertFooToNSFoo.
Generalized bridging has fully subsumed most of these. NSError is
still special, and _convertStringToNSString remains for the the
runtime's implementation of SwiftObject's -description method.
2016-03-18 11:42:00 -07:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
Max Moiseev
859db53d87 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-01 12:56:26 -08:00
Emanuel Zephir
a4e8ee04e0 [StdLib] Refactor DictionaryKeyValueTypes test input data
Split the input file into a pure Swift and Objective-C interop files in
anticipation of refactoring tests to remove XFAILs on Linux.
2016-02-29 22:49:35 -08:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Daniel Duan
2bc78b8c09 [stdlib] update for 'inout' adjustment (SE-0031) 2016-02-26 12:02:29 -08:00
Jordan Rose
e4e9c71d8f StdlibUnittest: Rename enum cases and static vars to match API guidelines. 2016-02-24 18:23:59 -08:00
Max Moiseev
bb3eaaf308 Merging in latest master 2016-02-24 15:10:25 -08:00
Dmitri Gribenko
e18d70a913 Merge pull request #1415 from Jnosh/array-types-validation-tests
Run collection unit tests on array types
2016-02-23 20:47:44 -08:00
Janosch Hildebrand
3c4bb1d657 [stdlib] Replace uses of ++ in validation tests 2016-02-24 01:59:18 +01:00
Janosch Hildebrand
4fba2ffbed [stdlib] Run collection unit tests on array types
... and locate them with the RangeReplaceableCollectionType tests on the array types.
2016-02-24 00:00:33 +01:00
Dmitri Gribenko
f0633ce5a9 stdlib: Sequence.iterator() => .makeIterator() 2016-02-23 13:52:30 -08:00
Dmitri Gribenko
196188b9c8 stdlib: add 'to:' label to dump() 2016-02-22 18:16:38 -08:00
Max Moiseev
40b1a0b7e0 [stdlib] all sorts of require renamed back to precondition 2016-02-19 18:21:29 -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
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -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
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Austin Zheng
77918a86ac [SR-88] Reinstate Mirror migration changes, fix test issues
This reverts commit 182bb7f812.
2016-01-27 20:40:52 -08:00
Andrew Trick
182bb7f812 Revert "Merge pull request #1058 from austinzheng/az-port-mirror"
This pull request broke the following tests on several build configurations
(eg --preset=buildbot,tools=RA,stdlib=DA)

    1_stdlib/Reflection.swift
    1_stdlib/ReflectionHashing.swift
    1_stdlib/UnsafePointer.swift.gyb

This reverts commit c223a3bf06, reversing
changes made to 5c2bb09b09.
2016-01-27 10:43:08 -08:00
Austin Zheng
10d5b23c30 [SR-88] Reinstate mirror migration commit
Changes:
- Reverted commit reverting original SR-88 commit
- Removed mirror children helper collections and related code
- Rewrote some tests to keep them working properly
- Wrote two more tests for the three pointer APIs to ensure no crashes if created using a value > Int64.max

This reverts commit 8917eb0e5a.
2016-01-26 19:28:32 -08:00