Commit Graph

245 Commits

Author SHA1 Message Date
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
Michael Gottesman
0dfaa19f9f [ownership] Rename enable-sil-ownership => verify-sil-ownership.
I have been meaning to do this change for a minute, but kept on putting it off.
This describes what is actually happening and is a better name for the option.
2019-03-18 01:31:44 -07:00
Slava Pestov
5680bfde55 IRGen: Always use YAML files for completely fragile class layout
The layouts of resilient value types shipped in the Swift 5 standard library
x and overlays will forever be frozen in time for backward deployment to old
Objective-C runtimes. This PR ensures that even if the layouts of these types
evolve in the future, binaries built to run on the old runtime will continue
to lay out class instances in a manner compatible with Swift 5.

Fixes <rdar://problem/45646886>.
2019-02-08 14:22:00 -05:00
Ding Ye
ba2157bbee [Driver] Accept -serialize-diagnostics-path for the interpret mode. (#22113)
This patch allows `-serialize-diagnostics-path` for the interpret mode.
There is one file compiled in such mode, so it makes sense to support
this flag to specify an explicit output path for diagnostics emission.

Resolves: SR-9670
2019-01-25 17:20:32 -08:00
Slava Pestov
a8d1910552 AST: Cache SuperclassDeclRequest
This fixes a significant build time regression since 4.2.

Fixes <rdar://problem/47305605>.
2019-01-15 23:24:36 -05:00
Michael Gottesman
40a09c9c21 Fixup tests for -assume-parsing-unqualified-ownership-sil => [ossa] transition. 2018-12-18 00:49:32 -08:00
Michael Gottesman
0af0d5fddc [ownership] Replace ValueOwnershipKind::Trivial with ValueOwnershipKind::Any.
In a previous commit, I banned in the verifier any SILValue from producing
ValueOwnershipKind::Any in preparation for this.

This change arises out of discussions in between John, Andy, and I around
ValueOwnershipKind::Trivial. The specific realization was that this ownership
kind was an unnecessary conflation of the a type system idea (triviality) with
an ownership idea (@any, an ownership kind that is compatible with any other
ownership kind at value merge points and can only create). This caused the
ownership model to have to contort to handle the non-payloaded or trivial cases
of non-trivial enums. This is unnecessary if we just eliminate the any case and
in the verifier separately verify that trivial => @any (notice that we do not
verify that @any => trivial).

NOTE: This is technically an NFC intended change since I am just replacing
Trivial with Any. That is why if you look at the tests you will see that I
actually did not need to update anything except removing some @trivial ownership
since @any ownership is represented without writing @any in the parsed sil.

rdar://46294760
2018-12-04 23:01:43 -08:00
Mark Lacey
d7cf830842 [ConstraintSystem] Add Array as a designated type for + and +=.
Also add overloads for these operators to an extension of Array.

This allows us to typecheck array concatenation quickly with
designated type support enabled and the remaining type checker hacks
disabled.
2018-11-15 21:42:33 -08:00
Mark Lacey
9cc817db1b Merge branch 'master' into fix-ordering 2018-09-26 17:43:35 -07:00
Ben Cohen
ae6f5dd604 [stdlib] Add consuming/owned annotations to Collection implementations (#19360)
* Add consuming/owned annotations to Collection implementations

* Update SILOptimizer tests

* Fix access_marker_verify test

* XFAIL reconstruct_type_from_mangled_name
2018-09-21 12:06:56 -07:00
Mark Lacey
c6c66f6873 [ConstraintSystem] Change the order in which we visit disjunctions.
Attempt to visit disjunctions that are associated with applies where
we have at least some useful information about the types of all of the
arguments before visiting other disjunctions.

Two tests here got faster, and one slightly slower. One of the
faster tests is actually moving from test/ to the slow/ directory in
validation-test because despite going from 16s to less than 1s, it was
still borderline for what we consider the slow threshold, so I made
the test more complex. The one that got a little slower is
rdar22022980, which I also made more complex so that it is clearly
"slow" by the way we are testing it.

slower:
  rdar22022980.swift

faster:
  rdar33688063.swift
  expression_too_complex_4.swift
2018-09-20 13:15:59 -07:00
Pavel Yaskevich
88f6212c7e [TypeChecker] Un-XFAIL test which used to run out of stack space while solving
Resolves: rdar://problem/32796272
2018-09-17 17:47:36 -07:00
Graydon Hoare
5a563f59af [Stats] Add SWIFTC_MAXIMUM_DETERMINISM to inhibit parallelism everywhere. 2018-09-13 16:15:49 -07:00
Graydon Hoare
6924b55745 [Stats] Make stats_dir_profiler test a little more forgiving. 2018-09-04 16:02:40 -07:00
Graydon Hoare
388e357218 [Stats] Add UnifiedStatsReporter tracing/profiling machinery to request-evaluator. 2018-09-02 02:00:07 -07:00
Graydon Hoare
a72b0f3182 [Stats] Add some tracers to Sema. 2018-09-01 00:07:33 -07:00
Jordan Rose
0d054fbd3c Honor #sourceLocation filenames in serialized diagnostics
I'm not sure why we never handled this. Oops.

rdar://problem/43647151
2018-08-28 11:24:11 -07:00
Graydon Hoare
a25dd40fb9 [Stats] Clear all timers on print, since they stopped self-clearing recently. 2018-08-25 01:24:24 -07:00
Graydon Hoare
fe5667a4b6 [Stats] Change NumInstructions to NumInstructionsExecuted, accept 0 when on VMs. 2018-08-16 13:19:36 -07:00
Graydon Hoare
bdb00fceb0 Add Frontend.NumInstructions statistic, populated on macOS by rusage_info_v4. 2018-08-11 23:28:57 -07:00
Jordan Rose
1ed506a73d Add a test to catch uses of DEBUG(...) instead of LLVM_DEBUG(...) 2018-07-20 15:28:58 -07:00
Robert Widmann
e3118f1e2a Miscellaneous test migrations 2018-06-27 13:31:22 -07:00
Slava Pestov
5d2752f7d2 Run tests with -swift-version 4 by default
Some test now fail, so add an explicit -swift-version 3.
2018-06-19 23:24:19 -07:00
David Ungar
372f8ce8b0 Truncate serialized dia files instead of non-specific error. 2018-06-12 16:26:50 -07:00
Mark Lacey
d135daae44 [ConstraintSystem] Honor -solver-memory-threshold if present.
If the user specifies a memory threshold on the command-line, try to
honor that value and consider expressions too complex if we end up
allocating more memory than they specify.

Fixes rdar://problem/40952582 (aka https://bugs.swift.org/browse/SR-7525).
2018-06-08 17:38:52 -07:00
Saleem Abdulrasool
f17030d7f5 test: explicitly invoke python for process-stats-dir
Explicitly mark the interpreter for the tool as windows does not
implicitly treat shebangs as the interpreter.  This allows for the
proper invocation of the tool on Windows.
2018-06-03 19:26:26 -07:00
Graydon Hoare
d6492eb8a9 Merge pull request #16643 from graydon/rdar-40069856-re-enable-stats-dir-failure-count
<rdar://40069856> Make-deterministic and re-enable Misc/stats_dir_fai…
2018-05-16 13:48:46 -07:00
Graydon Hoare
16d8c50b3f <rdar://40069856> Make-deterministic and re-enable Misc/stats_dir_failure_count.swift 2018-05-15 14:34:29 -07:00
David Ungar
baa2a2bb38 Add test to ensure that an error in only a non-primary causes non-specific errors in the primaries. 2018-05-15 12:49:10 -07:00
David Ungar
167c8dc3a5 Fix error message in tests 2018-05-14 09:22:25 -07:00
David Ungar
c315bddd07 Zeroing in… 2018-05-13 22:16:23 -07:00
David Ungar
5206ce0a31 FIx functionality & address other concerns. 2018-05-13 18:49:53 -07:00
David Ungar
b4dce8222f Track errors 2018-05-12 20:54:19 -07:00
David Ungar
524d88e921 Pass SM in finishProcessing 2018-05-12 19:40:09 -07:00
David Ungar
70aecfef36 Emit error diagnostic for a primary if all errors suppressed 2018-05-11 15:14:42 -07:00
David Ungar
c4f676acc4 Use CHECK-NOT style 2018-05-10 10:43:46 -07:00
David Ungar
aaf51f7853 Addressing review comments. 2018-05-10 10:38:09 -07:00
David Ungar
71a0a56ba4 Testing batch-mode diagnostic suppression. 2018-05-09 20:49:07 -07:00
Michael Gottesman
4f496ca1d8 Disable non-deterministic test while it is investigated.
rdar://40069856
2018-05-08 13:50:08 -07:00
Graydon Hoare
4b76ac0f6c [Stats] Interpret ru_maxrss differently by platform. 2018-03-30 00:37:55 -07:00
Slava Pestov
a6ff28285c Sema: Move most of DeclChecker::visitFuncDecl() to validateDecl() 2018-03-21 23:54:48 -07:00