Commit Graph

311 Commits

Author SHA1 Message Date
Allan Shortlidge
eb16025f56 Tests: Upstream some miscellaneous macCatalyst tests. 2024-07-23 17:00:10 -07:00
Saleem Abdulrasool
e89bfcf63f ClangImporter: handle -target-cpu for x86 targets
`-mcpu` is a deprecated "alias" (unsupported) on x86 targets for
`-mtune`. Unlike `-mcpu`, `-mtune` simply tunes the code for the CPU but
does not prevent execution on other targets. In order to match the
behaviour of `-mcpu` on ARM, we must use both `-march=` and `-mtune=`.
Adjust this behaviour to allow tuning of code for non-Darwin targets.
2024-04-01 14:31:52 -07:00
Doug Gregor
e3c2162be2 Cope with change to default diagnostic style 2024-02-19 02:48:36 -10:00
Rintaro Ishizaki
024726f1f1 [swift-parse-test] Dont show throughput if it the elasped time is zero
Fix division by zero.

rdar://117750086
2023-11-03 09:47:29 -07:00
Meghana Gupta
ab3a651576 Disable Misc/parse_test.swift 2023-11-01 13:13:55 -07:00
Rintaro Ishizaki
66b8946eb4 [swift-parse-test] Add -skip-bodies option
This is no-op for SwiftParser. Also add a sanity check test file.
2023-10-30 13:18:04 -07:00
Allan Shortlidge
50fdfbf7b4 Sema: Support multiple -debug-forbid-typecheck-prefix arguments.
An existing test (Frontend/skip-function-bodies.swift) was designed under the
assumption that multiple `-debug-forbid-typecheck-prefix` arguments were
already supported, and as a result the test was not actually asserting what it
was written to assert.
2023-09-25 16:43:11 -07:00
Hamish Knight
68075696eb [CS] A couple of minor improvements to operator diagnostics
- Simplify the fix locator when looking for a
fix already present in a pattern match, this
avoids us emitting both a diagnostic for the
argument conversion, and for a conformance failure.
- Include tuples in the diagnostic logic where
we emit a generic "operator cannot be applied"
diagnostic, as a conformance diagnostic is
unlikely to be helpful in that case.
2023-05-04 14:53:57 +01:00
Alex Hoppen
cebc084367 [CS] Fix locator simplification with 'Member' path element
Previously, a `Member` path element in a `ConstraintLocator` was simplified to the base on which the member was accessed. This is incorrect.
2023-03-20 09:19:21 -07:00
Luciano Almeida
22a18de1b1 [Sema] Improving integer literal as boolean diagnostic 2023-02-21 10:30:48 -03:00
Doug Gregor
5c217bd17c Add source buffers pretty-printed for diagnostics to serialized diagnostics
When emitting a diagnostic that references a declaration that does not
itself have a source location (e.g., because it was synthesized or
deserialized), the diagnostics engine pretty-prints the declaration
into a buffer so it can provide caret diagnostics pointing to that
declaration.

Start marking those buffers as "generated source buffers", so that we
emit their contents into serialized diagnostics files. This will allow
tools that make use of serialized diagnostics to also show caret
information.
2023-01-06 11:17:29 -08:00
Anthony Latsis
e0ae1afcb7 Gardening: Migrate test suite to GH issues: Misc 2022-09-01 06:35:57 +03:00
Josh Soref
c7e7e67a7b spelling: interpret (#58576)
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-04 14:16:47 -07:00
Luciano Almeida
a97879d46d Merge pull request #42254 from LucianoPAlmeida/refactor-diag-checked-cast
[Sema] Improvements on typeCheckCheckedCast and checked cast diagnostics
2022-04-15 16:39:36 -03:00
Luciano Almeida
c2ce16da19 [tests] Additional tests for some checked cast edge cases 2022-04-14 00:12:57 -03:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Kavon Farvardin
e17e09c294 Enable effectful properties (SE-310) by default.
1. Removes gating on -enable-experimental-concurrency.
2. Updates eff. prop tests to remove experimental flag,
   and also adjusts some tests slightly to avoid things
   that are still behind that flag.
2021-05-03 14:10:44 -07:00
Pavel Yaskevich
c10f04d241 [TypeChecker] Allow Double<->CGFloat conversion with optional promotions
There are APIs that expect a `Double?` or `CGFloat?` argument
and it should be possible to pass `CGFloat` and `Double` respectively.
2021-04-09 12:04:34 -07:00
Pavel Yaskevich
f00c578761 Merge pull request #34401 from xedin/implicit-cgfloat-conversion
[DNM][TypeChecker] Implement Double <-> CGFloat implicit conversion
2021-03-31 10:20:28 -07:00
Kavon Farvardin
494a68998c [test] coverage for key paths to effectful prop/subscript 2021-03-26 07:58:28 -07:00
Pavel Yaskevich
78ae8def65 [CSApply] Make sure to load value before attempting implicit conversion 2021-03-17 00:18:15 -07:00
Pavel Yaskevich
4b01c8fd11 [ConstraintSystem] Adjust impact of implicit Double <-> CGFloat conversions
- Prefer CGFloat -> Double over the other way around to avoid
  ambiguities;

- Every new conversion impacts the score by factor of number of
  previously applied conversions to make it possible to select
  solutions that require the least such conversions.

- Prefer concrete overloads with Double <-> CGFloat conversion
  over generic ones.
2021-03-17 00:18:14 -07:00
Pavel Yaskevich
6ed0c1e34b [TypeChecker] NFC: Add more situations to Double <-> CGFloat tests 2021-03-17 00:18:12 -07:00
Pavel Yaskevich
eebf2e287c [TypeChecker] NFC: Add some more tests for Double <-> CGFloat implicit conversion 2021-03-17 00:18:12 -07:00
Pavel Yaskevich
8c6017687a [ConstraintSystem] Limit new implicit conversion to only Double <-> CGFloat 2021-03-17 00:18:10 -07:00
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