Commit Graph

2015 Commits

Author SHA1 Message Date
Erik Eckstein
5f3e79b84e StringOptimization: bug fixes
Fix some bugs in the optimization and in the test files.

rdar://problem/66283894
2020-07-30 11:32:39 +02:00
Saleem Abdulrasool
7ec46f0d6d Merge pull request #32848 from compnerd/divide-and-conquer
validation: explicitly use integral division
2020-07-14 11:15:53 -07:00
Saleem Abdulrasool
8d5c010980 validation: explicitly use integral division
Division behaviour changed between Python 2 and Python 3.  Explicitly
indicate that we wish to use integral division here.
2020-07-13 23:46:00 +00:00
Saleem Abdulrasool
4cd81213c0 validation: make UnsafeBufferPointer Python3 friendly
The `<>` operator does not work in Python 3.  Switch it out for `!=`.
2020-07-13 15:56:07 +00:00
Robert Widmann
50159d15b7 [Gardening] Use Vendor=apple Where Possible
This simplifies the usual bundle of OS checks

OS=macosx || OS=ios || OS=tvos || OS=watchos

into

VENDOR=apple

which was added in apple/swift#27307
2020-06-30 23:03:01 -07:00
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
Karoy Lorentey
da242bd2d4 [SDK] Remove obsolete overlay code 2020-06-22 15:43:39 -07:00
Mishal Shah
272c466e47 Update master to build with Xcode 12 beta 2020-06-22 15:43:20 -07:00
Nate Chandler
8ec75d4933 [metadata prespecialization] Support classes with non-generic ancestors.
Previously, metadata prespecialization for classes only occurred when
all of a specialized generic class's ancestors were themselves generic.
Here, that requirement is lifted so that generic classes with concrete
ancestors are also eligible for prespecialization.
2020-06-08 14:57:50 -07:00
Dmitri Gribenko
cfbcd85904 Fix and reenable NewArray.swift.gyb 2020-05-19 22:58:40 +02:00
Dmitri Gribenko
30afc6c406 Consolidated four CoreGraphics execution tests
I don't see any reason to split the tests like this. I merged the tests
into the biggest and best-organized test file.

I also removed the `REQUIRES: OS=macosx` line and made some small
adjustments to the test to make it cross-platform.
2020-05-18 23:13:12 +02:00
Ben Rimmington
0061d89efa [stdlib] Regenerate Slice_Of_*_* validation-tests 2020-05-10 12:44:34 +01:00
Ben Rimmington
f2c952cb69 [stdlib] Remove more unneeded numericCasts 2020-05-10 12:31:55 +01:00
David Zarzycki
5dcc32f98f Remove all uses of -force-single-frontend-invocation
The `-force-single-frontend-invocation` flag predates WMO and is now an
alias for `-whole-module-optimization`. We should use the latter and let
the former fade into history.
2020-05-08 06:37:41 -04:00
Karoy Lorentey
6537df068a Revert "test: disable several tests failing in CI" 2020-04-29 19:00:17 -07:00
Xi Ge
698f62c4c6 test: disable stdlib tests due to rdar://61347183 2020-04-06 10:12:31 -07:00
Karoy Lorentey
4d0ea75e15 [test] Convert XCTest test to a build-only API test
Some bad interactions with StdlibUnittest and XCTest lead to sporadic test timeouts for this test. Given that the codebase is obsolete, the best option seems to be to stop running this test altogether. All we really care is that the resulting dylib still contains the right symbols, and building (but not running) this test seems to be a reasonable way of doing that.
2020-03-26 16:35:22 -07:00
Pavel Yaskevich
0ecedfa5ea Revert "[ConstraintSystem] Make it possible to infer subtype bindings through argument conversions"
Reverts apple/swift#30006. It caused a regression that we'd like to address before re-landing:

```swift
struct X {
  var cgf: CGFloat
}

func test(x: X?) {
  let _ = (x?.cgf ?? 0) <= 0.5
}
```

This reverts commit 0a6b444b49.
This reverts commit ed255596a6.
This reverts commit 3e01160a2f.
This reverts commit 96297b7e39.

