Commit Graph

2588 Commits

Author SHA1 Message Date
Alejandro Alonso
7c85261a77 Add runtime support 2024-09-04 15:13:27 -07:00
Allan Shortlidge
a9667af5ac Tests: Reenable availability_maccatalyst_zippered.swift.
Adjust the test to be runnable on Apple Silicon.

Resolves rdar://73984718.
2024-09-03 22:09:03 -07:00
Mike Ash
4b438d517a [Test] Fix remote-run of objc_implementation_objc_client.m, again.
The previous fix wasn't quite good enough, as the framework didn't get copied to the remote device. Pass the framework as a command-line argument to the test executable so that remote-run copies it.

rdar://134406720
2024-09-03 16:41:55 -04:00
Ben Langmuir
dc5e6d88c2 [test] ignore deprecations
Ignore some deprecation warnings associated with the deployment target
bump.
2024-08-30 09:10:14 -07:00
Mike Ash
82db11c0c5 Merge pull request #76085 from swiftlang/objc_implementation_objc_client-remote-run-fix
[Test] Fix remote-run of objc_implementation_objc_client.m.
2024-08-29 18:05:08 -04:00
Pavel Yaskevich
6465bdc6e1 Merge pull request #76042 from xedin/rdar-133415157
[Sema/SILGen] Emit dynamic actor isolation checks for closures
2024-08-28 13:06:55 -07:00
Mike Ash
b7636733f7 [Test] Fix remote-run of objc_implementation_objc_client.m.
Use a @executable_path relative install name so that it still works when the executable and framework are copied and run elsewhere.

rdar://134406720
2024-08-26 11:12:34 -04:00
Pavel Yaskevich
8efdec1d4e [Tests] NFC: Don't attempt to run test-case for rdar://128667580 remotely or on device
The test has dependent object files from Objective-C and is not
expected to be run remotely or on device.
2024-08-23 10:57:59 -07:00
Pavel Yaskevich
080675170b [SILGen] Emit dynamic actor isolation checks for closures
For synchronous isolated closures passed to unsafe APIs
(the ones that have not been fully concurrency checked)
emit an expected executor check in prolog that would make
sure that they are always used in the expected context.

Resolves: rdar://133415157
2024-08-22 09:57:17 -07:00
Ben Langmuir
fd1875dcfb [test] Move availability tests to later fake OS versions
10.50 was once greater than any real macOS version, but now it compares
less than real released versions, which makes these tests depend on the
deployment target unnecessarily. Update these tests to use even larger
numbers to hopefully keep them independent a little longer.
2024-08-21 11:38:54 -07:00
Becca Royal-Gordon
f1b57041c9 Merge pull request #75973 from beccadax/objcimpl-rdar101497120
Re-enable Interpreter/objc_implementation_objc_client.m test
2024-08-19 23:24:59 -07:00
Becca Royal-Gordon
79acf14ec4 Re-enable objc_implementation_objc_client.m
This test was disabled over a year ago due to what may have been a standard library bug; however, the failure no longer reproduces in commonly-tested configurations.

Experimentally re-enable the test to find out whether it is still failing in *any* tested configuration or whether we can simply leave it turned on.

Fixes rdar://101497120 (maybe).
2024-08-19 17:11:27 -07:00
Charles Hu
fd9847e554 Merge pull request #75886 from iCharlesHu/charles/fix-nsdecimal-tests
Fix NSDecimal interpreter test
2024-08-16 12:29:04 -07:00
Kavon Farvardin
bd15da628f Merge pull request #75871 from kavon/fix-test-133393259
Test: fix convenience_init_peer_delegation.swift
2024-08-15 13:33:03 -07:00
Kavon Farvardin
c88858d928 Test: disable only in optimized mode 2024-08-14 13:45:45 -07:00
Charles Hu
77e6c57a73 Fix NSDecimal interpreter test
We fixed the behavior of Decimal.ulp with https://github.com/apple/swift-foundation/pull/741. We should remove this test with wrong expectations since we already test it in SwiftFoundation
2024-08-14 13:41:23 -07:00
Kavon Farvardin
fd29cd7c65 Test: fix convenience_init_peer_delegation.swift
There's no reason to avoid importing Foundation with an
obscure compiler flag.

