Commit Graph

13 Commits

Author SHA1 Message Date
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Meghana Gupta
58a19e94eb Update tests 2024-01-05 13:20:52 -08:00
Nate Chandler
68a35726ce [Test] Simplified two test cases.
Now that Array is eagerMove, a different type needs to be used to test
the behavior of `consume` regarding uniqueness.  Used a class and
otherwise restored the test case to its previous usage of consume,
replacing `._buffer.isUniquelyReferenced()` with `_isUnique_native`.

rdar://107642615
2023-04-05 08:15:27 -07:00
Nate Chandler
90f7af22c9 [SILOpt] Run DestroyAddrHoisting in mandatory.
Run DestroyAddrHoisting in the pipeline where DestroyHoisting was
previously running.  Avoid extra ARC traffic that having no form of
destroy hoisting in the mandatory pipeline results in.

rdar://90495704
2023-04-04 11:11:34 -07:00
Nate Chandler
cda365ca8d [stdlib] Collection types are eagerMove.
Types that have "value semantics" should not have lexical lifetimes.
Value types are not expected to have custom deinits. Are not expected to
expose unsafe interior pointers. And cannot have weak references because
they are structs. Therefore, deinitialization barriers are irrelevant.

rdar://107076869
2023-03-30 11:04:47 -07:00
Kavon Farvardin
2be061cb06 explicitly enable MoveOnly feature for some stdlib tests
We ran into an issue on minimal stdlib build configurations, because they
pull slightly older toolchains to build and test the stdlib. Adding this flag
doesn't hurt anything and just ensures things will work with older compilers.
But it is not needed and should eventually be safe to remove.

part of resolving rdar://106849189
2023-03-24 16:03:11 -07:00
Kavon Farvardin
528d2cfca1 enable full optimizations in test
doesn't seem to be a need to skip destroy hoisting
anymore.
2023-03-14 18:35:13 -07:00
Joe Groff
ecceb02e2a Implement consume x operator with the accepted SE-0366 syntax.
Implement it as a contextual operator that only parses as an operator when
followed by an identifier.
2023-03-01 17:37:54 -08:00
Michael Gottesman
f3081d0e9a [move-keyword] Put the move keyword behind the experimental move only flag for now.
Originally move when it was in the stdlib as _move was behind a keyword but we
moved it in front to allow for some testing. Now that we are going with a
keyword (which we can't leave in/deprecate) move it behind the move only
experimental flag until this gets through evolution.
2022-08-10 12:45:17 -07:00
Michael Gottesman
6493886e1d [move-keyword] Wire up support for the move keyword in lvalue/rvalue emission.
I also updated the move function tests to show that this is working. As a nice
bonus, I was able to enable all of the tests also in a non-optimized stdlib.
2022-08-08 12:50:42 -07:00
Arnold Schwaighofer
3e2c4ac24c Require optimized stdlib for stdlib/move_function test
rdar://86543481
2021-12-17 08:09:06 -08:00
Michael Gottesman
5aa34f43f8 [move-function] Add tests around var uniqueness properties of move. 2021-12-13 10:39:07 -08:00
Michael Gottesman
396f510d06 [move-function] Add support for properly checking let x: Int without an initial value.
We process these as loadable vars. This is really useful since it ensures that
uniqueness is preserved in this case:

```
  let x: K2
  do {
      x = self.k2
  }
  switch _move(x)[userHandle] {
  case .foo:
      assert(_isUnique(&self.k2))
  }
```

I added a test that proves this.
2021-12-11 00:18:09 -08:00