Commit Graph

7 Commits

Author SHA1 Message Date
Tim Kientzle
f73cfa7396 Reflection tests are incompatible with ASAN 2024-07-26 09:55:08 -07:00
Tim Kientzle
a6ff81345a Make some tests work better on varying platforms.
In particular, the exactly internal layout of Array<> is quite
different between macOS and Linux, which makes it impractical
for use in tests like this.  An empty class is still a reference
and doesn't introduce so many complications.
2023-04-12 16:40:44 -07:00
Tim Kientzle
ef0eafc84f Generalize a test to work correctly on Linux aarch64 2023-04-11 17:40:07 -07:00
Tim Kientzle
e573366a53 Fix handling of generic MPEs
This exercises a number of cases that the previous logic got
wrong, including cases where MPEs are laid out like SPEs,
and cases where we use the SPE or MPE layout strategies for enums
that have no non-empty payloads.  (These cases are superficially
similar but differ in how they handle XIs.)

These new tests allowed me to correct a number logical flaws
about how layouts are selected.  In particular, cases with
generic payloads are always considered to be non-empty for
purposes of selecting a layout strategy.  Only cases that
are statically known to be empty are considered empty for
layout purposes.
2023-04-02 21:09:24 -07:00
Tim Kientzle
a959161707 Fill in the missing 32-bit checks for this test 2023-01-26 14:29:03 -08:00
Tim Kientzle
693c276313 Disable this test on watchOS
I've not been able to fill in the 32-bit expectations here yet.
Until I can do that, this won't work on any 32-bit platforms.
2023-01-19 12:58:01 -08:00
Tim Kientzle
f087b5e0fb This PR aligns RemoteMirror more closely with the compiler's handling of enums
that contain zero-sized payloads, which should resolve a number of issues with
RemoteMirror incorrectly reflecting enum cases and/or measuring the layout of
structures containing enums.

Background: Enum cases that have zero-sized payloads are handled
differently from other payload-bearing cases.

1. For layout purposes, they're treated as
   non-payload cases.  This can cause an MPE to
   actually get represented in memory as a single-payload
   or non-payload enum.

2. However, zero-sized payloads are still considered for
   extra inhabitant calculations.  Since they have no
   extra inhabitants, this tends to cause such enums to
   also not expose extra inhabitants to containing enums.

This commit makes several change to how RemoteMirror determines
enum layout:

* The various "*EnumTypeInfo" classes now represent
  layout mechanisms -- as described in (1) above,
  this can differ from the source code concept.

* An Enum "kind" is separately computed to reflect the
  source code concept; this ensures that the dumped
  type information reflects the source code.

* For single-payload and no-payload _layouts_,
  the extra inhabitant calculation has been adjusted
  to ensure that zero-sized payloads are correctly
  considered.

Resolves: rdar://92945673
2023-01-06 11:16:07 -08:00