Resolves: rdar://problem/60185506
2020-03-07 20:16:56 -08:00
Pavel Yaskevich
96297b7e39 [CSStep] Always attempt literal bindings in diagnostic mode
In case of contextual failures such bindings could produce
better solutions with fewer fixes.
2020-02-21 17:47:39 -08:00
Chris Amanse
ffa6bf4729 Fix memory leaks in ThreadBarriers.swift (#12212)
* Fix memory leaks in ThreadBarriers.swift

* Fatal error on pthread cond/mutex destroy failure

* Rename pthread to thread

* Fix pthread init function calls

* Fix guard statement
2020-01-29 08:21:52 -08:00
Erik Eckstein
79fb67f5df tests: exclude some very long running tests from jobs with a non-optimized stdlib
Those are tests which take > 1000s on some simulator configurations with a non-optimized stdlib.
We run those tests anyway with an optimized stdlib. So we don’t lose test coverage by disabling them for debug-stdlib.

This fixes some sporadic time outs on the CI jobs.
2020-01-17 16:51:02 +01:00
Rintaro Ishizaki
0aa3125b62 [Testing] Eliminate REQUIRES-ANY usage
REQUIRES-ANY is deprecated and being removed. Use boolean expressions.

rdar://problem/58549266
2020-01-14 10:21:49 -08:00
Karoy Lorentey
b7e08accb1 [stdlib] Slice: customize withContiguous[Mutable]StorageIfAvailable (#28883)
* [stdlib] Slice: customize withContiguous[Mutable]StorageIfAvailable

We can easily make an UnsafeBufferPointer that slices another UnsafeBufferPointer, so let’s allow Slice to vend a slice of the base collection’s contiguous storage, if it provides access to one.

We need to do some index distance calculations to implement this, but those will be constant-time in the usual case where the base collection is a RAC.

https://bugs.swift.org/browse/SR-11957
rdar://58090587

* [test] UnsafeBufferPointer: fix some warnings

* [stdlib] Slice: don’t calculate index distances unless the base provides contiguous mutable storage
2020-01-06 12:32:30 -05:00
Pavel Yaskevich
34f5b52db1 [Diagnostics] Diagnose ambiguities related to contextual type mismatch
If none of the candidates produce expected contextual type, record
all of the posibilities to produce a note per and diagnose this as
contextual type mismatch instead of a reference ambiguity.
2019-12-03 12:07:15 -08:00
Karoy Lorentey
41cf1e77f6 [test] Adjust SwiftNativeNSBase conditions 2019-11-19 14:11:30 -08:00
Luciano Almeida
1184492d25 [Diagnostics] SR-11419 Diagnose protocol stub note in editor mode only (#28101)
* [TypeChecker] Enclosing stubs protocol note within editor mode

* [test] Removing note from test where there is no -diagnostics-editor-mode flag

* Formatting modified code

* [tests] Fixing tests under validation-tests
2019-11-06 07:42:48 -08:00
Xi Ge
96523124a9 [test] xfail several stdlib tests failing in CI
10:21:57 Failing Tests (4):
10:21:57     Swift(macosx-x86_64) :: stdlib/SwiftNativeNSBase.swift
10:21:57     Swift(macosx-x86_64) :: stdlib/TestNSString.swift
10:21:57     Swift(macosx-x86_64) :: stdlib/TestJSONEncoder.swift

rdar://55727144
2019-10-25 11:04:52 -07:00
David Smith
637af2f9fe Merge pull request #27709 from Catfish-Man/bridge-to-the-future
Optimize accessing Swift arrays via ObjC
2019-10-23 00:19:06 -07:00
David Smith
d9cef0afef Optimize accessing Swift Arrays from ObjC 2019-10-22 20:57:36 -07:00
Rintaro Ishizaki
836b929bd0 Disable ArrayNew.swift.gyb in armv7k or armv7s
rdar://problem/55944126
2019-10-16 17:13:36 -07:00
Pavel Yaskevich
88c39db0c3 [Diagnostics] NFC: Fix improved test-cases related to argument-to-parameter mismatches 2019-09-13 22:35:53 -07:00
Karoy Lorentey
8fcc94f79e Merge pull request #26885 from lorentey/nein-nein-nein-nein
[test] Denineninenineninify behavioral tests added for 5.1
2019-08-28 15:23:49 -07:00
Karoy Lorentey
b90e2ef776 [test] Denineninenineninify behavioral tests added for 5.1 2019-08-27 15:44:04 -07:00
Michael Ilseman
774788ac18 [test] Disable misaligned indices test prior to 5.1
Misaligned indices were fixed in 5.1, but we should disable the test
when testing back deployment.

Adds a shared helper to StdlibUnittest for the run time check.
2019-08-27 15:13:38 -07:00
Michael Ilseman
9e8993551b [test] Disable some tests in back-deployment scenarios.
Bugs relating to scalar alignment and grapheme stride caching were
fixed in 5.1, so they shouldn't be tested when back deploying.
2019-08-26 16:06:52 -07:00
Mishal Shah
b509ab536a Merge pull request #26066 from lorentey/long-collections
[test] Mark long collection tests as such
2019-07-10 14:57:23 -07:00
Xi Ge
1535bea268 FixCode: issue a separate note for protocol-stub fixit when the fixit location is in another file
Under non-editor mode, the fixit for inserting protocol stubs is associated with a note
pointing to the missing protocol member declaration which could stay in a separate file from
the conforming type, leading to the behavior of rdar://51534405. This change checks if
the fixit is in a separate file and issues another note to carry the fixit if so.

rdar://51534405
2019-07-10 12:30:54 -07:00
Karoy Lorentey
d1001dbf15 [test] Mark long collection tests as such
FlattenCollection.swift.gyb and LazyFilterCollection.swift.gyb tests are taking 1000+ seconds to execute, even with optimizations. It should be possible to shorten these, but meanwhile, mark them as long tests so speed up regular testing.

rdar://problem/52872766
rdar://problem/52873170
2019-07-10 11:58:16 -07:00
Michael Ilseman
4cd1e812b7 [String] Scalar-alignment bug fixes.
Fixes a general category (pun intended) of scalar-alignment bugs
surrounding exchanging non-scalar-aligned indices between views and
for slicing.

SE-0180 unifies the Index type of String and all its views and allows
non-scalar-aligned indices to be used across views. In order to
guarantee behavior, we often have to check and perform scalar
alignment. To speed up these checks, we allocate a bit denoting
known-to-be-aligned, so that the alignment check can skip the
load. The below shows what views need to check for alignment before
they can operate, and whether the indices they produce are aligned.

┌───────────────╥────────────────────┬──────────────────────────┐
│ View          ║ Requires Alignment │ Produces Aligned Indices │
╞═══════════════╬════════════════════╪══════════════════════════╡
│ Native UTF8   ║ no                 │ no                       │
├───────────────╫────────────────────┼──────────────────────────┤
│ Native UTF16  ║ yes                │ no                       │
╞═══════════════╬════════════════════╪══════════════════════════╡
│ Foreign UTF8  ║ yes                │ no                       │
├───────────────╫────────────────────┼──────────────────────────┤
│ Foreign UTF16 ║ no                 │ no                       │
╞═══════════════╬════════════════════╪══════════════════════════╡
│ UnicodeScalar ║ yes                │ yes                      │
├───────────────╫────────────────────┼──────────────────────────┤
│ Character     ║ yes                │ yes                      │
└───────────────╨────────────────────┴──────────────────────────┘

The "requires alignment" applies to any operation taking a
String.Index that's not defined entirely in terms of other operations
taking a String.Index. These include:

* index(after:)
* index(before:)
* subscript
* distance(from:to:) (since `to` is compared against directly)
* UTF16View._nativeGetOffset(for:)
2019-06-26 16:42:58 -07:00
Michael Ilseman
93d65fc9c3 [gardening] Remove trailing whitespace 2019-06-26 09:22:17 -07:00
Ben Langmuir
978ec73444 Merge pull request #25562 from benlangmuir/disable-all-the-modelio-tests
Disable remaining stdlib/ModelIO tests
2019-06-18 09:59:54 -07:00
Arnold Schwaighofer
85bfbe2dd3 Merge pull request #25473 from aschwaighofer/back_deploy_dynamic_replacement
stdlib: Add backward deployment versions for the dynamic-replacement runtime functions
2019-06-18 09:02:22 -07:00
Ben Langmuir
7bb41f3400 Disable remaining stdlib/ModelIO tests
We are now seeing another one crash in CI. Best guess is that the first
one of these tests to run can randomly crash - perhaps an initialization
isssue.
2019-06-18 06:40:08 -07:00
Arnold Schwaighofer
da2d418fd9 Really fix micro stdlib test case 2019-06-15 07:21:10 -07:00
Arnold Schwaighofer
6f9c50c029 Fix MicroStdlib test 2019-06-14 15:49:23 -07:00
Ben Langmuir
f68ce2d619 Add missing call to code() 2019-06-14 14:55:49 -07:00
Ben Langmuir
a200911847 Temporarily disable validation-test/stdlib/ModelIO.swift
This has been crashing sometimes in CI. Disable it until we get a real
fix.

rdar://50449570
2019-06-14 11:12:05 -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
Saleem Abdulrasool
551c1be926 validation-test: make stdlib.string compile on Win32
The C library functions used here do not appear without the C runtime
being imported (ucrt or MSVCRT).  Adjust the test as such.  This exposes
a stack corruption in the test which needs to be resolved.
2019-06-04 09:43:13 -07:00
Saleem Abdulrasool
c1d007a790 Merge pull request #25232 from compnerd/hash
validation-test: avoid shell in HashingRandomization
2019-06-04 08:45:42 -07:00