resolves rdar://133393259
2024-08-13 16:22:19 -07:00
Kavon Farvardin
f0ce346a69 Merge pull request #75699 from kavon/test-coverage-132915515
Test: add coverage for borrowing get
2024-08-13 18:58:43 -04:00
Kavon Farvardin
c8aff3491d Test: add coverage for borrowing get
resolves rdar://132915515
2024-08-13 12:24:23 -07:00
Erik Eckstein
52d6ae334d DeinitDevirtualizer: don't erase the destroy instruction if the the destroyed value can't be de-virtualized
This can happen if the destroyed type is resilient.
Fixes a verifier crash.
2024-08-12 13:34:50 +02:00
Ben Langmuir
1f00ffe42c Revert "[immediate] Load Foundation early enough for bridging" 2024-08-06 16:10:42 -07:00
Kavon Farvardin
05a280bb3a Test: try to re-enable
resolves rdar://92102119
2024-08-05 11:55:11 -07:00
Ben Langmuir
99daf886d5 Merge pull request #75594 from benlangmuir/script-load-foundation-early
[immediate] Load Foundation early enough for bridging
2024-08-02 00:36:14 -07:00
Ben Langmuir
8a824d70a0 [immediate] Load Foundation early enough for bridging
Foundation needs to be loaded early in the process for Swift's runtime
to properly initialize bridging support; otherwise it may cause issues
like unrecognized selectors. When scripting, load Foundation early in
performFrontend before any swift code runs.

