Commit Graph

5 Commits

Author SHA1 Message Date
Tim Kientzle
f73cfa7396 Reflection tests are incompatible with ASAN 2024-07-26 09:55:08 -07:00
Tim Kientzle
5d4c29cd09 Fix a bunch of reflection tests to be correct for Ubuntu
These tests had Darwin-specific code in them, mostly unnecessary,
that caused them to break on non-Darwin platforms.

Only one (reflect_Enum_SingleCaseCFPayload.swift) was actually
specific to Darwin.  That one has been disabled.  For the rest,
just delete the unnecessary `import Darwin` and similar.
2023-10-24 06:58:41 -07:00
Hiroshi Yamauchi
ed58501ecd Account for the generic zero-sized payload enum cases.
Disable the assert:

    // At least one payload is non-empty (otherwise this                                                                                                                  // would get laid out as a non-payload enum)                                                                                                                          assert(getNumNonEmptyPayloadCases() > 0);

in TaggedMultiPayloadEnumTypeInfo because it fails when you have
generic but zero-sized payload enum cases.

Also remove unnecessary "REQUIRES: objc_interop" lines from the enum
reflection tests.
2023-09-21 09:31:24 -07:00
Tim Kientzle
2f27e06591 Generalize tests that already work for 32 bits 2023-04-06 13:27:06 -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