Commit Graph

2588 Commits

Author SHA1 Message Date
Arnold Schwaighofer
591fc4abfd Revert "tests: Temporarily disable Interpreter/struct_extra_inhabitants.swift in optimize mode"
This reverts commit 8ef908eca7.
2021-12-06 07:41:51 -08:00
Erik Eckstein
8ef908eca7 tests: Temporarily disable Interpreter/struct_extra_inhabitants.swift in optimize mode
rdar://86054209
2021-12-05 13:19:55 +01:00
Michael Gottesman
785153045b [move-operator] Start having SILGen emit lexical lifetimes and teach the optimizer how to maintain lexical lifetimes until the lexical lifetime elimination.
I am doing this so that I can use lexical lifetimes to emit diagnostics such as
the move operator diagnostics.
2021-11-29 18:02:13 -08:00
Karoy Lorentey
e2cfab4f28 [stdlib][test] Adopt availability macros in tests 2021-10-31 15:00:58 -07:00
Doug Gregor
18323ddda9 Disable runtime exclusivity checking when using back-deployed concurrency.
The back-deployed concurrency libraries and older Swift runtimes are
not compatible, so turn off runtime exclusivity checking when running on
older systems. Fixes rdar://84274148.
2021-10-14 15:40:33 -07:00
swift-ci
5a85c126b0 Merge pull request #39497 from kavon/backdeploy-mangling-wip 2021-09-29 19:23:08 -07:00
Max Desiatov
04b47d7bdc test: mark a few tests as unsupported on Wasm/WASI (#39504)
Certain traps can't be supported on WASI, such as expectations for crashes, `setjmp` use, dynamic linking, multi-threading etc. These tests are marked as `UNSUPPORTED` when targeting Wasm/WASI.
2021-09-29 16:25:38 +01:00
Kavon Farvardin
b3b4bed070 re-enable test that was mistakenly not re-enabled after being fixed 2021-09-28 14:51:43 -07:00
Konrad `ktoso` Malawski
e7342eb878 Merge pull request #39365 from kateinoigakukun/katei/fix-coop-executor-part-2
[Concurrency] repair cooperative executor and its tests
2021-09-27 09:47:09 +09:00
Yuta Saito
722d790480 [test] mark multi-thread based tests as UNSUPPORTED in single-thread
Some of test cases assumes that the runtime is built for multi-threaded
platform.
2021-09-21 22:55:29 +00:00
Kuba (Brecka) Mracek
b8b717e71b Disable llvm_link_time_opt.swift test under ASan (#39325) 2021-09-16 07:37:25 -07:00
Doug Gregor
3ee09a2298 Switch concurrency runtime tests to "REQUIRES: concurrency_runtime"
Rather than blanket-disabling concurrency tests when we aren't using a
just-built concurrency library, enable them whenever we have a
suitable concurrency runtime, either just-built, in the OS, or via the
back-deployment libraries.
2021-09-13 12:34:20 -07:00
Kuba (Brecka) Mracek
a3c7d6c139 Use the just-built Darwin libLTO.dylib in lit tests (#39208) 2021-09-08 20:17:28 -07:00
Arnold Schwaighofer
ef0bb9932d Re-enable remote_run tests that were disabled
The underlying issue was supposedly fixed a while ago.
2021-08-03 13:51:15 -07:00
Mike Ash
4efb9ac0ac [Tests] Mark some tests as unsupported in back deployment testing.
These tests require a newer runtime and fail on older OSes:

   test/Concurrency/Runtime/actor_detach.swift
   test/Concurrency/Runtime/actor_init.swift
   test/Interpreter/rdar80847020.swift
   test/stdlib/Reflection_objc.swift
2021-07-28 17:49:40 -04:00
Doug Gregor
eeeea49764 Remove -enable-experimental-concurrency almost everywhere. 2021-07-26 21:24:43 -07:00
Rintaro Ishizaki
c0be9dfb14 [Test] Disable Interpreter/objc_extensions_jit.swift
rdar://80923668
2021-07-22 16:24:17 -07:00
Rintaro Ishizaki
def0f1d4d8 Revert "[Test] Disable Interpreter/objc_extensions_jit.swift" 2021-07-22 16:22:42 -07:00
Rintaro Ishizaki
b8bb6d7822 [Test] Disable Interpreter/objc_extensions_jit.swift
rdar://80923668
2021-07-22 12:09:55 -07:00
Nate Chandler
9f3c7b4134 [Test] Added missing flag to Interpreter/rdar80847020.swift.
As of https://github.com/apple/swift/pull/38510 -Xfrontend
-disable-availability-checking is needed.
2021-07-21 15:27:19 -07:00
nate-chandler
d1cb7b91db Merge pull request #38518 from nate-chandler/rdar80847020
[SILGen] Precompute "returned" completion handler indices.
2021-07-21 13:20:59 -07:00
Becca Royal-Gordon
04775d41ea Merge pull request #38419 from beccadax/the-generic-bound-is-cheaper
[IRGen] Fix crashes involving ObjC generic params
2021-07-21 10:15:23 -07:00
Nate Chandler
304013683c [SILGen] Precompute "returned" completion handler indices.
When generating the completion handler that is passed to ObjC methods
that are being called as async Swift functions, the parameters taken by
the generated completion handler are matched up with the values that are
returned from the async function.

Previously, this process was done by starting at the index into the list
of values expected to be returned, adding 1 if the index matched first
the error index and second the flag index, and finally adding 1 to
account for the fact that the initial parameter to the completion
handler is the block_storage parameter.

That strategy was problematic: it failed to increment indices
appropriately because it did not skip past the block_storage parameter
to begin with; it also failed to increment indices appropriately in
certain cases where the flag and error parameters appeared in an
unexpected order (flag first, then error).

Here, the process is made more robust.  Now, the indices which
correspond to the block_storage, flag, and error parameters are filtered
out to begin with.  The remaining indices can then be indexed into
using the index into the result tuple (or 0 if the result is not a
tuple).

rdar://80847020
2021-07-20 14:32:32 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Becca Royal-Gordon
70d120bc71 [IRGen] Accommodate ObjC generic classes better
Classes using the type-erased Objective-C generics model are represented in parts of IRGen as UnboundGenericTypes, which is a problem because a number of code paths expect all generic types to be bound. Update some of these that are involved in extensions on ObjC generic types.
2021-07-19 19:59:27 -07:00
Doug Gregor
d18a2b7fda Re-enable actor inheritance from NSObject.
For now, it's the only way to get NSObjectProtocol conformance.
Fixes rdar://80476009.
2021-07-12 16:12:35 -07:00
Doug Gregor
164505cb2c Merge pull request #38246 from DougGregor/actor-objc-without-nsobject
[SE-0306] Disallow actor inheritance from NSObject, but allow `@objc actor`
2021-07-03 08:07:52 -07:00
Doug Gregor
6406f08661 [SE-0306] Disallow actor inheritance from NSObject, but allow @objc actor.
Allow an actor to be exposed to Objective-C via `@objc` without
inheriting from `NSObject`, and remove the loophole that allowed
actors to inherit from `NSObject`.

Fixes rdar://78333614
2021-07-02 23:37:09 -07:00
Mike Ash
cc0d207050 [Test] Disable Interpreter/SDK/objc_bridge_cast.swift and Interpreter/SDK/objc_dealloc.swift.
These tests are failing intermittently. Disabling them to keep PR testing happy while we figure out why.

rdar://80079617
2021-07-02 08:51:29 -04:00
Mike Ash
3e027b7cea [Runtime] Set fastDeallocSupported to false on i386 simulators.
The conditional should have been "Intel simulators" but it was actually "x86-64 simulators." The i386 simulator doesn't have the weak formation callout, which causes it to miss cleaning up associated objects when the Swift runtime thinks it does.

rdar://79672466
2021-06-23 16:45:06 -04:00
Varun Gandhi
35d4b4ce38 Temporarily turn off 2 ObjC related tests.
These are failing (rdar://79672466); temporarily mark
them unsupported to unblock PR testing.
2021-06-23 11:18:23 -07:00
Mishal Shah
5a7b8c7922 Merge pull request #37823 from apple/xcode-13-beta-main
[main] Support Xcode 13 beta
2021-06-10 09:21:09 -07:00
Mishal Shah
23c3b15f5f Support Xcode 13 beta
* Updating availability versions
* Remove all remaining overlays in stdlib/public/Darwin/*:
   - ObjectiveC
   - Dispatch
   - CoreFoundation
   - CoreGraphics
   - Foundation
2021-06-07 12:04:31 -07:00
Michael Gottesman
0b95d6c389 Fixes in response to feedback on #37771. 2021-06-06 14:40:41 -07:00
Michael Gottesman
524c5e0e14 When running with the interpreter on Darwin, force the usage of the just built, stdlib when running the frontend.
This is because we currently JIT in process resulting in weirdness around
swift-frontend wanting to link against the host stdlib and the exec swift code
wanting to link against the target stdlib. For now, we work around this by just
saying in that case we will force swift-frontend to use the just built runtime
so we are consistent. The only potential problem is that a bug in the just built
runtime may now cause these tests to fail. But overall, that would suggest a
problem we may want to catch in it of itself, so the work around I think makes
sense until JITing is done in a separate process (which I think is the right fix).

rdar://78768013
2021-06-03 15:07:37 -07:00
Ben Langmuir
85037548de Disable test/Interpreter/async_resilience.swift for back deployment
Match the other Interpreter async tests and disable this test case for
back deployment scenarios.

rdar://78464319
2021-05-25 10:32:47 -07:00
David Zarzycki
c505daffac [Testing] Add REQUIRES: concurrency 2021-05-23 15:34:32 -04:00
Arnold Schwaighofer
24925db1f5 Use a async function pointer for default async protocol witness implemenations
Protocol witness table entries of async functions need to be async
function pointers.

rdar://77474699
2021-05-21 13:50:10 -07:00
Arnold Schwaighofer
fab111b9bc Revert "Disable Interpreter/async_fib.swift" 2021-05-19 06:59:14 -07:00
Andrew Trick
485903b57b Disable Interpreter/async_fib.swift
Test fails sporadically on macOS-x86_64 and other configurations.
rdar://78192131
2021-05-19 00:02:19 -07:00
Slava Pestov
af6ec5a871 GSB: When looking at protocol refinements, only consider other sources on 'Self'
In a protocol requirement signature, a conformance requirement on 'Self'
can only be considered redundant if it is derived entirely from other
sources only involving 'Self' as a subject type.

What this means in practice is that we will never try to build
a witness table for an inherited conformance from an associated
conformance.

This is important since witness tables for inherited conformances
are realized eagerly before the witness table for the original
conformance, and allowing more complex requirement sources for
inherited conformances could introduce cycles at runtime.

What used to happen is that we would emit a bogus 'redundant conformance'
warning if a refined protocol conformance was also reachable via a
same-type requirement involving 'Self'. Fixing this warning by removing
the requirement could produce code that type checked, however it could
crash at runtime.

In addition to the runtime issue, such 'overly minimized' protocols
could also break name lookup at compile-time, since name lookup
only consults the inheritance clause of a protocol declaration instead
of computing its generic signature to determine the set of refined
protocols.

Now, we will no longer emit the bogus redundant conformance warnings.
Instead, we produce a warning if a protocol is 'overly minimized'.

Since the 'overly minimized' protocols that were obtained by fixing
the bogus warning would in some cases still work, we cannot diagnose
the new violation as an error, to preserve source and ABI compatibility.

Currently this warning fires for the SIMDScalar protocol in the
standard library, and _ErrorCodeProtocol in the Foundation overlay.
We should see if we can fix the protocols in an ABI-compatible way,
or just add a hack to muffle the warning.

Fixes https://bugs.swift.org/browse/SR-8198 / rdar://problem/77358480,
https://bugs.swift.org/browse/SR-10941 / rdar://problem/77358477,
https://bugs.swift.org/browse/SR-11670 / rdar://problem/77358476.
2021-05-17 21:55:11 -04:00
Arnold Schwaighofer
b0c977f149 This test fails on windows 2021-05-16 07:24:15 -07:00
Arnold Schwaighofer
9b4f7d62cd Make sure we tail call optimize a call in concurrency runtime's switch_task_impl.
Without this hack the call will leave a stack frame around (not tail
call optimized) and blow the stack if we call switch_task often enough.

Ideally, clang would emit this call as `musttail` but currently it does
not.

rdar://76652421
2021-05-15 08:07:55 -07:00
Arnold Schwaighofer
6696bcf5b2 IRGen: Fix the insert point after inserting the dynamic replacement prolog
The code used the last basic block in the function instead of the last
basic block created for the dynamic replacement prolog.

rdar://77073666
2021-05-03 11:47:13 -07:00
Alexis Laferrière
955a572819 [Test] Fix line numbers in objc_swift3_deprecated_objc_inference.swift 2021-04-30 21:46:33 -07:00
Alexis Laferrière
28e8149867 [Test] Disable objc_swift3_deprecated_objc_inference.swift for 32 bits watchOS 2021-04-30 15:36:00 -07:00
Doug Gregor
02821fd0f4 Merge pull request #37053 from DougGregor/disable-actor-inheritance 2021-04-24 22:31:09 -07:00
Doug Gregor
b88e678694 [SE-0306] Disable actor inheritance.
Actor inheritance was removed in the second revision of SE-0306. Remove
the ability to inherit actors.

Note that this doesn't fully eliminate all vestigates of inheritance
from actors. There are simplifications that need to be performed
still, e.g., there's no need to distinguish
designated/convenience/required initializers. That will follow.
2021-04-23 15:08:57 -07:00
Arnold Schwaighofer
e50d5c313c Merge pull request #37039 from aschwaighofer/fix_async_dyn_repl_compiler
IRGen: Fix async dynamic replacements
2021-04-23 13:26:15 -07:00
Arnold Schwaighofer
87e7c1c655 Re-enable test/Interpreter/async.swift on arm64e 2021-04-23 10:01:26 -07:00