Commit Graph

2121 Commits

Author SHA1 Message Date
Mike Ash
bcd9db5a2c [Test] Fix the dlopen_race test to work with remote-run.
The dylib needs to be passed as a command line parameter so that remote-run knows to copy it across.

rdar://problem/51903298
2019-06-19 14:35:50 -04:00
Mike Ash
b70cd7031f Merge pull request #25150 from mikeash/dlopen-race
[Runtime] Fix a race with dlopen and libobjc.
2019-06-18 11:48:49 -07:00
Karoy Lorentey
194dba6c69 Merge pull request #25454 from lorentey/nsvalue-availability
[Foundation] Set correct availability on NSValue.value(of:)
2019-06-17 12:25:17 -07:00
Mike Ash
2ac0ab069a [Runtime] Use objc_addLoadImageFunc when available to find out about newly loaded images.
rdar://problem/49742015
2019-06-14 17:09:28 -04:00
Mike Ash
7696a76577 [Runtime] Add a test case for a race with dlopen and libobjc.
rdar://problem/49742015
2019-06-14 15:06:40 -04:00
Sam Lazarus
2cefbe0d78 Test: Update additional tests with improved generic mismatch diagnostic 2019-06-14 12:35:32 -04:00
Sam Lazarus
de7851b0e9 Test: Update tests to reflect change to generic mismatch note locations 2019-06-14 12:35:32 -04:00
Sam Lazarus
81dc5460c9 Sema / Test: Fix tests broken by introduction of GenericArgumentsMismatchFailure
Additionally, fixed a crash caused by the change relating to opaque types.
2019-06-14 12:35:31 -04:00
Karoy Lorentey
8ae76342f8 [Foundation] Set correct availability on NSValue.value(of:)
(cherry picked from commit 35a47b3a55e113fd1212485b85d808427ccf5dea)
2019-06-13 20:10:06 -07:00
Stephen Canon
2df36527d3 Provide a default implementation of multipliedFullWidth (#25346)
* Provide a default implementation of multipliedFullWidth

Previously, [U]Int64 fatalErrored on 32b platforms, which is obviously undesirable. This PR provides a default implementation on FixedWidthInteger, which is not ideally efficient for all types, but is correct, and gives the optimizer all the information that it needs to generate good code in the important case of Int64 arithmetic on 32b platforms. There's still some minor room for improvement, but we'll call that an optimizer bug now.

* Clarify comments somewhat, remove `merge` nested function

I was only using `merge` in one place, so making it a function seems unnecessary. Also got rid of some trucatingIfNeeded inits where the compiler is able to reason that no checks are needed anyway.

* Add some basic test coverage specifically for multipliedFullWidth

* Fix typo, further clarify bounds comments.

* Make new defaulted implementation @_aEIC so we don't need availability.
2019-06-11 22:02:48 -07:00
Saleem Abdulrasool
9f070edc17 Merge pull request #25308 from Azoy/demangle-bug-thing
[Runtime] swift_demangle: Update buffer size after copying
2019-06-11 16:56:57 -07:00
Julian Lettner
105e4ad592 [TSan] Add positive test for TSan + Dispatch on Linux
1) Enable tests that use `import Dispatch` on Linux. Add substitution
   `%import-libdispatch` that needs to be used for all cross-platform
   tests (i.e., tests that are intended to be run on other platforms
   than Darwin) that do `import Dispatch` or enable thread sanitizer.

2) Make sure as many existing Dispatch and TSan tests as possible run on
   Linux. Mark tests that would require substantial work with
   `UNSUPPORTED: OS=linux-gnu`.

3) Add integration-style Swift test that shows that TSan finds a simple
   race when using `Dispatch.async` incorrectly. A more complete test
   suite for TSan's libdispatch support lives on the LLVM/compiler-rt
   side.

