Commit Graph

696 Commits

Author SHA1 Message Date
Karoy Lorentey
373a9741e1 [test] Prototypes/HypoArray: Don’t force test into Swift 6 mode 2025-09-02 14:53:51 -07:00
Evan Wilde
698dbc03f1 FreeBSD: Disable broken tests
Disabling a few tests. The distributed tests are failing for the same
reason they fail on Linux, the rpaths and library search paths are
mucked up. Fixing that shouldn't be too hard, but should be enabled on
both platforms at once.

CollectiveTransformers doesn't work because it imports Darwin directly.
There is a note that is several years old saying that we should port the
test to the other platforms, but that is beyond the scope of this PR at
the moment.
2025-07-24 17:36:59 -07:00
Stephen Canon
1e02b3b596 Quick support for calling extern c functions with Builtin vector types. (#82225)
This gives us a means to use llvm's intrinsics that implement more niche
SIMD instructions from the standard library, where we cannot use the C
intrinsics headers from clang (because they're in the cpp module).
2025-06-17 09:00:21 -04:00
Alejandro Alonso
c1bb143648 Make ValueGenerics feature always available 2025-02-27 10:03:37 -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
Kuba Mracek
350fc386f2 Fix missing serialization type registration code on Builtin.FixedArray 2024-10-28 21:40:48 -07:00
Joe Groff
a184782a38 Introduce a Builtin.FixedArray type.
`Builtin.FixedArray<let N: Int, T: ~Copyable & ~Escapable>` has the layout of `N` elements of type `T` laid out
sequentially in memory (with the tail padding of every element occupied by the array). This provides a primitive
on which the standard library `Vector` type can be built.
2024-10-22 16:21:45 -07:00
Stephen Canon
97d145cb06 Bug fixes and improvements for DoubleWidth prototype (#75209)
* Bug fixes and improvements for DoubleWidth prototype

Previously multipliedReportingOverflow and masking shifts were implemented incorrectly for signed types and non-power-of-two bitWidths, respectively. Address those two bugs and additional implement &+, &-, and &*.

* Restore line accidentally deleted
2024-07-22 16:20:38 -04:00
Karoy Lorentey
f2dc8946b2 [test] Fix issues uncovered in code review 2024-06-07 15:56:35 -07:00
Karoy Lorentey
ab51f1630c [stdlib] API additions for basic noncopyable primitives
- Add `exchange(_:with:)`
- Add `Optional.take()`
- Add `Unsafe[Mutable]BufferPointer.extracting(_:)`
- Finish generalizing `withExtendedLifetime`
- Radically simplify the implementation of `swap(_:_:)`
2024-06-07 14:09:53 -07:00
Alex Lorenz
0f9a69c712 android test fixes 2024-05-28 12:59:26 -07:00
Xiaodi Wu
090a047c79 [test/Prototypes] Fix DoubleWidth think-os (#70289) 2023-12-07 09:48:41 -05:00
Xiaodi Wu
d1611f70ff [test/Prototypes] Fix DoubleWidth think-o that trips an assert (#69442)
* [test/Prototypes] Fix DoubleWidth think-o that trips an assert

* [test/Prototypes] Fix second DoubleWidth think-o that trips an assert
2023-10-30 20:43:57 -04:00
Joe Groff
aee071bf4e Introduce an experimental @_rawLayout attribute.
This attribute can be attached to a noncopyable struct to specify that its
storage is raw, meaning the type definition is (with some limitations)
able to do as it pleases with the storage. This provides a basis for
implementing types for things like atomics, locks, and data structures
that use inline storage to store conditionally-initialized values.
The example in `test/Prototypes/UnfairLock.swift` demonstrates the use
of a raw layout type to wrap Darwin's `os_unfair_lock` APIs, allowing
a lock value to be stored inside of classes or other types without
needing a separate allocation, and using the borrow model to enforce
safe access to lock-guarded storage.
2023-07-24 14:28:19 -07:00
Anthony Latsis
a136fc180c Gardening: Migrate test suite to GH issues: Prototypes 2022-09-02 01:44:24 +03:00
Butta
3933fc0006 [android][test] Fix several tests on the Android CI
- #58975 switched many tests from XFAIL on linux to linux-gnu, so seven
  fail on the Android CI and two natively. They are now explicitly excluded.
- #39605 added several C++ Interop tests, 11 of which fail on the Android CI,
  so disable them for now.
- #42478 removed the @noescape attribute for the non-Android
  SIL/clang-function-types tests, so I remove it for Android too.
- My pull #40779 moved the Swift pointer tags to the second byte, so
  SILOptimizer/concat_string_literals.64 will need to be updated for that,
  disabled it for now.
- Compiler-rt moved the directory in which it places those libraries for
  Android, llvm/llvm-project@a68ccba, so lit.cfg is updated for that.
2022-06-09 14:35:41 +05:30
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Slava Pestov
dac8d666ee Stop passing -requirement-machine-{abstract,inferred,protocol}-signatures flags in tests
These flags are now no-ops.
2022-05-10 12:56:17 -04:00
Josh Soref
94032df145 spelling: resurrect
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-01 04:32:22 -04:00
Guillaume Lessard
f3c7893789 [test] avoid using array conversion for String-from-C-string 2022-04-01 12:10:16 -06:00
Slava Pestov
f24cf9a2fa Enable Requirement Machine unconditionally for test/Prototypes/BigInt.swift
This would fail in asserts builds because the GSB produced an invalid
minimal signature. It now started failing in noassert builds as well
because we cross-check generic signatures against the Requirement
Machine.

Instead run this test with the Requirement Machine enabled unconditionally
since it works now.
2022-03-09 12:04:49 -05:00
Hamish Knight
fcfad6c8db [test] Add %target-codesign to BigInt.swift
Make sure to run utils/swift-darwin-postprocess.py
on this test to work around a dyld issue.

rdar://82335489
2021-08-25 13:16:13 +01:00
Saleem Abdulrasool
2fc5cbdc14 stdlib: remove swiftMSVCRT, replace with swiftCRT on Windows
This replaces swiftMSVCRT with swiftCRT.  The big difference here is
that the `visualc` module is no longer imported nor exported.  The
`visualc` module remains in use for a singular test wrt availability,
but this should effectively remove the need for the `visualc` module.

The difference between the MSVCRT and ucrt module was not well
understood by most.  MSVCRT provided ucrt AND visualc, combining pieces
of the old MSVCRT and the newer ucrt.  The ucrt module is what you
really wanted most of the time, however, would need to use MSVCRT for
the convenience aliases for type-generic math and the deprecated math
constants.

Unfortunately, we cannot shadow the `ucrt` module and create a Swift SDK
overlay for ucrt as that seems to result in circular dependencies when
processing the `_Concurrency` module.

Although this makes using the C library easier for most people, it has a
more important subtle change: it cleaves the dependency on visualc.
This means that this enables use of Swift without Visual Studio for the
singular purpose of providing 3 header files.  Additionally, it removes
the need for the installation of 2 of the 4 support files.  This greatly
simplifies the deployment process on Windows.
2020-10-15 16:02:01 -07:00
Nate Chandler
bdbcec6ead [Test] Specialize Prototypes/BigInt.swift for Windows.
Building the file with asserts crashes the compiler.  Building the file
with no_asserts does *not* crash the compiler.

For non-Windows platforms, it is sufficient to `XFAIL: asserts`.

That does not work on Windows thanks to Python < 3: the crash is not
handled by lit's `not` there as it is on other platforms.  To handle the
expected crash on Windows when building with asserts, not --crash is
required.  However on other platforms, not --crash breaks the test in
no_asserts builds.

Here, a version of the test's run script specialized for Windows is
broken out into a separate BigInt-windows.swift file.

rdar://problem/65251059
2020-07-13 17:42:09 -07:00
Nate Chandler
a2258dbc4c [Test] Disable Prototypes/BigInt.swift.
While baking a solution that works for both Windows and other platforms,
disable the test.

Most recent failure is here

https://ci.swift.org/view/Dashboard/job/oss-swift_tools-R_stdlib-RD_test-simulator/5173/consoleText

rdar://problem/65251059
2020-07-13 09:48:52 -07:00
Saleem Abdulrasool
e02438c260 test: repair the Windows builders after #32666
Adjust the test to fail properly
2020-07-02 14:06:14 -07:00
Slava Pestov
844ab508e6 AST: Add more asserts for same-type constraints in generic signatures 2020-07-01 23:03:33 -04: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
3405691582
7b431b4ddb [test] Mark XFAIL tests for OpenBSD.
These tests are marked XFAIL or UNSUPPORTED because either the tests:
require libc annotation, require Mach-O support, don't recognize calls to
swift-autolink-extract, requires porting alongside Linux, or rely on simd
which is not present.

Additionally, explicit REQUIRES for tsan/asan/fuzzer are added to some
tests, since OpenBSD does not support these sanitizers or fuzzers, since
it's nicer to mark that with REQUIRES rather than XFAIL.
2020-06-10 18:57:19 -04:00
Ben Rimmington
f2c952cb69 [stdlib] Remove more unneeded numericCasts 2020-05-10 12:31:55 +01:00
Ben Rimmington
682c1672b6 [stdlib] Update file headers of de-gybbed files 2020-04-01 22:14:03 +01:00
Dave Abrahams
fd48f8fa96 Squash warnings 2020-03-27 14:53:22 -07:00
3405691582
4a36a4b6c5 [test] Setup testing for OpenBSD.
This commit focuses the basics: setting up the relevant stanzas in
lit.cfg and adding platform conditionals for importing Glibc. Future
commits will deal with other portability fixes.
2020-03-23 20:47:31 -04:00
Nate Chandler
2b606909d4 Disabled Result_future on another simulator.
The test cannot run on simulator since it requires a "future" target--in
this case watchOS 9.99 which is inherently beyond what any simulator is
running.
2020-02-22 21:02:44 -08:00
nate-chandler
de660ceea4 Merge pull request #29885 from nate-chandler/generic-metadata-prespecialization-components/stdlib-on
[metadata prespecialization] Always on for stdlib.
2020-02-17 15:04:59 -08:00
Nate Chandler
4475f43ba0 [metadata prespecialization] Always on for stdlib.
Regardless of any flags, the stdlib will have its generic metadata
prespecialized.

Temporarily reintroduced the flag to enable the feature flag while
preserving the flag to disable it and changed the default back to off
for the moment.
2020-02-17 11:53:27 -08:00
Nate Chandler
da3a393e64 Reenable temporarily disabled test.
The test relies on new runtime functionality that is by definition not
available in the stdlib in the OS.  Here, the test is marked as
unsupported run running using the OS' stdlib.

rdar://problem/59425215
2020-02-13 09:44:21 -08:00
nate-chandler
8c92cfd42c Temporarily disable Result_future.swift test. (#29809)
Reenabling the test is tracked by rdar://problem/59425215 .
2020-02-13 18:26:06 +01:00
Stephen Canon
0174f5dbd0 Mark Prototypes/Result_future.swift unsupported on tvOS simulator. (#29808) 2020-02-13 17:57:18 +01:00
Nate Chandler
40e17d9c6f [metadata prespecialization] Direct refs to enums.
When a specialized usage of a generic enum occurs in the same module
where the enum was defined, directly reference the prespecialized
metadata.

rdar://problem/56994321
2020-02-12 10:08:33 -08:00
Dave Abrahams
896d4fca0c Add efficiency docs for partitionPoint 2020-01-04 15:01:15 -08:00
Nate Cook
2e6f8655cb [test] Make concatenation work for sequences, too. 2019-08-22 10:38:35 -05: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
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Sho Ikeda
a35c9f0c60 [gardening] Use Collection.isEmpty over Collection.count 2019-05-26 09:35:20 +09:00
Michael Gottesman
da37a56896 [sil] Change the immutable address use verifier to ignore br/cond_br uses that introduce address phis and re-enable the test that shows this behavior.
We want to eventually remove address phi arguments from SIL. This will enable
all sorts of nice IRGen optimizations and in general make life better. We are
not there yet, but given that is the direction we are going in, I don't think
there is much use in having to implement this sort of checking for SIL phi
arguments.

rdar://50676315
2019-05-11 14:37:11 -07:00
Brent Royal-Gordon
08bd6bd715 Disable Prototypes/TextFormatting everywhere 2019-05-10 16:58:58 -07:00
Brent Royal-Gordon
387fc08e6c Disable Prototypes/TextFormatting in 32-bit
The new ImmutableAddressUseVerifier asserts when it tries to compile it. rdar://problem/50676315
2019-05-10 14:26:28 -07:00
Arnold Schwaighofer
e113ef8c93 Add a mode to test implicit dynamic with private imports 2019-03-20 14:34:01 -07:00