Commit Graph

3253 Commits

Author SHA1 Message Date
Mike Ash
acbc484c44 [Test] Gate new VarArgs test on new runtime.
The empty-arguments test fails when run against an older runtime, so don't test it there.

rdar://146839898
2025-03-12 16:27:28 -04:00
Mike Ash
c7922b29af Merge pull request #79774 from mikeash/bigger-empty-va-list-storage
[Stdlib] Make alignedStorageForEmptyVaLists bigger.
2025-03-11 23:10:24 -04:00
Mike Ash
70e1931caa [Stdlib] Make alignedStorageForEmptyVaLists bigger.
Expand alignedStorageForEmptyVaLists to eight Doubles. This produces more predictable output for code that calls a variadic function without parameters where the function still expects them, such as passing an arbitary string to a string formatting function. It's still unsound, but this makes it more predictable.

rdar://145083971
2025-03-11 09:29:07 -04:00
Guillaume Lessard
3d6070ddac [test] add a test case 2025-03-10 08:54:08 -07:00
Guillaume Lessard
2980878a0f Update test/stdlib/Span/InlineSpanProperties.swift
Co-authored-by: Ben Rimmington <me@benrimmington.com>
2025-03-10 08:54:08 -07:00
Guillaume Lessard
0e1d207aa0 Update test/stdlib/Span/ArraySpanProperties.swift
Co-authored-by: Ben Rimmington <me@benrimmington.com>
2025-03-10 08:54:07 -07:00
Guillaume Lessard
afb627d189 [test] rename files 2025-03-10 08:54:07 -07:00
Guillaume Lessard
7188d0b187 [stdlib] add span property to KeyValuePairs 2025-03-10 08:54:07 -07:00
Guillaume Lessard
d6ab6d0c2c [test] better names for test suites 2025-03-10 08:54:07 -07:00
Guillaume Lessard
d0d528521a [stdlib] add span property to InlineArray 2025-03-10 08:54:06 -07:00
Guillaume Lessard
264747ac77 [stdlib] add span property to CollectionOfOne 2025-03-10 08:51:56 -07:00
Guillaume Lessard
a5e04e0216 [test] span properties for Array family 2025-03-10 08:51:56 -07:00
Guillaume Lessard
3863b815df [test] test Span.bytes 2025-03-10 08:51:56 -07:00
Nate Cook
ff86a69dd7 Add a StdlibUnitTest modifier for requiring a stdlib version (#79838)
It would be great if this could also set the availability for the `code:`
block, but this at least cuts out some boilerplate.
2025-03-08 13:07:20 -06:00
Guillaume Lessard
7214717fba Merge pull request #79708 from glessard/span-gardening
[SE-0447] Span and RawSpan tests
2025-03-07 22:00:58 -08:00
Guillaume Lessard
1a4105de6d [test] remove uninteresting tests 2025-03-07 13:23:25 -08:00
Guillaume Lessard
22ae9c9367 [test] portability fix 2025-03-07 13:23:25 -08:00
Ben Rimmington
ed5b3ca252 [stdlib] Add basic unit tests for InlineArray
FIXME: Empty array literals aren't supported.
2025-03-06 19:25:50 +00:00
Guillaume Lessard
bd32aa5f6e [stdlib] remove an extracting overload
- `RangeExpression` implicitly involves bounds checking, so this was misleading.
2025-03-05 17:15:03 -08:00
Guillaume Lessard
b70f0f622c [test] add RawSpan tests 2025-03-05 16:28:11 -08:00
Guillaume Lessard
16750f6de5 [test] add Span tests 2025-03-05 16:28:11 -08:00
Ben Rimmington
4bb3cf1496 [stdlib] Update WordPair: Comparable conformance (#79606) 2025-02-25 10:17:05 -08:00
Doug Gregor
654f8534bd Merge pull request #79399 from DougGregor/enable-span-everywhere
Enable usable of Span by default
2025-02-14 15:39:30 -08:00
Doug Gregor
3c8ef82963 Enable usable of Span by default
Usage of Span was temporarily behind an experimental feature flag. Now
that SE-0447 has been accepted, remove the experimental feature flag and
allow Span usage everywhere.

Implements rdar://144819992.
2025-02-14 10:45:47 -08:00
Philipp Gabriel
773561cc27 Expose attosecond representation of Duration (#78202)
* Add Int128 to Duration

* Update stdlib/public/core/Duration.swift

Co-authored-by: Stephen Canon <stephentyrone@gmail.com>

* Add unit tests for duration + attoseconds

* Add docs to duration + attosecond

* Update docs for attoseconds property

* Update stdlib.swift

* Update stdlib.swift

---------

Co-authored-by: Stephen Canon <stephentyrone@gmail.com>
2025-02-13 09:31:02 -05:00
Alejandro Alonso
0572eb9ef0 Merge pull request #78857 from Azoy/wordpair-comparable
[stdlib] Add Comparable conformance to WordPair
2025-01-29 11:20:56 -08:00
Alejandro Alonso
d2309d264d Fix tests 2025-01-28 12:50:51 -08:00
Alejandro Alonso
22d5acd207 Fix logic around comparison 2025-01-23 11:55:21 -08:00
Alejandro Alonso
d680396a09 Test comparable conformance 2025-01-23 10:14:19 -08:00
Philippe Hausler
c6a2437a10 [Observation] Exclude generic class types from pre-caching their keypaths (#78790)
* [Observation] Exclude generic class types from pre-caching their keypaths

* Account for multiple nesting levels of generics for observation cached keypaths
2025-01-21 23:49:37 -08:00
Alejandro Alonso
11fbd94668 Merge pull request #78664 from Azoy/unicode-16
[stdlib] Unicode 16
2025-01-21 09:29:35 -08:00
Alejandro Alonso
708d72d2c3 Update tests for 6.1 Unicode 16 stdlib 2025-01-15 14:09:57 -08:00
Guillaume Lessard
42ee081939 [test] correct compiler flags 2025-01-14 20:57:19 -08:00
Guillaume Lessard
fdddad6fa7 [test] exercise nonnative Array bridging 2025-01-14 17:08:36 -08:00
Evan Wilde
b492b716f6 Include std::to_string(long) in exported symbols
The GNU C++ runtimes added yet another symbol to our exported symbols
causing this test to fail. Adding it now: _ZNSt7__cxx119to_stringEl

rdar://142782295
2025-01-13 14:29:20 -08:00
Alexis Laferrière
11c448d954 Tests: Use a local cache for many tests importing AppKit
Tests importing AppKit have a tendency to be flaky if they share a
module cache with other builds using a different set of framework search
flags. Make sure they use a local cache to avoid picking incompatible
cached modules.

Alternatively, we could align all builds using the same cache to have
exactly the same framework search paths or enable explicit module
builds. I picked the module cache as it's the most reliable solution in
the short and long term.

The 5 tests below import AppKit and have been known to be flaky.
Adapting them to use a custom cache with require more care. For now,
let's use them as control group to validate that the fix works. If these
5 fail without the fixed ones, we should extend the same corresponding
fix to them.

- Interpreter/SDK/GLKit.swift
- Interpreter/SDK/cf_extensions.swift
- Interpreter/SDK/cf_type_bridging.swift
- Interpreter/SDK/mapkit_header_static.swift
- Interpreter/SDK/objc_ns_enum.swift

rdar://142296731
2025-01-09 12:22:02 -08:00
Allan Shortlidge
95cc7319a1 SIL: Revert public linkage for @_silgen_name forward declarations.
It turns out that the stdlib build depends on `internal` functions with
`@_silgen_name` getting hidden linkage in some configurations. Instead of
messing with the linkage computation, just fix the `stdlib/Error.swift` test by
making `setWillThrowHandler` `public` to give it the right linkage.

Resolves rdar://141590619.
2024-12-17 08:35:01 -08:00
Erik Eckstein
7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00
Doug Gregor
531a1ab4c4 Temporarily put uses of "Span" and "RawSpan" behind an experimental feature flag
While Span is present, we don't yet have an official way to create Span
instances. Until then, put uses of Span and RawSpan behind an
experimental feature flag (`Span`) that must be set to use these.

Addresses rdar://139308307.
2024-11-11 16:18:33 -08:00
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
swift-ci
0de4a3ab21 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-21 12:35:00 -07:00
Allan Shortlidge
f827e7c6d3 Tests: Remove -disable-availability-checking in variadic generics tests. 2024-10-20 15:37:15 -07:00
swift-ci
f0b98875ec Merge remote-tracking branch 'origin/main' into rebranch 2024-10-11 17:33:30 -07:00
Nate Cook
9265743adc Add validation to CollectionDifference decoder (#76876)
The `CollectionDifference` type has a few different invariants
that were not being validated when initializing using the type's
`Decodable` conformance, since the type was using the
autogenerated `Codable` implementation. This change provides
manual implementations of the `Encodable` and `Decodable`
requirements, and adds tests that validate the failure when trying
to decode invalid JSON for CollectionDifference (and a few other
types).
2024-10-11 17:23:55 -07:00
swift-ci
e75d787e75 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-08 22:54:27 -07:00
Karoy Lorentey
ee4d4a33bd Merge pull request #75433 from lorentey/string-index-printing2 2024-10-08 22:34:03 -07:00
swift-ci
0f42bf27db Merge remote-tracking branch 'origin/main' into rebranch 2024-10-07 19:35:28 -07:00
Mike Ash
565c97ae07 Merge pull request #76800 from mikeash/reflection-test-no-timeout
[Test] Remove timeout from Reflection.swift and Reflection_objc.swift.
2024-10-07 22:09:42 -04:00
Karoy Lorentey
29cf262ef7 [stdlib] String.Index: conform to CustomDebugStringConvertible instead
Apply the LSG’s modifications as detailed in their review notes.
2024-10-07 17:00:13 -07:00
Karoy Lorentey
01792372a9 [stdlib] String.Index: conform to CustomStringConvertible
This better exposes the internals of string indices, demystifying their operation and radically simplifying working with them.
2024-10-07 16:02:16 -07:00