rdar://problem/49177535
2019-06-10 14:24:53 -07:00
Saleem Abdulrasool
62cb79b536 Merge pull request #25213 from compnerd/standard-validation
validation-test: adjust stdlib tests for Windows
2019-06-10 11:35:04 -07:00
Steve (Numerics) Canon
4b5a85a34d Fix a bug in root and add a test case for it.
For odd roots of negative values, we need to take the root of the *magnitude* of the number to avoid a NaN from the platform's implementation of `pow`, then restore the sign afterwards. We had the basic logic in place already, but were missing the step of taking the magnitude first. Also modified a test case to find this error.
2019-06-10 11:50:36 -04:00
Azoy
9bbb85323a add demangle truncate test 2019-06-09 13:54:10 -05:00
Mishal Shah
6c69c8d0bb Merge pull request #25135 from porglezomp-misc/fix/stdlib-unittest-over-release
FIx an overrelease in StdlibUnittest's getSystemVersionPlistProperty
2019-06-03 13:35:04 -07:00
Saleem Abdulrasool
1c41c0887c validation-test: adjust stdlib tests for Windows
The embedded shell script in the RUN command for lit is problematic for
non-sh shell environments (i.e. Windows).  This adjusts the tests to
uniformly build the code for the ObjC runtime.  However, the Objective-C
code is only built under the same circumstances that it is currently
enabled - the availability of the needed frameworks.  The empty object
on other runtimes will have no material impact.  The swift side of it
checks whether the runtime is built with ObjC interop.  This allows us
to largely use the same command line for all the targets.  The last
missing piece is that the `-fobjc-runtime` requires that we run a modern
ObjC runtime.  We enable this unconditionally in lit for the non-Apple
targets.

