Commit Graph

335 Commits

Author SHA1 Message Date
Pavel Yaskevich
b7fcae4822 [Diagnostics] NFC: Adjust a couple of tests which are now valid due to implicit CGFloat conversion 2021-03-17 00:18:10 -07:00
Alexis Laferrière
41e1c5a936 Revert "[Tests] Disable process-stats-dir.py related tests"
This reverts commit f576bebaf1.
2021-02-08 14:27:43 -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
ef6fdf8af5 Revert "[Tests] Disable process-stats-dir.py related tests"
This reverts commit f576bebaf1.
2021-02-03 17:26:56 -08:00
Alexis Laferrière
f576bebaf1 [Tests] Disable process-stats-dir.py related tests 2021-02-01 10:22:10 -08:00
Rintaro Ishizaki
147015da55 [Test] Fix test cases (#34511) 2020-10-30 08:10:51 -07:00
Alejandro Alonso
424802fb34 Revert SE-0283 (#34492)
Reverted despite build failures.
2020-10-29 17:32:06 -07:00
Azoy
e60ef84bd2 Implement Tuple Equatable Conformance 2020-10-22 18:24:28 -04:00
Daniel Rodríguez Troitiño
b047f9e252 [windows] Provide %long-tmp in Windows for extended length temp paths.
In Windows %t might end up very close to the maximum path length of 260
characters. It is possible to use extended lenght paths with a \\?\
prefix. The changes introduce %long-tmp for cases that the test suite
is going over those limits and need a hint in Windows that the path
might be long. It expands to the same as %t in other platforms.

This should fix the test/Misc/stats_dir_profiler.swift in the Windows
VS 2017 CI machines and hopefully not affect anything else.
2020-10-11 12:47:09 -07:00
Doug Gregor
e60a68e1ee Generalize test harder 2020-10-06 14:03:56 -07:00
Doug Gregor
147f9e6c90 Generalize test 2020-10-05 21:29:57 -07:00
Owen Voorhees
6b6b640e13 [Driver] Don't test for null source locations in driver diagnostics
swift-driver doesn't emit these, and there's no reason to check that they're present when using the integrated driver.
2020-09-06 15:33:13 -07:00
Alexis Laferrière
5730163f35 [ClangImporter] Update clang invocation to use the marketing names of CPUs
Update the clang invocation to use the marketing name of Apple CPUs.

rdar://problem/64918604
2020-07-19 14:18:08 -07:00
Onyekachi Ezeoke
434607d004 fix broken tests 2020-06-27 05:53:47 +01:00
Doug Gregor
b656955f79 [Driver tests] Be explicit when we don't care about SDK/target mismatches 2020-06-16 15:53:13 -07:00
Pavel Yaskevich
82fcee7bc7 [Diagnostics] NFC: Adjust diagnostic test-cases improved by new ambiguity diagnosis 2020-06-12 13:13:27 -07:00
Pavel Yaskevich
d9594c712a [TypeChecker] NFC: Adjust tests improved by new approach for ambiguity diagnosis 2020-06-12 11:47:03 -07:00
Rintaro Ishizaki
0a72d023f3 [TypeChecker] Rename 'typeCheckAbstractFunctionBodyUntil()'
to 'typeCheckAbstractFunctionBodyNodeAt()' because that only typecheck
a statement at the position.
2020-05-29 14:45:04 -07:00
Arnold Schwaighofer
e155f03e0d IRGen: Always eliminate frame pointers of leaf functions
rdar://20933449
2020-05-21 13:18:57 -07:00
Varun Gandhi
a1716fe2a6 [Diagnostics] Update compiler diagnostics to use less jargon. (#31315)
Fixes rdar://problem/62375243.
2020-04-28 14:11:39 -07:00
Hamish Knight
dc4b089b9f [CS] Don't fix an _OptionalNilComparison argument
We should only be attempting such overloads for
nil literal args.

Resolves SR-12426.
2020-03-28 17:03:42 -07:00
Luciano Almeida
5aaf2ce7b6 [tests] Fix broken Misc/stats_dir_tracer.swift tests 2020-03-08 23:33:05 -03:00
Doug Gregor
e1c0decdf0 Update some test cases for the OptionalSomePattern change. 2020-02-24 00:48:14 -08:00
Pavel Yaskevich
355148dbe8 Merge pull request #29746 from hborla/ambiguity-with-fixes
[Diagnostics] Refactor diagnoseAmbiguityWithFixes.
2020-02-13 02:42:43 -08:00
Slava Pestov
06855f758d AST: Remove a couple of redundant statistics 2020-02-12 18:29:27 -05:00
Holly Borla
651c27b50b [Diagnostics] Add CSFix::diagnoseForAmbiguity for diagnosing common
fixes that appear in all solutions.
2020-02-11 14:53:27 -08:00
Suyash Srijan
211394099f [CSDiagnostics] Offer a fix-it to insert a return type placeholder when returning from a void function (#29747)
* [CSDiagnostics] Offer a fix-it to insert a return type when returning from a void function

* [CSDiagnostics] Make sure the function name is not empty

The function name will be empty in some cases, for example for property setters. In cases where the function name is empty, skip the note and fix-it.

* [Test] Update existing diagnostics
2020-02-11 10:25:16 +00:00
swift-ci
712d7829d1 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-02-04 09:03:29 -08:00
Owen Voorhees
166555c34f [Diagnostics] Better diagnostic for integer used as a boolean condition 2020-02-03 21:20:41 -08:00
Michael Gottesman
6e9691d806 [master-rebranch] Update TBI test for slightly changed codegen. 2020-01-10 16:38:48 -08:00
Slava Pestov
86f6570662 Stop using SharedTimer except to implement FrontendStatsTracer
Name binding can trigger swiftinterface compilation, which creates
a new ASTContext and runs a compilation job. If the compiler was
run with -stats-output-dir, this could trigger an assertion because
SharedTimer is not re-entrant.

Fix this by replacing all direct uses of SharedTimer in the frontend
with FrontendStatsTracer. SharedTimer is still used to _implement_
FrontendStatsTracer, however we can collapse some of the layers in
the implementation later. Many of the usages should also become
redundant over time once more code is converted over to requests.
2019-11-18 12:05:49 -05:00
Pavel Yaskevich
ee8c78eef5 [Diagnostics] Tailored diagnostic when single tuple used instead of N distinct arguments
Diagnose cases when instead of multiple distinct arguments
call got a single tuple argument with expected arity/types:

```swift
func foo(_: Int, _: Int) {}
foo((0, 1)) // expected 2 arguments, got 1 tuple with 2 elements
```
2019-09-23 13:00:37 -07:00
Pavel Yaskevich
72b61f55bf [Diagnostics] Tailored diagnostic for "condition" expression
Since all condition expressions supposed to be convertible
to `Bool`, let's use that type as contextual and produce a
tailored diagnostic.
2019-09-20 12:37:35 -07:00
Pavel Yaskevich
260a482e1e [Diagnostics] NFC: Adjust some binary operator checks to verify exact diagnostic location
If one of the arguments to binary operator is invalid, let's
verify that diagnostic points directly to it.
2019-09-13 22:35:53 -07:00
Pavel Yaskevich
88c39db0c3 [Diagnostics] NFC: Fix improved test-cases related to argument-to-parameter mismatches 2019-09-13 22:35:53 -07:00
Robert Widmann
df41662c78 Update a flaky test
As we continue to requestify more parts of the compiler, the CHECK lines
here will continue to change.
2019-09-06 17:22:31 -07:00
Robert Widmann
d4bb9a5cfe Define GenericParamListRequest
GenericParamListRequest formalizes the lazy generic parameter list construction pattern we were performing before.
2019-09-06 17:22:30 -07:00
Lei Zhang
81ece42b18 Fix objc_simd test failure on s390x 2019-08-16 11:22:35 -07:00
Pavel Yaskevich
c54913f786 [TypeChecker] NFC: Fix some diagnostics improved by porting contextual mismatches to new framework 2019-08-13 11:55:08 -07:00
Rintaro Ishizaki
db2c11787b [AST] Inherit doc-brief comment from protocol, superclass, and requirement
rdar://problem/38422822
2019-06-20 10:04:05 -07:00
Brent Royal-Gordon
ee65d9159c Update “unable to load standard library” test (#23990)
One of the subtests of Misc/fatal_error.swift assumes that Swift.swiftmodule is located purely based on the resource directory. It can now also be located in the SDK, so the test needs to be updated. Fixes <rdar://problem/49665477>.
2019-04-13 02:03:33 -07:00
Andrew Trick
a7a60d0612 Temporarily disable Misc/fatal_error test.
Until rdar49665477 is fixed. It is failing on certainsystem
configurations.
2019-04-09 15:41:40 -07:00
David Ungar
cf5d81c889 Merge pull request #23735 from davidungar/tracking-primary
[Batch mode] Cope with bugs that cause error  suppression.
2019-04-05 17:45:20 -07:00
David Ungar
6d79bedfa8 Replaced a test. 2019-04-05 11:34:11 -07:00
David Ungar
ee449ae52e Updated test for batch-mode nonprimary errors & removed redundant tests. 2019-04-03 14:12:24 -07:00
David Ungar
bd7a7cfcb2 Update test 2019-04-03 13:53:27 -07:00
Saleem Abdulrasool
03f7fb75e0 test: make Misc.dump_api pass on Windows
`diff` may be intercepted by lit which does not support the `-d` option.
This doesn't really help much for the line differences, so, remove the
`-d` option.  This allows the test to pass on Windows.
2019-03-27 14:54:29 -07:00
Michael Gottesman
f854547c55 [ownership] Enable ownership verification by default.
I also removed the -verify-sil-ownership flag in favor of a disable flag
-disable-sil-ownership-verifier. I used this on only two tests that still need
work to get them to pass with ownership, but whose problems are well understood,
small corner cases. I am going to fix them in follow on commits. I detail them
below:

1. SILOptimizer/definite_init_inout_super_init.swift. This is a test case where
DI is supposed to error. The only problem is that we crash before we error since
the code emitting by SILGen to trigger this error does not pass ownership
invariants. I have spoken with JoeG about this and he suggested that I fix this
earlier in the compiler. Since we do not run the ownership verifier without
asserts enabled, this should not affect compiler users. Given that it has
triggered DI errors previously I think it is safe to disable ownership here.

2. PrintAsObjC/extensions.swift. In this case, the signature generated by type
lowering for one of the thunks here uses an unsafe +0 return value instead of
doing an autorelease return. The ownership checker rightly flags this leak. This
is going to require either an AST level change or a change to TypeLowering. I
think it is safe to turn this off since it is such a corner case that it was
found by a test that has nothing to do with it.

rdar://43398898
2019-03-25 00:11:52 -07:00
Daniel Rodríguez Troitiño
eb0e15a5e8 [test] Style fix for "Transform you-should-be-using-LLVM_DEBUG to Python"
Make the string a multi-line string. To avoid triggering the test itself
with the message, interpolate the DEBUG part into the string.
2019-03-22 17:53:37 -07:00
Daniel Rodríguez Troitiño
620f25c513 [test] Transform you-should-be-using-LLVM_DEBUG to Python.
Avoids the usage of Bash `test` and it should be more portable to other
platforms.
2019-03-21 16:07:25 -07:00