Commit Graph

7604 Commits

Author SHA1 Message Date
Greg Parker
69399885ce Test: Reconcile crashOutputMatches() with its own test, and test multiple uses.
Swift SVN r23157
2014-11-07 05:25:08 +00:00
Dmitri Hrybenko
4ac8e65ce3 Remove uses of MODULES_SDK in testing infrastructure
Swift SVN r23115
2014-11-05 04:31:12 +00:00
Dmitri Hrybenko
1347b446c9 Stop using the MODULES_SDK variable in -D flags for the C++ compiler
Swift SVN r23097
2014-11-04 05:44:12 +00:00
Flash Sheridan
05fd8fab81 Add tests for rejection of mixed type operations for all the types in SwiftIntTypes plus Float and Double,
for binary non-logical operators in _The Swift Programming Language_ "Basic Operators."
Until rdar://18695154 is fixed, + and - are disabled; this leaves 1440 tests.
Approved by Dmitri.


Swift SVN r23096
2014-11-04 04:45:50 +00:00
Joe Groff
6c3e43f653 Runtime: Fix race in conformsToProtocol failure case.
Another thread could pull enqueued records into the cache while we're waiting on the lock, leaving us with an empty queue but an updated cache. Recognize this by sticking a generation on the cache and retrying instead of failing if the generation increased while we waited. Fixes rdar://problem/18856858.

Swift SVN r23091
2014-11-04 01:22:33 +00:00
Andrew Trick
9b2fed0383 <rdar://problem/18856858> ArrayBridging validation test temporarily XFAILed
It's not really XFAILed because it's a crash.
Disabling tests is a dangerous game, but this should be very temporary.
A better long term fix is to allow performance tests to run even when
some validation tests fail.

Swift SVN r23088
2014-11-03 21:11:13 +00:00
Doug Gregor
72e9ca5d67 Move the computation of generic signatures into the archetype builder.
The archetype builder is responsible for figuring out what should go
into a generic signature anyway, so move the generic signature
creation there. This will also allow us to eliminate some code
duplication across Sema and AST.

Fixes compiler crasher 033.

Swift SVN r23030
2014-10-31 06:04:05 +00:00
Joe Groff
1c2ec918bd Update validation test for diagnostic drift.
Swift SVN r22946
2014-10-26 04:38:02 +00:00
Dave Abrahams
9857aaa1de [StdlibUnittest] Use _UnitTestArray now
This commit decouples StdlibUnittest from many details of
[Contiguous]Array, so tests can give useful feedback even in the
presence of a broken [Contiguous]Array implementation while we refactor.

Unfortunately, it wasn't practical to make _UnitTestArray use a
storage class other than _ContiguousArrayStorage[Base], so we still have
to watch out when making changes there.

Swift SVN r22875
2014-10-22 05:28:23 +00:00
Dave Abrahams
c799f3687c [StdlibUnittest] Try to use ContiguousArray
ContiguousArray is a simpler component, thus less prone to breakage.
Builting the unit testing framework atop broken components is a very bad
idea, so let's not.

This is a reinstatement of an earlier commit, plus changes to make the
validation tests work.

Swift SVN r22867
2014-10-21 22:17:06 +00:00
Dmitri Hrybenko
fea8a8660a Add an array bridging race test that I forgot to add and commit some
time ago

Swift SVN r22751
2014-10-15 11:00:30 +00:00
Dave Abrahams
1fa082b7f6 Fix a RUN line missed in the test/[1_]stdlib reorg
Swift SVN r22749
2014-10-15 05:14:47 +00:00
Dave Abrahams
afa1ba6f51 Drop stdlib internal access for two tests
Swift SVN r22637
2014-10-09 21:50:27 +00:00
Dave Abrahams
3f36a4d5e7 Use %target-run-stdlib-swift in more tests
Now that it disables access control, this lit definition applies to many
more tests, where we used to use %target-run-stdlib-swift before access
control came online.

Also, drop -Xfrontend -disable-access-control from a bunch of tests that
don't need it.

Swift SVN r22634
2014-10-09 20:53:07 +00:00
Dmitri Hrybenko
d410ee7598 Move FixedPointDiagnostics to the validation testsuite
It is taking too long to run, rdar://18594315

Swift SVN r22619
2014-10-09 09:07:45 +00:00
Dmitri Hrybenko
4e4ebd856b MicroStdlib test: refactor RUN lines according to Jordan's review
Swift SVN r22565
2014-10-07 09:54:59 +00:00
Dmitri Hrybenko
50b2ca7370 Add a micro-stdlib to the validation testsuite
Swift SVN r22547
2014-10-06 19:20:39 +00:00
Manman Ren
699cee5f00 [Printer] print AST types used by SILDeclRef in SIL mode.
This enables us parsing stdlib in non-optimized mode.