rdar://129528115
2024-08-01 15:02:13 -07:00
Alexis Laferrière
3ea6e70e94 Merge pull request #75606 from xymus/disable-os-stdlib
Tests: Disable 2 tests on use_os_stdlib
2024-08-01 14:14:38 -07:00
Tim Kientzle
713aafe68f Merge pull request #72354 from tbkka/tbkka-progress-for-bridge-object-test
Add some progress info to make failures here easier to understand
2024-08-01 13:08:20 -07:00
Tim Kientzle
fe82cde490 Use CHECK for general synchronization 2024-08-01 07:32:48 -07:00
Alexis Laferrière
fe65a82790 Tests: Disable moveonly_swiftskell.swift when use_os_stdlib (rdar://132936383) 2024-07-31 17:14:45 -07:00
Pavel Yaskevich
ca0afe2aed Merge pull request #75592 from xedin/rdar-132715122
[Tests] NFC: Don't attempt to run inlinable init accessor tests on de…
2024-07-31 13:37:29 -07:00
Pavel Yaskevich
5e0efb1a56 [Tests] NFC: Don't attempt to run inlinable init accessor tests on device or remotely
This test is using dylibs, which don't play way with remote/device CI.

Resolves: rdar://132715122
2024-07-31 10:13:22 -07:00
Dario Rexin
90a9ffdf02 [IRGen] Properly compute bit mask for extra tag bits in CVW
rdar://132501359

PowerOf2Ceil is not the correct function to use, because we end up with an empty mask if there is only one value stored in the extra tag bits
2024-07-26 14:50:54 -07:00
Ben Barham
d281fb8868 Merge pull request #74883 from finagolfin/droid
[android] Enable several C++ Interop and other tests
2024-07-26 11:18:07 -07:00
Mike Ash
c0486723fe [Test] Remove class_getImageName-static test.
This test checks the behavior of class_getImageName before the runtime's hook is installed with objc_setHook_getImageName. Foundation now triggers installation of that hook very early, causing the test to fail. Reliably avoiding this is difficult, and the test is redundant with the ObjC runtime's tests, so just remove it.

rdar://132478164
2024-07-25 11:09:38 -04:00
Allan Shortlidge
66e2f972ab Merge pull request #75432 from tshortli/maccatalyst-upstream
Upstream missing macCatalyst support
2024-07-24 09:58:04 -07:00
Allan Shortlidge
6fb6a56b20 SILGen: Introduce macCatalyst support for if #available.
Upstream the necessary changes to compile `if #available` queries correctly
when a `macabi` target triple or a `-target-variant` is specified.
2024-07-23 17:00:10 -07:00
Kavon Farvardin
5230b19ef6 Test: replace '@_moveOnly' with '~Copyable' 2024-07-23 11:05:33 -07:00
Finagolfin
15e1c73969 [android][test] Enable several C++ Interop and other tests
Also, fix lit.cfg for running the test suite natively in Android and mark one
SILOptimizer executable_test as such.
2024-07-20 17:56:51 +05:30
Dario Rexin
c276904372 Merge pull request #75270 from drexin/wip-131798355
[IRGen] Fix emitPrimitiveLoadPayloadAndExtraTag for CVW
2024-07-16 13:46:55 -07:00
Dario Rexin
e3e06a79e4 [IRGen] Fix emitPrimitiveLoadPayloadAndExtraTag for CVW
rdar://129627898

When casting the projectedBits to Int8, we accidetnally passed the base addr instead of the projectedBits. This was causing the wrong bits to be read.
2024-07-16 10:35:01 -07:00
Kavon Farvardin
a5c8a6252e Test: run reflection test only on host 2024-07-16 07:51:42 -07:00
Kavon Farvardin
ec2a72e6f9 Test: add missing codesign step 2024-07-16 00:43:24 -07:00
Kavon Farvardin
d755e90236 NCGenerics: limit field metadata heuristic
We have had a heuristic that lets you reflect fields of types, where
the field's type is conditionally Copyable, despite the reflection
infrastructure always copying a field. That heuristic was added to allow
ubiquitous types like Optional in the stdlib to continue to be
reflected, even if the Optional at runtime really isn't Copyable.

As a consequence, we were also allowing reflection of fields containing
user-defined conditionally copyable types, when that's unsafe for no
real benefit, yielding runtime crashes!

I think in that case it's better to fall-back on the non-crashy case of
reflection seeing it as the EmptyTupleType, which isn't inhabited, so it
won't try to copy the field and instead basically skip-over it until a
future runtime supports the reflection safely.

So, this patch limits the dangerous reflection to only stdlib-defined
types, until Mirror and friends are updated.
2024-07-15 22:10:17 -07:00
Pavel Yaskevich
be3396821e [AST] Print init accessors when they are ABI-public
Using init accessors from inlinable code requires `@usableFromInline`
annotation, which means that we need to print them in swift interfaces
and serialize them.
2024-07-12 09:54:08 -07:00
Kavon Farvardin
04454054b7 NCGenerics: add availability checking
Not all runtimes can correctly operate with types that use noncopyable
generics. When the generic argument of a type is noncopyable, old
runtimes can't recognize that to correctly check conformances that may
be conditional on those arguments being Copyable, etc.

resolves rdar://126239335
2024-07-07 15:38:00 -07:00
Dario Rexin
5dcd163c42 [IRGen] Always load extra tag bits as full bytes in CVW to avoid elemination of masking
rdar://129627898

LLVM expects integer types of fractional byte sizes to have been written as those types as well, so it expects all unused bytes to be 0.
Since we are using the unused extra tag bits to store tags of outer enums, that assumption does not hold here. In regular witnesses,
the outer enum would mask out those bytes before checking the tag of the inner enum. In CVW we can't do that, so we have to apply the
mask ourselves. To guarantee the mask does not get optimized out, we have to use full bytes instead of fractionals.
2024-07-03 12:32:07 -07:00
Mike Ash
1a088913be [Runtime] Fix printing keypaths with LocalDeclName subscript types.
We assumed a bit too much about the structure of a single-argument subscript demangle tree and assumed that the argument identifier node was always in the same place. If it wasn't, we'd try to get text from the wrong node and get a bogus StringRef. Verify the node kind before trying to extract text, and handle LocalDeclName nodes as well as Identifier nodes.

rdar://129886558
2024-06-24 12:23:44 -04:00
Pavel Yaskevich
68b6c7e58a Merge pull request #74492 from xedin/rdar-127520993
[ClangImporter] Always add `AnyObject` constraint to generic parameters
2024-06-18 13:24:35 -07:00
Pavel Yaskevich
4cc69b85d6 [ClangImporter] Always add AnyObject constraint to generic parameters
`: AnyObject` was added only if there were no other constraints because
all of them would imply it before, with introduction of `Sendable` this
is no longer the case. Let's add `AnyObject` constraint unconditionally
and let generic signature builder deal with the redundancy.

Resolves: rdar://127520993
2024-06-17 12:17:18 -07:00
Kavon Farvardin
9121b26339 Merge pull request #74436 from kavon/demangling-rdar128695929
Demangler: edge case in existential demangling
2024-06-14 21:03:32 -07:00
Kavon Farvardin
b604488f1c Demangler: edge case in existential demangling
We now may have constrained existentials that have no primary associated
types, so there won't be any arguments for the parameterized protocol
type. Because the "constrained" part is that there's an inverse.

resolves rdar://128695929
2024-06-14 12:25:39 -07:00