Commit Graph

8 Commits

Author SHA1 Message Date
Dmitri Gribenko
5c9214329d Annotate tests as executable 2016-02-04 09:42:26 -08:00
Slava Pestov
5a53ac6078 Better tests for _typeByName()
These catch a regression I introduced with my previous patch that I reverted:

<65dd0e7b93>
2016-01-29 00:05:10 -08:00
Erik Eckstein
adef0368bb tests: add import statements to workaround linker errors in all relevant tests.
This is needed if we compile StdlibUnittest with -sil-serialize-all
So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining).
Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
2016-01-21 09:59:50 -08:00
Slava Pestov
32bd7705bf IRGen: Test emission of conformances for concrete subclasses of generic classes
This was fixed by Luke Howard as part of some other changes in the
following patch:

<b5880f386b>

After rebasing my fix, I noticed most of it disappeared.
However, it's still worth checking in the tests.

Fixes <rdar://problem/24183374>.
2016-01-15 21:34:53 -08:00
Luke Howard
b5880f386b allow name lookup to work with resilient types
cleanup from review comments
2016-01-16 09:38:35 +11:00
Slava Pestov
c45dc6dad9 More resilient class layout tests
Looks like subclassing classes with resiliently-sized properties works,
as long as the subclass is @_fixed_layout, so let's ensure that's tested.

We don't want @_fixed_layout classes to be a thing though, and we still
can't handle changes to the number of stored properties in a base class,
so a couple of tests are disabled until I land some more patches.
2016-01-07 06:52:39 -08:00
Slava Pestov
2a27acd5e8 IRGen: Fix resilient class layout on Linux
When there's no Objective-C runtime, we have to store the field offset
globals ourselves.
2016-01-06 12:24:28 -07:00
Slava Pestov
800821f980 IRGen: Layout of root classes containing resiliently-sized fields
Now that all the machinery is in place, the ClassMetadataBuilder
can (more accurately) query the ClassLayout instead of trying to
re-derive whether the field offset vector is dependent, etc.

Apart from performing dynamic layout for resiliently-sized fields
in concrete classes, this also lets us *skip* dynamic layout
if we have a generic class without any dependent fields.

I haven't tested subclassing with resilient field layout yet, but
getting that working is the next step and should not be too much
work.

Also, swift_initClassMetadata_UniversalStrategy() only stores
the computed field offsets in the field offset globals when the
Objective-C runtime is available, because it gets the offset
pointers from the Objective-C class rodata. On Linux, we will
need to emit code to copy from the field offset vector into
field offset globals in IRGen. This is pretty easy, but I'll do
it in a follow-up patch so for now the new execution test is
XFAIL'd on Linux.
2015-12-24 02:54:56 -08:00