Commit Graph

6090 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
053aaaca61 Fix crash in merge-modules involving a file with extension of nested type
rdar://74062542
2021-02-06 12:01:14 -08:00
Holly Borla
ef9e62d91c Merge pull request #35801 from hborla/type-checker-regression-test
[NFC] Add a slow type checker test involving string concatenation.
2021-02-06 10:43:59 -08:00
Holly Borla
66de9e39cf [NFC] Add a slow type checker test involving string concatenation. 2021-02-05 16:15:59 -08:00
Dario Rexin
bcd6416c89 Revert "[Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)" (#35789)
This reverts commit 74e59ab77f.
2021-02-05 13:51:39 -08:00
Alexis Laferrière
efb7829741 Revert "Revert "[Tests] Disable process-stats-dir.py related tests"" 2021-02-05 10:06:18 -08:00
Alexis Laferrière
4f2cfb066b Merge pull request #35752 from xymus/revert-disable73834542
Revert "[Tests] Disable process-stats-dir.py related tests"
2021-02-04 17:58:13 -08:00
Dario Rexin
74e59ab77f [Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)
* [Concurrency] Build C only libdispatch before Swift on non-Darwin platforms

_Concurrency depends on libdispatch and since it is not available by
default on non-Darwin platforms, it needs to be built before the Swift
project, so that the dependency can be resolved.

* Fix clibdispatch installation and BuildSystem tests

* Fix build system tests on Darwin and formatting
2021-02-04 17:15:30 -08:00
Holly Borla
b5e17fb6d7 Merge pull request #35744 from hborla/solver-disjunction-selection
[ConstraintSystem] Tweak disjunction selection
2021-02-04 09:01:47 -08:00
Alexis Laferrière
ef6fdf8af5 Revert "[Tests] Disable process-stats-dir.py related tests"
This reverts commit f576bebaf1.
2021-02-03 17:26:56 -08:00
Holly Borla
752cf7f2ac [ConstraintSystem] Consider the number of resolved argument types
for applied overloads when selecting a disjunction to attempt.
2021-02-03 13:26:57 -08:00
Eric Miotto
187f4dbaf8 [Build] Add option to alter default location of module cache in Linux (#35711)
This is meant to support parallel CI runs on the same Linux bot, so that
they don't share the module cache and reduce (hopefully) the likelihood
of issues related to invalid signatures.

When the option is enabled, the environment variable `XDG_CACHE_HOME`
is explicitly set in `build-script` and should be inherited by all the
child processes.
Currently we don't check the operating system before setting the
variable (since it should be a noop for other OSes).

Addresses rdar://73887745
2021-02-03 07:32:29 -08:00
David Zarzycki
fc468e1f36 Merge pull request #35682 from davezarzycki/pr35682
[Testing] NFC: Make BoxingCasts test concurrent
2021-02-02 08:03:26 -05:00
Mishal Shah
5210c3b38f Merge pull request #35663 from apple/pr-rebranch
Support new changes from swift/rebranch on llvm-project repo
2021-02-01 17:42:27 -08:00
Daniel Rodríguez Troitiño
748339a83a [test] Mark concurrency tests with appropiate REQUIRES. (#35624)
The Python build system always enables concurrency, but CMake has it
disable by default. Collaborators that do not use the Python build
system and use directly CMake will have it disable, unless they
explicitely enable it. If the tests are not marked as requiring the
concurrency features, the tests will fail to execute when concurrency is
disabled.

The changes add the `REQUIRES: concurrency` line to many tests that deal
with concurrency, but wasn't marked as such.
2021-02-01 11:45:15 -08:00
Alexis Laferrière
f576bebaf1 [Tests] Disable process-stats-dir.py related tests 2021-02-01 10:22:10 -08:00
David Zarzycki
716e38c572 [Testing] NFC: Make BoxingCasts test concurrent
This test is the slowest test on my machine.
2021-02-01 08:11:50 -05:00
Michael Gottesman
6e61279dec Merge pull request #35587 from gottesmm/pr-5db2d0b093c814bacaaf559563926c5dec16acc3
[ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
2021-01-27 10:13:54 -08:00
Alexis Laferrière
fe4d46cea9 Merge pull request #35590 from xymus/reword-module-build-error
[ModuleInterface] Update wording of the "failed to build module" error
2021-01-26 18:52:24 -08:00
Alexis Laferrière
b79c7b627b [ModuleInterface] Update wording of the "failed to build module" error
The error shown when the compiler fails to build a module from its
textual interface has been creating some confusion. This is a proposal
to make it more useful to the programmer not working in the SDK, insist
on looking at the previous errors first, put less emphasis on possible
compiler bugs, and always show alternatives to the incompatible
compilers issue as this is the most common case now.
2021-01-26 15:36:46 -08:00
Michael Gottesman
1de2d3f7c0 [ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
This follows the design of how we handled this with
sil-verify-all. Specifically, the default behavior is to run only in asserts
builds, but one can use the two flags: enable-ast-verifier and
disable-ast-verifier to override the default behavior.

The reason why this is interesting is that this means that when compiling
normally, we will not run the verifier, so we won't have a perf hit. But we can
now ask the user to run with this flag (or in a future maybe a re-run in the
driver would do this for them), saving us time when screening bugs by avoiding
the need to build an asserts compiler to triage if the ASTVerifier would catch
the bug.
2021-01-25 11:55:47 -08:00
tbkka
35dad1161a Fix reflection_Optional_Any to support non-Apple platforms (#35546)
* Fix reflection_Optional_Any to support non-Apple platforms

Apple and non-Apple platforms happen to use different number
of extra inhabitants in 64-bit pointers.  This is already
supported by the test framework, we just need to fill it in
properly for this one test.

* Remove OS= restriction
2021-01-22 11:51:37 -08:00
Robert Widmann
d4f92d4116 Merge pull request #35527 from CodaFi/context-clues
Use the Correct DeclContext When Simplifying Member Constraints
2021-01-20 19:07:28 -08:00
Robert Widmann
0943351fe7 Use the Correct DeclContext When Simplifying Member Constraints
Looking for the parent source file is going to fail when the paramter
we're interested in comes from a module context. Request the correct
top-level context in those situations.

rdar://73379770
2021-01-20 15:42:35 -08:00
David Zarzycki
ab2f6c701b [Testing] Unbreak unified build testing
This test assumes an Apple platform but for reasons unknown, the Linux
bots (wrongly?) consider this test to be unsupported.
2021-01-20 08:51:06 -05:00
Dave Lee
e843c72ff9 Merge pull request #35433 from apple/Reflection-Support-OpaqueExistential-in-RecordTypeInfo-readExtraInhabitantIndex
[Reflection] Support OpaqueExistential in RecordTypeInfo::readExtraInhabitantIndex
2021-01-19 20:17:52 -08:00
Tim Kientzle
cb1173d928 More test adjustments 2021-01-19 14:15:07 -08:00
Tim Kientzle
7f8bebb467 Merge branch 'Reflection-Support-OpaqueExistential-in-RecordTypeInfo-readExtraInhabitantIndex' of https://github.com/apple/swift into Reflection-Support-OpaqueExistential-in-RecordTypeInfo-readExtraInhabitantIndex 2021-01-19 12:32:10 -08:00
Tim Kientzle
73db0134c8 Rename test case, fix typos 2021-01-19 12:29:45 -08:00
Dave Lee
7ed7122c6b test fixes 2021-01-19 12:27:32 -08:00
Dave Lee
340b85fe03 add reflect_Optional_Any.swift
Authored by Tim Kientzle @tbkka
2021-01-19 10:06:48 -08:00
Luciano Almeida
1d7d282065 Merge pull request #35255 from LucianoPAlmeida/SR-12383
[SR-12383][Diagnostics] Do not use canonical type for aka diagnostics instead walk the type recursivelly desugaring
2021-01-19 08:19:00 -03:00
Slava Pestov
c8aee4180e Sema: Fix a couple of crash-on-invalid problems with class inheritance
It is possible for ClassDecl::getSuperclassDecl() to succeed but for
ClassDecl::getSuperclass() to fail. This happens if the superclass is
a generic type and one of the generic arguments could not be resolved,
or does not satisfy the generic requirements, for example; in that
case, a BoundGenericType cannot be formed.

In a couple of places we were not prepared for this possibility.
Let's recover by making judicious use of ErrorType.

Fixes <rdar://problem/73169149>.
2021-01-17 18:06:13 -05:00
Varun Gandhi
b263e99d71 Merge pull request #35367 from mininny/simplify-unused-lvalue-wording
[Diagnostics] Simplify unused lvalue warning wording
2021-01-16 14:29:43 -08:00
Minhyuk Kim
7eaabe1996 Simplify unused lvalue warning wording 2021-01-15 22:14:56 +09:00
Robert Widmann
a4d76261f0 Pass -target to lit Tests instead of -arch
A follow-on to b436825948 where
-m${platform}-version-min was traded for -target. The lit substitution
for %target-clang was relying on -arch and -version-min to specify the
intended platform version to the linker. With the removal of
version-min, only arch was given, so a fallback platform was selected.
For the iPhone simulator, for example, this is iOS 10.99 despite there
being no such simulator for that deployment version. Provide the variant
triple everywhere instead. This has the added benefit of unifying the
special paths catalyst takes.

Fixes rdar://73174820
2021-01-14 13:33:30 -08:00
Luciano Almeida
b9dec7da4c [test] Adjusting tests for generic parameters that are now being aka on diagnostics 2021-01-14 17:44:52 -03:00
Ben Barham
86c292c10c [Test] Temporarily disable tests blocking PR testing 2021-01-14 12:09:14 +10:00
Anthony Latsis
afcb1665f8 GSB: Handle concrete ResolvedTypes in ArchetypeType::resolveNestedType()
A nested type of an archetype type might be concrete, for example, via a
same-type constraint:

extension SomeProtocol where SomeAssoc == Int {
  ... Self.SomeAssoc ...
}

This can happen in one of two ways; either the EquivalenceClass of the
nested type has a concrete type, or it is "fully concrete" because
there is no equivalence class and maybeResolveEquivalenceClass() returns
a ResolvedType storing the concrete type.

For some reason we didn't handle the second case here.

Fixes https://bugs.swift.org/browse/SR-13519 / rdar://problem/68531679
2021-01-12 23:52:44 -05:00
Andrew Trick
677424b337 Merge pull request #35315 from atrick/fix-settestlifetime
Add a _fixLifetime to stdlib/Set.swift test.
2021-01-08 21:16:17 -08:00
Andrew Trick
0aa91f46ec Add a _fixLifetime to stdlib/Set.swift test.
On Linux with -O:

[ RUN      ] Set.formSymmetricDifference
stdout>>> check failed at /Users/docker_user/src/build/buildbot_linux/swift-linux-x86_64/main.swift, line 3245
stdout>>> unexpected value: "94788628116752" (of type Swift.Int)
[     FAIL ] Set.formSymmetricDifference

The test is roughly:

  var s1 = Set(...)
  let s1_copy = s1

  let identity1 = s1._rawIdentifier()
  s1.someMutatingMethod1()

  check(s1)
  check(s1_copy)

  s1.someMutatingMethod2()

  // Mutating the set should cause an identity change
  releaseAssert(identity1 != s1._rawIdentifier())

On Linux, the optimizer is able to destroy s1_copy before the call to
s1.someMutatingMethod2(), which generates new Set storage. This new
storage uses the same address as the destroyed s1_copy.

Fixes rdar://72933150 ([CanonicalOSSA] Fix Set.swift unit test that assumes object lifetime)
2021-01-08 11:52:33 -08:00
Karoy Lorentey
4b2f032fac [test] Disable tests for newly introduced Range behavior on earlier OSes 2021-01-06 13:03:58 -08:00
Mike Ash
4ccfdfb72a [Runtime] Fix StableAddressConcurrentReadableHashMap threading crash.
StableAddressConcurrentReadableHashMap::getOrInsert had a race condition in the first lookup, where the snapshot was destroyed before the pointer was extracted from the returned wrapper. Fix this by creating the snapshot outside the if so that it stays alive.

rdar://problem/71932487
2020-12-21 16:52:56 -05:00
Pavel Yaskevich
e985d97e05 Merge pull request #35127 from xedin/rdar-38378503
[TypeChecker] Un-XFAIL perf test-case for rdar://23620262
2020-12-18 10:45:01 -08:00
David Zarzycki
238413d349 [testing] add missing REQUIRES: concurrency 2020-12-17 09:03:04 -05:00
Nate Chandler
d2726c31bb [Async CC] Don't lookup known archetype conformance.
Previously, when saving NecessaryBindings for an async function, if a
type that was passed-in happened to be an archetype, a lookup for that
type's conformance would always be done.  However, that lookup was not
always necessary or possible such as in the case where both the metadata
and the witness table were provided to the function in an async context.
Here, that is fixed by using the conformance that was seen when
constructing the NecessaryBindings if one is available.

rdar://problem/72397303
2020-12-16 17:20:31 -08:00
Pavel Yaskevich
0d040e2420 [TypeChecker] Un-XFAIL perf test-case for rdar://23620262 2020-12-16 12:04:15 -08:00
Pavel Yaskevich
c6bdeea852 [ConstraintSystem] Strengthen dependent member type checks while inferring bindings
Look through specifier (inout, l-value) and optional types while
checking for presence of dependent member types to avoid inferring
incorrect bindings (which could lead to infinite recursion in the
solver).

Resolves: SR-13856
Resolves: rdar://problem/71383770
2020-12-14 16:39:13 -08:00
Nate Cook
c35b567001 Temporary removal of RangeSet/DiscontiguousSlice (#35076) 2020-12-14 08:42:01 -06:00
Karoy Lorentey
8082b58365 Merge pull request #34961 from lorentey/buffers-need-to-be-fast-but-not-too-fast
[stdlib] Review and fix some problems with unsafe buffer and Range initialization
2020-12-12 19:13:20 -08:00
Zoe Carver
3dff6226e3 Merge pull request #28484 from zoecarver/optimize/mandatory-function-cleanup-pass
Remove dead function cleanup from mandatory inlining
2020-12-11 16:49:49 -08:00