Skip to content

Commit

Permalink
DynamicCastRework, Part 2: Test Suite
Browse files Browse the repository at this point in the history
This validation test exercises a large matrix of types and invariants for
dynamic casting.  It's formulated as a Python script that emits a number of
Swift test programs, compiles, and executes them.  The programs are compiled in
Swift 4 and 5 mode, with -O and -Onone.

The invariants used by these tests follow the specification presented
in PR swiftlang#33010.  It should be easy to add more as desired.

I've tried to design this in such a way that CI logs can provide enough
information to narrowly identify the problem area:  Separate test cases
are generated for each invariant and each type (in particular, this helps
with compiler crashes that report the full body of the function in question).
The files and test suites are named to identify the optimization mode.

The goal of this test suite is to cover a broad cross-section of casting
capabilities and combinations, and to make it easy to expand the matrix of
combinations.  New invariants can easily be added and applied to many types;
as new types are added to this test, they can exploit the existing invariants
and be exercised across all optimization modes.
  • Loading branch information
tbkka committed Nov 2, 2020
1 parent bfe219f commit 61474d8
Showing 1 changed file with 754 additions and 0 deletions.
Loading

0 comments on commit 61474d8

Please sign in to comment.