Swift SVN r22445
2014-10-01 22:06:41 +00:00
Manman Ren
b47f4d1c3d xfail parser test while I look at the failure on swift-stdlib-release-asserts-noopt.
Swift SVN r22431
2014-10-01 18:17:10 +00:00
Doug Gregor
e3573b2fd2 Drop expected-* annotations from test; it's too messy to -verify. NFC
Swift SVN r22411
2014-09-30 22:32:31 +00:00
Doug Gregor
073af87f3c Fail more gracefully when we're unable to map a dependent type to an archetype.
This can happen due to an error upstream, so don't assert on it. Fixes
rdar://problem/18503131, and crashers #51, #079, and #128.

Swift SVN r22409
2014-09-30 22:27:07 +00:00
Dave Abrahams
156020de19 [stdlib] Rename 'countElements' => 'count'
The name was not only long and unwieldy, but inconsistent with our
conscious decision to avoid the use of "elements" in APIs as mostly
redundant.

Swift SVN r22408
2014-09-30 22:00:26 +00:00
Manman Ren
26130d911b [SILParser] add a validation test to verify parsing of stdlib deserialized from module.
rdar://17979145


Swift SVN r22396
2014-09-30 18:30:31 +00:00
Dmitri Hrybenko
252c2ffba7 stdlib: add a regression test for assert accepting a string literal
rdar://16987306

Swift SVN r22386
2014-09-30 14:39:21 +00:00
Dmitri Hrybenko
a04ee3a463 stdlib/Unicode: allow transcode() to operate on mutable value-typed
sinks

Swift SVN r22302
2014-09-26 17:28:00 +00:00
Dmitri Hrybenko
a3724588cb Fix and expand the AtomicInt test
The previous version of this test was disallowing some thread
interleavings that I did not consider.  See comments in the test for
more details.

Swift SVN r22300
2014-09-26 10:29:56 +00:00
Joe Groff
bdacc06d86 Check off crasher #025.
Swift SVN r22203
2014-09-23 03:28:50 +00:00
Dave Abrahams
a9897a1aa1 [stdlib] Don't test internal APIs in validation
Swift SVN r22190
2014-09-22 22:24:07 +00:00
Joe Groff
4a938f35c7 Add validation test for case in rdar://problem/17963339.
Swift SVN r22141
2014-09-19 19:08:51 +00:00
Doug Gregor
7764f64cf8 Simplify assertion machinery in the standard library.
This change includes a number of simplifications that allow us to
eliminate the type checker hack that specifically tries
AssertString. Doing so provides a 25% speedup in the
test/stdlib/ArrayNew.swift test (which is type-checker bound).

The specific simplifications here:
  - User-level
  assert/precondition/preconditionalFailure/assertionFailer/fatalError
  always take an autoclosure producing a String, eliminating the need
  for the StaticString/AssertString dance.
  - Standard-library internal _precondition/_sanityCheck/etc. always
  take a StaticString. When we want to improve the diagnostics in the
  standard library, we can provide a separate overload or
  differently-named function.
  - Remove AssertString, AssertStringType, StaticStringType, which are
  no longer used or needed
  - Remove the AssertString hack from the compiler
  - Remove the "BooleanType" overloads of these functions, because
  their usefuless left when we stopped making optional types conform
  to BooleanType (sorry, should have been a separate patch).



