Commit Graph

5674 Commits

Author SHA1 Message Date
Pavel Yaskevich
88c39db0c3 [Diagnostics] NFC: Fix improved test-cases related to argument-to-parameter mismatches 2019-09-13 22:35:53 -07:00
Pavel Yaskevich
001f46231c [Diagnostics] Fix a typo in argument mismatch diagnostic note 2019-09-13 22:35:52 -07:00
Pavel Yaskevich
a1643d94f7 [Diagnostics] NFC: Update all of the improved test-cases 2019-09-13 22:35:52 -07:00
Holly Borla
40985b6eb7 [Diagnostics] Generalize the "protocol type cannot conform" error to
work for all types that cannot conform to protocols.
2019-09-13 14:51:17 -07:00
Jordan Rose
dc59cd2043 [Sema] Stop visiting existential exprs an extra time checking for uses (#27150)
This was causing an exponential amount of time traversing the AST with
deeply chained protocol extension methods, such as in the
TestCodableRouter.swift test in Kitura.

If the OpaqueValueExpr is referenced more than once within the
OpenExistentialExpr it'll still get visited more than once, but that
doesn't seem to happen in practice. If it turns out to be a problem,
we can weaken the assertion I'm adding here.

https://bugs.swift.org/browse/SR-11012
2019-09-12 20:21:22 -07:00
Holly Borla
0434d58ff0 Merge pull request #27123 from hborla/missing-conformance-diag
[ConstraintSystem] Allow fixing missing conformance failures for `Void` and uninhabited types.
2019-09-12 17:41:19 -07:00
Holly Borla
b2ec5b97b9 [Test] Update type_checker_crashers_fixed/rdar50869732.swift with missing
conformance diagnostics.
2019-09-12 15:41:11 -07:00
Holly Borla
911bcee863 [Test] Update compiler_crashers_2_fixed/0196-rdar48937223.swift with new
missing conformance diagnostics.
2019-09-12 14:23:54 -07:00
Doug Gregor
6329fc0a92 Add fixed crasher from rdar://problem/54609704 2019-09-12 08:55:35 -07:00
Rintaro Ishizaki
da95961de2 [SyntaxParse] Fix a crash in TokenReceiver
rdar://problem/55267292
2019-09-11 10:51:07 -07:00
Jorge Revuelta Herrero
cec0821220 Compiler crash for SR11108 2019-09-11 13:47:15 +02:00
Luciano Almeida
28d3c6c668 Addressing CR comments 2019-09-07 15:06:45 -03:00
Luciano Almeida
ef8af2a057 Adding valid conventions on tests 2019-09-07 12:30:19 -03:00
Luciano Almeida
697c6d1b13 Check for @autoclosure and @convention(c/block) 2019-09-07 11:14:16 -03:00
Luciano Almeida
3401d24945 Adding crasher sr11027 2019-09-07 10:14:39 -03:00
Varun Gandhi
81e7fb45d9 Merge pull request #27064 from varungandhi-apple/vg-mem-hungry-exprcheck-test
Add reduced test case for rdar://problem/54926602.
2019-09-06 17:38:30 -07:00
Varun Gandhi
51db51e796 Add reduced test case for rdar://problem/54926602. 2019-09-06 15:32:44 -07:00
Jordan Rose
e42dd5ac08 [ClangImporter] Protect against re-entrant bridging header loading (#27045)
If, while loading a bridging header, we pick up a Clang module that
claims to have an overlay Swift module, and that Swift module turns
out to have a bridging header, we can end up reallocating the array
of modules to process while we're looping over it. Be defensive
against this occurrence.

This just fixes a crash; it does not at all solve the problem of this
being broken in several ways:

- Accidentally naming your module the same as a system module shadows
  the latter (if the system module is a Swift module) or *makes your
  module into an overlay* (if the system module is a Clang module).

- Bridging headers are only officially supported on executable targets
  and unit tests, but this isn't really enforced.

- Implicit inclusion of a bridging header *when you import a Swift
  module* is a hack to begin with, and a hack that worsens when the
  main module also has a bridging header. (All the bridging headers
  get folded together into the "same" module, which leads to more
  visibility than desired as well as cycles in the import graph.)

- Combining all of these can result in some pretty bizarre behavior.

rdar://problem/54581756
2019-09-05 17:00:14 -07:00
Mike Ash
3e7307b5ce [Reflection] Reenable inherits_ObjCClasses and inherits_NSObject tests on watchOS.
These are working again. I suspect that they were caused by a linker bug we've since worked around.

rdar://problem/50898688
2019-09-04 11:33:30 -04:00
Varun Gandhi
f055791b9a Merge pull request #26939 from varungandhi-apple/vg-mem-hungry-solver-test
Add minimal test case for rdar://problem/54580427.
2019-09-03 09:31:27 -07:00
Pavel Yaskevich
5210e9b7c2 Revert "[AST] Paren'd reference to an IUO function crashes the compiler in SILGen" 2019-09-02 11:02:01 -07:00
swift-ci
95132fd6e6 Merge pull request #26979 from theblixguy/chore/add-compiler-crasher-test 2019-08-31 15:09:16 -07:00
Suyash Srijan
8c5730abe6 [Test] Fix incorrect SR number 2019-08-31 20:10:19 +01:00
Suyash Srijan
d576fc1b83 [Test] Add a compiler crasher 2019-08-31 20:03:06 +01:00
Suyash Srijan
bd53fe355d Revert "[CS] Don't crash when default argument is magic literal and types don't match" 2019-08-31 00:54:37 +01:00
Suyash Srijan
9121f45256 Merge pull request #26944 from theblixguy/fix/SR-11394
[CSDiagnostics] Fix a crasher in MissingContextualConformanceFailure
2019-08-30 07:53:31 +01:00
Suyash Srijan
016e3dc4a6 [Test] Adds a validation test 2019-08-30 00:07:58 +01:00
Varun Gandhi
e4f0f78020 Add minimal test case for rdar://problem/54580427.
The scale test says the behavior is exponential, but it should be
linear, given that (1) we provide a contextual type outside and
(2) there is precisely 1 type which has the corresponding cases.
2019-08-29 15:24:08 -07:00
Suyash Srijan
a2daa11109 Merge branch 'master' into fix/SR-10492 2019-08-28 23:48:08 +01:00
Karoy Lorentey
8fcc94f79e Merge pull request #26885 from lorentey/nein-nein-nein-nein
[test] Denineninenineninify behavioral tests added for 5.1
2019-08-28 15:23:49 -07:00
Michael Ilseman
d30ec5ba79 Merge pull request #26884 from milseman/cache_alignment
[test] Disable misaligned indices test prior to 5.1
2019-08-28 14:23:11 -07:00
Karoy Lorentey
b90e2ef776 [test] Denineninenineninify behavioral tests added for 5.1 2019-08-27 15:44:04 -07:00
Michael Ilseman
774788ac18 [test] Disable misaligned indices test prior to 5.1
Misaligned indices were fixed in 5.1, but we should disable the test
when testing back deployment.

Adds a shared helper to StdlibUnittest for the run time check.
2019-08-27 15:13:38 -07:00
Michael Ilseman
df6e977c93 Merge pull request #26856 from milseman/cache_alignment
[test] Disable some tests in back-deployment scenarios.
2019-08-26 20:07:18 -07:00
Joe Groff
164aadd1b9 Merge pull request #26857 from jckarter/reflection-context-alignment
ReflectionContext: Keep read range properly-aligned.
2019-08-26 19:34:32 -07:00
Joe Groff
33e7ed74bc ReflectionContext: Keep read range properly-aligned.
If a Mach-O image got emitted in just the wrong way, the range of `__TEXT,__swift*` sections to
read could end up starting at an unaligned address (because things like type refs have only one
byte alignment), and this would cause the reflection context to read an unaligned chunk of the
remote memory, causing alignment errors when addresses are mapped to the local copy. Keep the ranges
at least 8-byte-aligned to stave off the alignment issues we might run into with any metadata
structures, which are generally at most pointer aligned. Fixes rdar://problem/54556791
2019-08-26 16:24:26 -07:00
Michael Ilseman
9e8993551b [test] Disable some tests in back-deployment scenarios.
Bugs relating to scalar alignment and grapheme stride caching were
fixed in 5.1, so they shouldn't be tested when back deploying.
2019-08-26 16:06:52 -07:00
Arnold Schwaighofer
031dead69c Try to fix failure of this test on noasserts builds of the compiler
This test failed on the oss-swift_tools-R_stdlib-RD_test-simulator bot.

rdar://54707188
2019-08-26 08:19:26 -07:00
Suyash Srijan
f02a5f3c68 [Test] Add a test case 2019-08-25 20:06:16 +01:00
swift-ci
180a136639 Merge pull request #26821 from gregomni/sil_return_type 2019-08-24 10:11:43 -07:00
Greg Titus
3556fdf557 Sample test in compiler_crashers for sr-11232. 2019-08-24 08:56:06 -07:00
Daniel Rodríguez Troitiño
56107c2284 Merge pull request #26317 from drodriguez/windows-hack-for-crashing-tests
[windows][test] Ensure the ordering of stdout and stderr messages.
2019-08-23 15:23:20 -07:00
Arnold Schwaighofer
818d0f5c3d FAIL test on armv7k
It fails on a bot
rdar://54556791
2019-08-22 09:47:21 -07:00
Alexis Laferrière
5092d18511 Merge pull request #26653 from xymus/fix-ta-to-ta
Fix compiler crasher on type alias with a cycle in the constraints
2019-08-21 09:48:11 -07:00
Slava Pestov
c3bb0afeac Sema: Fix null dereference with invalid TypeAliasDecl
validateDeclForNameLookup() is going away and this won't happen
at all, but let's make sure we have a regression test.
2019-08-20 14:47:52 -04:00
Varun Gandhi
c85eae1efb Get rid of the second call to setType() in validateExtension().
This means that we no longer have the invariant that the extendedType always
contains the generic parameters. So we need to fix the assertions/test cases
for it.
2019-08-19 11:37:18 -07:00
Nathan Hawes
4641792fe1 [Sema] Fix null derefence when diagnosing in bindFuncDeclToOperator
Resolves rdar://problem/54150921
2019-08-15 11:44:14 -07:00
Michael Gottesman
c3b98ef63e Merge pull request #26641 from gottesmm/pr-e2ce007bc9b1b068b1e5e826b43e6973f900347d
[bug-reducer] Disable test for now until I have time to look at this.
2019-08-14 11:41:12 -07:00
Michael Gottesman
ab3db3e37a [bug-reducer] Disable test for now until I have time to look at this. 2019-08-13 14:17:42 -07:00
Alexis Laferrière
6166b222e2 Fix compiler crasher on typealias with a cycle in the constraints
rdar://problem/52463696
SR-11052
2019-08-13 10:20:40 -07:00