This improves the validation test coverage for the standard library on
Windows.
2019-06-03 08:36:22 -07:00
Karoy Lorentey
fb55fc3be8 [redux][Foundation] Fix availability of NSValue.value(of:) (#25179)
* [Foundation] Fix availability of NSValue.value(of:)

(cherry picked from commit fbe5563d60)

* [Foundation] NSValue.value(of:): Reinstate runtime OS version check
2019-05-31 17:36:24 -07:00
Pavel Yaskevich
2f3809c5b3 Merge pull request #25149 from xedin/diag-missing-generic-args
[ConstraintSystem] Detect and diagnose missing generic arguments
2019-05-31 13:04:00 -07:00
Arnold Schwaighofer
b31b7a9d8e Remove some UNSUPPORTED swift_test_mode_optimize_none_with_implicit_dynamic
rdar://51228899
2019-05-31 08:45:37 -07:00
Cassie Jones
b7c17988a0 Mark StdlibUnittestOverrelease test as REQUIRES: foundation 2019-05-30 09:05:03 -07:00
Cassie Jones
2d21059030 Fix an over-release in StdlibUnittest
Fixes rdar://51245681
2019-05-29 18:01:39 -07:00
Pavel Yaskevich
c30845fa74 [ConstraintSystem] Detect and diagnose missing generic arguments
Introduce a fix to detect and diagnose situations when omitted
generic arguments couldn't be deduced by the solver based on
the enclosing context.

Example:

```swift
struct S<T> {
}

_ = S() // There is not enough context to deduce `T`
```

Resolves: rdar://problem/51203824
2019-05-29 16:39:41 -07:00
Tatsuya Tanaka
01fc3fe893 Refactor CaseIterableTests 2019-05-29 12:17:41 +09:00
Tatsuya Tanaka
074e310130 make allCases tests more strict 2019-05-28 13:29:19 +09:00
swift-ci
b088acb66e Merge pull request #24767 from ikesyo/remove-unnecessary-breaks 2019-05-25 16:15:06 -07:00
David Smith
2dcd82239b Merge pull request #24874 from Catfish-Man/bulk-tests
Test foreign strings on invalid content more thoroughly
2019-05-22 16:28:23 -07:00
Bob Wilson
2e12ac8d74 Merge pull request #24836 from bob-wilson/rdar50173830
[Test] Conditionalize KVOKeyPaths tests that only work with Swift 5.1
2019-05-21 09:38:24 -07:00
David Smith
7561f95134 Test foreign strings on invalid content more thoroughly 2019-05-17 16:18:34 -07:00
Bob Wilson
1e3317be78 [Test] Conditionalize KVOKeyPaths tests that only work with Swift 5.1
Some of the tests in KVOKeyPaths.swift check problems that were not fixed
until Swift 5.1 so they are not expected to pass when running with the
5.0 libraries.

rdar://problem/50173830
2019-05-16 12:57:25 -07:00
swift-ci
aa6827a46d Merge pull request #24796 from ravikandhadai/oslog-optimization 2019-05-15 13:01:37 -07:00
swift-ci
d1cc7136dd Merge pull request #23793 from phausler/data_mapped_perf_bug 2019-05-15 07:58:32 -07:00
Brent Royal-Gordon
dce879f508 Revert "[Foundation] Fix availability of NSValue.value(of:)" 2019-05-15 05:17:42 -07:00
Ravi Kandhadai
9be4fef53a [SIL Optimization] Add a mandatory optimization pass for optimizing
the new os log APIs based on string interpolation.
2019-05-14 18:08:59 -07:00
Philippe Hausler
8a751bd4de Add tests and validate Data and DispatchData as sequences 2019-05-14 17:12:44 -07:00
Bob Wilson
6160545800 Merge pull request #24498 from lorentey/nsvalue-availability
[Foundation] Fix availability of NSValue.value(of:)
2019-05-14 15:22:22 -07:00
Bob Wilson
1d98709131 [Test] Add runtime 9999-availability check for a new test in Swift 5.1
The testEncodingMultipleNestedContainersWithTheSameTopLevelKey check is new
in Swift 5.1 and will not pass when running with a 5.0 stdlib.

rdar://problem/50151131
2019-05-14 12:27:27 -07:00
Sho Ikeda
6eead16283 [gardening] Remove unnecessary breaks 2019-05-15 00:54:33 +09:00
Mike Ash
5c6a93ef2b [Test] Delete ErrorBridgedStatic test.
This test checks that error bridging with ObjC bridging works when the stdlib is statically linked. We no longer support static linking of the stdlib on platforms with ObjC interop.

rdar://problem/49699316
2019-05-10 12:07:24 -04:00
Mike Ash
893e291739 [Runtime] Add a test for +class and +self overrides.
rdar://problem/49853091
2019-05-09 13:11:05 -04:00
Daniel Rodríguez Troitiño
3658b6c786 Merge pull request #24550 from drodriguez/android-enable-some-more-tests
[android] Enable some tests that should pass on Android.
2019-05-07 11:01:13 -07:00
Karoy Lorentey
ae5884e7d3 [test] TestNotification: Check availability before running hashing test
The Foundation overlay had a different hash encoding for TestNotification.
2019-05-06 18:45:02 -07:00
Daniel Rodríguez Troitiño
1813cc3670 [android] Enable some tests that should pass on Android.
Some tests are limited to only Linux, when they should also pass for
Android.

Additionally, InputStream.swift.gyb was disabled for Android ARMv7, but
wasn't for Android AArch64, which allow me to find the error on it and
fix it on #24521.

Finally, StringLowercasedUppercased is interesting in Android because it
checks the used ICU is correct for performing the tasks that the stdlib
needs.
2019-05-06 17:53:51 -07:00
Brent Royal-Gordon
7311886219 Merge pull request #24334 from brentdax/wherefore-art-thou-api
[TypeChecker] Rephrase platforms in availability diagnostics
2019-05-06 11:00:03 -07:00
Karoy Lorentey
d6a6315e76 Merge pull request #24496 from lorentey/stdlib-version-checks-alt
[test] Add availability guards for tests checking behavioral changes in 5.1
2019-05-06 10:24:32 -07:00
Karoy Lorentey
fbe5563d60 [Foundation] Fix availability of NSValue.value(of:) 2019-05-03 19:55:03 -07:00
Karoy Lorentey
211aae1574 [test] Array: Add availability guard to crash test
Array.init(unsafeUninitializedCapacity:…) back-deploys to the 5.0 stdlib, but the implementation there doesn’t catch buffer reassignment.
2019-05-03 19:09:47 -07:00
Karoy Lorentey
3c33145210 [test] Add availability guard on Character behavior test 2019-05-03 19:09:47 -07:00
Karoy Lorentey
7f1c139b28 [test] Add availability guards on Foundation hashing tests 2019-05-03 19:09:47 -07:00
David Smith
1192b914d2 Merge pull request #24457 from Catfish-Man/two-by-two-length-of-blue
Fix bounds check in bridged ASCII String comparison
2019-05-03 18:28:55 -07:00