Swift SVN r22139
2014-09-19 17:56:50 +00:00
Joe Pamer
a474d86305 When checking for shadowed values, account for the fact that we may be checking the rhs of a recursive binding.
This addresses crash suite scenarios 016 and 034. (rdar://problem/17837823)

Swift SVN r22125
2014-09-19 06:12:32 +00:00
Joe Groff
da26c54c06 IRGen: Preserve associated types and witness tables in NecessaryBindings.
Fixes crasher #003 (rdar://problem/18232605). This time, also increase the buffer size for the necessary bindings so we don't clobber memory.

Swift SVN r22118
2014-09-19 04:00:58 +00:00
Joe Pamer
f9db2f0c9d When checking conformances, if we fail to find a witness for one associated type member refrain from attempting to resolve the others.
(If any other associated type member has a dependency on the invalid one, we won't be able to substitute and the compiler will crash.)

This addresses crash suite scenario 035. (rdar://problem/18233020)

Swift SVN r22116
2014-09-19 03:25:35 +00:00
Joe Pamer
ffc37729c8 Revert "IRGen: Preserve associated types and witness tables in NecessaryBindings."
This reverts commit r22108

Swift SVN r22115
2014-09-19 02:49:17 +00:00
Joe Pamer
783a8c6247 Prohibit type declarations within generic functions, which were causing the compiler to crash.
You'll notice that we already had tests that made it appear that such declarations could work,
but they were only avoiding crashes because downstream errors were already marking the
enclosing functions as invalid. (If the errors were fixed, they would also crash the compiler.)

This addresses crash suite scenario 018. (rdar://problem/18299547)

Swift SVN r22109
2014-09-19 00:18:43 +00:00
Joe Groff
b0dea1625f IRGen: Preserve associated types and witness tables in NecessaryBindings.
Fixes crasher #003 (rdar://problem/18232605).

Swift SVN r22108
2014-09-19 00:06:18 +00:00
Joe Groff
bee33a060c Sema: Ban pattern bindings without variables in globals and properties.
There's no real use for declaring a property or global variable without binding it to anything, and closure context mangling relies on having a name to associate with closures. Fixes crash suite #006 (rdar://problem/18232699).

Swift SVN r22105
2014-09-18 22:59:58 +00:00
Joe Pamer
b2891be810 When performing module lookups, respect the resolution mode when deciding whether or not to validate any found declarations.
Doing so prevents another common source of stack overflows in the validator, and addresses crash suite scenarios 002 and 004.
(rdar://problem/18232499, rdar://problem/18232668)

Swift SVN r22104
2014-09-18 22:51:34 +00:00
Joe Pamer
1ea993c317 If the generic type parameters of a class or struct declaration are invalid or otherwise broken, we should treat the declaration as invalid, and be more careful about doing anything that could lead to the creation of bogus archetypes. (Such as implicit constructor/destructor generation, or conformance checking.)
This addresses crash suite scenario 022. (rdar://problem/18232772)

Swift SVN r22095
2014-09-18 20:10:02 +00:00
Joe Pamer
436e135d3d Prevent another stack overflow in the type checker by avoiding recursively validating generic parameter lists. (rdar://problem/18072109 and crash suite scenario 021.)
Swift SVN r22094
2014-09-18 20:10:00 +00:00
Doug Gregor
7f2757b5d0 Update validation suite to use initializers for literal conformances.
Swift SVN r22079
2014-09-18 16:48:47 +00:00
Dmitri Hrybenko
bda201fe95 Fix typo in the test name
Swift SVN r22068
2014-09-18 10:52:17 +00:00
Dmitri Hrybenko
2475a4ea57 stdlib: mark _stdlib_AtomicInt class 'final'
Swift SVN r22067
2014-09-18 09:31:52 +00:00
Joe Pamer
dd141c7cad Account for recursive validation when checking if an existential conforms to itself. (rdar://problem/18042380)
This can only occur when validating mutually recursive existentials in type reference expressions, so it's "safe" to avoid validating member value decls in this case. There are still potential holes in our mechanism for checking for unsupported existentials, but at least this will eliminate another common crasher. (Crash suite scenario 010.)

Swift SVN r22035
2014-09-17 20:23:41 +00:00
Dmitri Hrybenko
78331ff9fa Update HashingPrototype for stdlib API changes
Swift SVN r22021
2014-09-17 13:10:25 +00:00
Joe Groff
d3702950af SILGen: Materialize class-constrained "self" parameters when passed to non-class-constrained protocol methods.
Fixes rdar://problem/17480006, rdar://problem/17557409, rdar://problem/17929884 and crash suite #019.

Swift SVN r21981
2014-09-16 21:12:40 +00:00
Joe Groff
041c179e01 SIL: Continue type lowering after address-only fields of aggregates.
Now that we rely on type lowering to catch recursive value types, this optimization is no longer valid. Fixes rdar://problem/18232757 (crash suite #015).

Swift SVN r21967
2014-09-16 04:55:44 +00:00
Joe Groff
1c4e08a9c8 Fix up a tangle of issues related to reabstraction.
- A spot fix in SILGen for reabstracting the result of a downcast, which fixes checked casts to function types.
- Associate the layout information in type metadata records with the most abstract representation of the type. This is the correct thing to do in cases where we need the metadata as a tag for an opaque value--if we store a value in an Any, or pass it as an unconstrained generic parameter, we must maximally reabstract it. This fixes the value semantics of existentials containing trivial metatypes.
- To ensure that we get runtime layout of structs and enums correct when they contain reabstractable types, introduce a "metadata for layout" concept, which doesn't need to describe the canonical metadata for the type, but only needs to describe a type with equivalent layout and value semantics. This is a correctness fix that allows us to correctly lay out generic types containing dependent tuples and functions, and although we don't really take advantage of it here, it's also a potential runtime performance win down the road, because we could potentially produce direct metadata for a primitive type that's layout-equivalent with a runtime-instantiated type. To aid in type safety here, push SILType deeper into IRGen in places where we potentially care about specific representations of types.
- Finally, fix an inconsistency between the runtime and IRGen's concept of what spare bits unmanaged references and thick metatypes have.

Together, these fixes address rdar://problem/16406907, rdar://problem/17822208, rdar://problem/18189508, and likely many other related issues, and also fixes crash suite cases 012 and 024.

Swift SVN r21963
2014-09-16 01:44:34 +00:00
Doug Gregor
f7458a8e05 Update compiler-crashers testsuite r21946
Swift SVN r21952
2014-09-15 21:00:17 +00:00
Dmitri Hrybenko
ceff82f2ba stdlib/Array: add tests for Array -> NSArray bridging
Swift SVN r21939
2014-09-15 13:49:50 +00:00