diff --git a/include/swift/Reflection/ReflectionContext.h b/include/swift/Reflection/ReflectionContext.h index 512e91739b6b6..cfbda087504a7 100644 --- a/include/swift/Reflection/ReflectionContext.h +++ b/include/swift/Reflection/ReflectionContext.h @@ -23,6 +23,7 @@ #include "llvm/BinaryFormat/ELF.h" #include "llvm/Object/COFF.h" +#include "swift/ABI/Enum.h" #include "swift/Remote/MemoryReader.h" #include "swift/Remote/MetadataReader.h" #include "swift/Reflection/Records.h" @@ -710,6 +711,128 @@ class ReflectionContext } } + bool projectEnumValue(RemoteAddress EnumAddress, + const TypeRef *EnumTR, + int *CaseIndex) { + if (EnumTR == nullptr) + return false; + auto EnumTI = getTypeInfo(EnumTR); + if (EnumTI == nullptr) + return false; + + auto EnumRecordTI = dyn_cast(EnumTI); + if (EnumRecordTI == nullptr) + return false; + auto EnumSize = EnumRecordTI->getSize(); + + auto Fields = EnumRecordTI->getFields(); + auto FieldCount = Fields.size(); + if (FieldCount == 0) { + return false; // No fields? + } + if (FieldCount == 1) { + *CaseIndex = 0; // Only possible field + return true; + } + + switch (EnumRecordTI->getRecordKind()) { + + case RecordKind::NoPayloadEnum: { + if (EnumSize == 0) { + *CaseIndex = 0; + return true; + } + return getReader().readInteger(EnumAddress, EnumSize, CaseIndex); + } + + case RecordKind::SinglePayloadEnum: { + FieldInfo PayloadCase = Fields[0]; + if (!PayloadCase.TR) + return false; + unsigned long NonPayloadCaseCount = FieldCount - 1; + unsigned long PayloadExtraInhabitants = PayloadCase.TI.getNumExtraInhabitants(); + unsigned discriminator = 0; + auto PayloadSize = PayloadCase.TI.getSize(); + if (NonPayloadCaseCount >= PayloadExtraInhabitants) { + // There are more cases than inhabitants, we need a separate discriminator. + auto TagInfo = getEnumTagCounts(PayloadSize, NonPayloadCaseCount, 1); + auto TagSize = TagInfo.numTagBytes; + auto TagAddress = RemoteAddress(EnumAddress.getAddressData() + PayloadSize); + if (!getReader().readInteger(TagAddress, TagSize, &discriminator)) + return false; + } + + if (PayloadExtraInhabitants == 0) { + // Payload has no XI, so discriminator fully determines the case + *CaseIndex = discriminator; + return true; + } else if (discriminator == 0) { + // The value overlays the payload ... ask the payload to decode it. + int t; + if (!PayloadCase.TI.readExtraInhabitantIndex(getReader(), EnumAddress, &t)) { + return false; + } + if (t < 0) { + *CaseIndex = 0; + return true; + } else if ((unsigned long)t <= NonPayloadCaseCount) { + *CaseIndex = t + 1; + return true; + } + return false; + } else { + // The entire payload area is available for additional cases: + auto TagSize = std::max(PayloadSize, 4U); // XXX TODO XXX CHECK THIS + auto offset = 1 + PayloadExtraInhabitants; // Cases coded with discriminator = 0 + unsigned casesInPayload = 1 << (TagSize * 8U); + unsigned payloadCode; + if (!getReader().readInteger(EnumAddress, TagSize, &payloadCode)) + return false; + *CaseIndex = offset + (discriminator - 1) * casesInPayload + payloadCode; + return true; + } + } + + case RecordKind::MultiPayloadEnum: { + // TODO: Support multipayload enums + break; + } + + default: + // Unknown record kind. + break; + } + return false; + } + + bool getEnumCaseTypeRef(const TypeRef *EnumTR, + unsigned CaseIndex, + std::string &Name, + const TypeRef **OutPayloadTR) { + *OutPayloadTR = nullptr; + + if (EnumTR == nullptr) + return false; + + auto EnumTI = getTypeInfo(EnumTR); + if (EnumTI == nullptr) + return false; + + auto EnumRecordTI = dyn_cast(EnumTI); + if (EnumRecordTI == nullptr) + return false; + + auto NumCases = EnumRecordTI->getNumFields(); + if (CaseIndex >= NumCases) { + return false; + } else { + const auto Case = EnumRecordTI->getFields()[CaseIndex]; + Name = Case.Name; + *OutPayloadTR = Case.TR; + return true; + } + } + /// Return a description of the layout of a value with the given type. const TypeInfo *getTypeInfo(const TypeRef *TR) { return getBuilder().getTypeConverter().getTypeInfo(TR); diff --git a/include/swift/Reflection/TypeLowering.h b/include/swift/Reflection/TypeLowering.h index c66c86b44efcd..a543e219e5007 100644 --- a/include/swift/Reflection/TypeLowering.h +++ b/include/swift/Reflection/TypeLowering.h @@ -106,6 +106,7 @@ enum class TypeInfoKind : unsigned { Builtin, Record, Reference, + Invalid, }; class TypeInfo { @@ -124,6 +125,10 @@ class TypeInfo { assert(Alignment > 0); } + TypeInfo(): Kind(TypeInfoKind::Invalid), Size(0), Alignment(0), Stride(0), + NumExtraInhabitants(0), BitwiseTakable(true) { + } + TypeInfoKind getKind() const { return Kind; } unsigned getSize() const { return Size; } @@ -134,11 +139,24 @@ class TypeInfo { void dump() const; void dump(FILE *file, unsigned Indent = 0) const; + + // Using the provided reader, inspect our value. + // Return false if we can't inspect value. + // Set *inhabitant to <0 if the value is valid (not an XI) + // Else set *inhabitant to the XI value (counting from 0) + virtual bool readExtraInhabitantIndex(remote::MemoryReader &reader, + remote::RemoteAddress address, + int *index) const { + return false; + } + + virtual ~TypeInfo() { } }; struct FieldInfo { std::string Name; unsigned Offset; + int Value; const TypeRef *TR; const TypeInfo &TI; }; @@ -155,6 +173,10 @@ class BuiltinTypeInfo : public TypeInfo { return Name; } + bool readExtraInhabitantIndex(remote::MemoryReader &reader, + remote::RemoteAddress address, + int *extraInhabitantIndex) const; + static bool classof(const TypeInfo *TI) { return TI->getKind() == TypeInfoKind::Builtin; } @@ -178,6 +200,10 @@ class RecordTypeInfo : public TypeInfo { unsigned getNumFields() const { return Fields.size(); } const std::vector &getFields() const { return Fields; } + bool readExtraInhabitantIndex(remote::MemoryReader &reader, + remote::RemoteAddress address, + int *index) const; + static bool classof(const TypeInfo *TI) { return TI->getKind() == TypeInfoKind::Record; } @@ -206,6 +232,16 @@ class ReferenceTypeInfo : public TypeInfo { return Refcounting; } + bool readExtraInhabitantIndex(remote::MemoryReader &reader, + remote::RemoteAddress address, + int *extraInhabitantIndex) const { + if (getNumExtraInhabitants() == 0) { + *extraInhabitantIndex = -1; + return true; + } + return reader.readHeapObjectExtraInhabitantIndex(address, extraInhabitantIndex); + } + static bool classof(const TypeInfo *TI) { return TI->getKind() == TypeInfoKind::Reference; } diff --git a/include/swift/Reflection/TypeRefBuilder.h b/include/swift/Reflection/TypeRefBuilder.h index 4c40d503b2090..9984e8f6629b4 100644 --- a/include/swift/Reflection/TypeRefBuilder.h +++ b/include/swift/Reflection/TypeRefBuilder.h @@ -215,23 +215,24 @@ struct ClosureContextInfo { struct FieldTypeInfo { std::string Name; + int Value; const TypeRef *TR; bool Indirect; - FieldTypeInfo() : Name(""), TR(nullptr), Indirect(false) {} - FieldTypeInfo(const std::string &Name, const TypeRef *TR, bool Indirect) - : Name(Name), TR(TR), Indirect(Indirect) {} + FieldTypeInfo() : Name(""), Value(0), TR(nullptr), Indirect(false) {} + FieldTypeInfo(const std::string &Name, int Value, const TypeRef *TR, bool Indirect) + : Name(Name), Value(Value), TR(TR), Indirect(Indirect) {} - static FieldTypeInfo forEmptyCase(std::string Name) { - return FieldTypeInfo(Name, nullptr, false); + static FieldTypeInfo forEmptyCase(std::string Name, int Value) { + return FieldTypeInfo(Name, Value, nullptr, false); } - static FieldTypeInfo forIndirectCase(std::string Name, const TypeRef *TR) { - return FieldTypeInfo(Name, TR, true); + static FieldTypeInfo forIndirectCase(std::string Name, int Value, const TypeRef *TR) { + return FieldTypeInfo(Name, Value, TR, true); } - static FieldTypeInfo forField(std::string Name, const TypeRef *TR) { - return FieldTypeInfo(Name, TR, false); + static FieldTypeInfo forField(std::string Name, int Value, const TypeRef *TR) { + return FieldTypeInfo(Name, Value, TR, false); } }; diff --git a/include/swift/Remote/InProcessMemoryReader.h b/include/swift/Remote/InProcessMemoryReader.h index 1163f67ef4212..c2c4f0ee345ee 100644 --- a/include/swift/Remote/InProcessMemoryReader.h +++ b/include/swift/Remote/InProcessMemoryReader.h @@ -21,6 +21,10 @@ #include +#if defined(__APPLE__) && defined(__MACH__) +#include +#endif + namespace swift { namespace remote { @@ -29,19 +33,53 @@ namespace remote { class InProcessMemoryReader final : public MemoryReader { bool queryDataLayout(DataLayoutQueryType type, void *inBuffer, void *outBuffer) override { +#if defined(__APPLE__) && __APPLE__ + auto applePlatform = true; +#else + auto applePlatform = false; +#endif +#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV)) + auto iosDerivedPlatform = true; +#else + auto iosDerivedPlatform = false; +#endif + switch (type) { - case DLQ_GetPointerSize: { - auto result = static_cast(outBuffer); - *result = sizeof(void *); - return true; + case DLQ_GetPointerSize: { + auto result = static_cast(outBuffer); + *result = sizeof(void *); + return true; + } + case DLQ_GetSizeSize: { + auto result = static_cast(outBuffer); + *result = sizeof(size_t); + return true; + } + case DLQ_GetObjCReservedLowBits: { + auto result = static_cast(outBuffer); + if (applePlatform && !iosDerivedPlatform && (sizeof(void *) == 8)) { + // Obj-C reserves low bit on 64-bit macOS only. + // Other Apple platforms don't reserve this bit (even when + // running on x86_64-based simulators). + *result = 1; + } else { + *result = 0; } - case DLQ_GetSizeSize: { - auto result = static_cast(outBuffer); - *result = sizeof(size_t); - return true; + return true; + } + case DLQ_GetLeastValidPointerValue: { + auto result = static_cast(outBuffer); + if (applePlatform && (sizeof(void *) == 8)) { + // Swift reserves the first 4GiB on Apple 64-bit platforms + *result = 0x100000000; + return 1; + } else { + // Swift reserves the first 4KiB everywhere else + *result = 0x1000; } + return true; + } } - return false; } diff --git a/include/swift/Remote/MemoryReader.h b/include/swift/Remote/MemoryReader.h index 3424e30bda4af..e2ce2a63bdd27 100644 --- a/include/swift/Remote/MemoryReader.h +++ b/include/swift/Remote/MemoryReader.h @@ -61,6 +61,50 @@ class MemoryReader { sizeof(IntegerType)); } + /// Attempts to read an integer of the specified size from the given + /// address in the remote process. + /// + /// Returns false if the operation failed, the request size is not + /// 1, 2, 4, or 8, or the request size is larger than the provided destination. + template + bool readInteger(RemoteAddress address, size_t bytes, IntegerType *dest) { + if (bytes > sizeof(IntegerType)) + return false; + switch (bytes) { + case 1: { + uint8_t n; + if (!readInteger(address, &n)) + return false; + *dest = n; + break; + } + case 2: { + uint16_t n; + if (!readInteger(address, &n)) + return false; + *dest = n; + break; + } + case 4: { + uint32_t n; + if (!readInteger(address, &n)) + return false; + *dest = n; + break; + } + case 8: { + uint64_t n; + if (!readInteger(address, &n)) + return false; + *dest = n; + break; + } + default: + return false; + } + return true; + } + /// Attempts to read 'size' bytes from the given address in the remote process. /// /// Returns a pointer to the requested data and a function that must be called to @@ -125,6 +169,65 @@ class MemoryReader { return resolvePointer(address, pointerData); } + + // Parse extra inhabitants stored in a pointer. + // Sets *extraInhabitant to -1 if the pointer at this address + // is actually a valid pointer. + // Otherwise, it sets *extraInhabitant to the inhabitant + // index (counting from 0). + bool readHeapObjectExtraInhabitantIndex(RemoteAddress address, + int *extraInhabitantIndex) { + uint8_t PointerSize; + if (!queryDataLayout(DataLayoutQueryType::DLQ_GetPointerSize, + nullptr, &PointerSize)) { + return false; + } + uint64_t LeastValidPointerValue; + if (!queryDataLayout(DataLayoutQueryType::DLQ_GetLeastValidPointerValue, + nullptr, &LeastValidPointerValue)) { + return false; + } + uint8_t ObjCReservedLowBits; + if (!queryDataLayout(DataLayoutQueryType::DLQ_GetObjCReservedLowBits, + nullptr, &ObjCReservedLowBits)) { + return false; + } + uint64_t RawPointerValue; + if (!readInteger(address, PointerSize, &RawPointerValue)) { + return false; + } + if (RawPointerValue >= LeastValidPointerValue) { + *extraInhabitantIndex = -1; // Valid value, not an XI + } else { + *extraInhabitantIndex = (RawPointerValue >> ObjCReservedLowBits); + } + return true; + } + + bool readFunctionPointerExtraInhabitantIndex(RemoteAddress address, + int *extraInhabitantIndex) { + uint8_t PointerSize; + if (!queryDataLayout(DataLayoutQueryType::DLQ_GetPointerSize, + nullptr, &PointerSize)) { + return false; + } + uint64_t LeastValidPointerValue; + if (!queryDataLayout(DataLayoutQueryType::DLQ_GetLeastValidPointerValue, + nullptr, &LeastValidPointerValue)) { + return false; + } + uint64_t RawPointerValue; + if (!readInteger(address, PointerSize, &RawPointerValue)) { + return false; + } + if (RawPointerValue >= LeastValidPointerValue) { + *extraInhabitantIndex = -1; // Valid value, not an XI + } else { + *extraInhabitantIndex = RawPointerValue; + } + return true; + } + virtual ~MemoryReader() = default; }; diff --git a/include/swift/SwiftRemoteMirror/MemoryReaderInterface.h b/include/swift/SwiftRemoteMirror/MemoryReaderInterface.h index 93cd4293eaff6..5dd6da9b289b2 100644 --- a/include/swift/SwiftRemoteMirror/MemoryReaderInterface.h +++ b/include/swift/SwiftRemoteMirror/MemoryReaderInterface.h @@ -85,6 +85,19 @@ typedef enum { /// should be populated with the size of size_t in the remote process, in /// bytes. DLQ_GetSizeSize, + + /// The query should ignore inBuffer, and treat outBuffer as uint8_t* which + /// should be populated with the number of low-order bits in each pointer + /// reserved by Obj-C in the remote process. This is generally zero except + /// for 64-bit macOS, which has to reserve the bottom bit for Obj-C + /// interoperability. + DLQ_GetObjCReservedLowBits, + + /// The query should ignore inBuffer, and treat outBuffer as uint64_t* which + /// should be populated with the lowest valid pointer value in the remote + /// process. This is currently 0x1000 (4096) except on 64-bit Apple platforms + /// where it is 0x100000000. + DLQ_GetLeastValidPointerValue, } DataLayoutQueryType; /// Data layout query function, which returns answers based on query types (from diff --git a/include/swift/SwiftRemoteMirror/SwiftRemoteMirror.h b/include/swift/SwiftRemoteMirror/SwiftRemoteMirror.h index e424bcef33423..86ee1cc2a740b 100644 --- a/include/swift/SwiftRemoteMirror/SwiftRemoteMirror.h +++ b/include/swift/SwiftRemoteMirror/SwiftRemoteMirror.h @@ -227,6 +227,35 @@ int swift_reflection_projectExistential(SwiftReflectionContextRef ContextRef, swift_typeref_t *OutInstanceTypeRef, swift_addr_t *OutStartOfInstanceData); +/// Projects the value of an enum. +/// +/// Takes the address and typeref for an enum and determines the +/// index of the currently-selected case within the enum. +/// +/// Returns true if the enum case could be successfully determined. +/// In particular, note that this code may fail for valid in-memory data +/// if the compiler is using a strategy we do not yet understand. +SWIFT_REMOTE_MIRROR_LINKAGE +int swift_reflection_projectEnumValue(SwiftReflectionContextRef ContextRef, + swift_addr_t EnumAddress, + swift_typeref_t EnumTypeRef, + int *CaseIndex); + +/// Finds information about a particular enum case. +/// +/// Given an enum typeref and index of a case, returns: +/// * Typeref of the associated payload or zero if there is no payload +/// * Name of the case if known. +/// +/// The Name points to a freshly-allocated C string on the heap. You +/// are responsible for freeing the string when you are finished. +SWIFT_REMOTE_MIRROR_LINKAGE +int swift_reflection_getEnumCaseTypeRef(SwiftReflectionContextRef ContextRef, + swift_typeref_t EnumTypeRef, + int CaseIndex, + char **CaseName, + swift_typeref_t *PayloadTypeRef); + /// Dump a brief description of the typeref as a tree to stderr. SWIFT_REMOTE_MIRROR_LINKAGE void swift_reflection_dumpTypeRef(swift_typeref_t OpaqueTypeRef); diff --git a/include/swift/SwiftRemoteMirror/SwiftRemoteMirrorLegacyInterop.h b/include/swift/SwiftRemoteMirror/SwiftRemoteMirrorLegacyInterop.h index 8c747404223c2..95524d170ceec 100644 --- a/include/swift/SwiftRemoteMirror/SwiftRemoteMirrorLegacyInterop.h +++ b/include/swift/SwiftRemoteMirror/SwiftRemoteMirrorLegacyInterop.h @@ -30,6 +30,7 @@ #include #include +#include /// The "public" interface follows. All of these functions are the same /// as the corresponding swift_reflection_* functions, except for taking @@ -535,12 +536,28 @@ swift_reflection_interop_minimalDataLayoutQueryFunction4( void *ReaderContext, DataLayoutQueryType type, void *inBuffer, void *outBuffer) { - if (type == DLQ_GetPointerSize || type == DLQ_GetSizeSize) { + switch (type) { + case DLQ_GetPointerSize: + case DLQ_GetSizeSize: { uint8_t *result = (uint8_t *)outBuffer; *result = 4; return 1; } - return 0; + case DLQ_GetObjCReservedLowBits: { + uint8_t *result = (uint8_t *)outBuffer; + // Swift assumes this for all 32-bit platforms, including Darwin + *result = 0; + return 1; + } + case DLQ_GetLeastValidPointerValue: { + uint64_t *result = (uint64_t *)outBuffer; + // Swift assumes this for all 32-bit platforms, including Darwin + *result = 0x1000; + return 1; + } + default: + return 0; + } } static inline int @@ -548,12 +565,49 @@ swift_reflection_interop_minimalDataLayoutQueryFunction8( void *ReaderContext, DataLayoutQueryType type, void *inBuffer, void *outBuffer) { - if (type == DLQ_GetPointerSize || type == DLQ_GetSizeSize) { + // Caveat: This assumes the process being examined is + // running in the same kind of environment as this host code. +#if defined(__APPLE__) && __APPLE__ + auto applePlatform = true; +#else + auto applePlatform = false; +#endif +#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV)) + auto iosDerivedPlatform = true; +#else + auto iosDerivedPlatform = false; +#endif + + switch (type) { + case DLQ_GetPointerSize: + case DLQ_GetSizeSize: { uint8_t *result = (uint8_t *)outBuffer; *result = 8; return 1; } - return 0; + case DLQ_GetObjCReservedLowBits: { + uint8_t *result = (uint8_t *)outBuffer; + if (applePlatform && !iosDerivedPlatform) { + *result = 1; + } else { + *result = 0; + } + return 1; + } + case DLQ_GetLeastValidPointerValue: { + uint64_t *result = (uint64_t *)outBuffer; + if (applePlatform) { + // On 64-bit Apple platforms, Swift reserves the first 4GiB + *result = 0x100000000; + } else { + // Swift reserves the first 4KiB everywhere else. + *result = 0x1000; + } + return 1; + } + default: + return 0; + } } static inline SwiftReflectionInteropContextRef diff --git a/stdlib/private/SwiftReflectionTest/SwiftReflectionTest.swift b/stdlib/private/SwiftReflectionTest/SwiftReflectionTest.swift index 1baf74ea406e8..8f40856569cd1 100644 --- a/stdlib/private/SwiftReflectionTest/SwiftReflectionTest.swift +++ b/stdlib/private/SwiftReflectionTest/SwiftReflectionTest.swift @@ -44,6 +44,8 @@ public enum InstanceKind : UInt8 { case Existential case ErrorExistential case Closure + case Enum + case EnumValue } /// Represents a section in a loaded image in this process. @@ -390,12 +392,12 @@ public func reflect(object: AnyObject) { /// The test doesn't care about the witness tables - we only care /// about what's in the buffer, so we always put these values into /// an Any existential. -public func reflect(any: T) { +public func reflect(any: T, kind: InstanceKind = .Existential) { let any: Any = any let anyPointer = UnsafeMutablePointer.allocate(capacity: MemoryLayout.size) anyPointer.initialize(to: any) let anyPointerValue = UInt(bitPattern: anyPointer) - reflect(instanceAddress: anyPointerValue, kind: .Existential) + reflect(instanceAddress: anyPointerValue, kind: kind) anyPointer.deallocate() } @@ -427,6 +429,18 @@ public func reflect(error: T) { reflect(instanceAddress: errorPointerValue, kind: .ErrorExistential) } +// Reflect an `Enum` +// +// These are handled like existentials, but +// the test driver verifies a different set of data. +public func reflect(enum value: T) { + reflect(any: value, kind: .Enum) +} + +public func reflect(enumValue value: T) { + reflect(any: value, kind: .EnumValue) +} + /// Wraps a thick function with arity 0. struct ThickFunction0 { var function: () -> Void diff --git a/stdlib/public/Reflection/TypeLowering.cpp b/stdlib/public/Reflection/TypeLowering.cpp index b373b57f699dc..df2e87866df27 100644 --- a/stdlib/public/Reflection/TypeLowering.cpp +++ b/stdlib/public/Reflection/TypeLowering.cpp @@ -92,12 +92,36 @@ class PrintTypeInfo { Indent -= 2; } + void printCases(const RecordTypeInfo &TI) { + Indent += 2; + int Index = -1; + for (auto Field : TI.getFields()) { + Index += 1; + fprintf(file, "\n"); + printHeader("case"); + if (!Field.Name.empty()) + printField("name", Field.Name); + printField("index", std::to_string(Index)); + if (Field.TR) { + printField("offset", std::to_string(Field.Offset)); + printRec(Field.TI); + } + fprintf(file, ")"); + } + Indent -= 2; + } + public: PrintTypeInfo(FILE *file, unsigned Indent) : file(file), Indent(Indent) {} void print(const TypeInfo &TI) { switch (TI.getKind()) { + case TypeInfoKind::Invalid: + printHeader("invalid"); + fprintf(file, ")"); + return; + case TypeInfoKind::Builtin: printHeader("builtin"); printBasic(TI); @@ -115,13 +139,22 @@ class PrintTypeInfo { break; case RecordKind::NoPayloadEnum: printHeader("no_payload_enum"); - break; + printBasic(TI); + printCases(RecordTI); + fprintf(file, ")"); + return; case RecordKind::SinglePayloadEnum: printHeader("single_payload_enum"); - break; + printBasic(TI); + printCases(RecordTI); + fprintf(file, ")"); + return; case RecordKind::MultiPayloadEnum: printHeader("multi_payload_enum"); - break; + printBasic(TI); + printCases(RecordTI); + fprintf(file, ")"); + return; case RecordKind::Tuple: printHeader("tuple"); break; @@ -200,6 +233,130 @@ BuiltinTypeInfo::BuiltinTypeInfo(TypeRefBuilder &builder, builder.readTypeRef(descriptor, descriptor->TypeName))) {} +bool +BuiltinTypeInfo::readExtraInhabitantIndex(remote::MemoryReader &reader, + remote::RemoteAddress address, + int *extraInhabitantIndex) const { + if (getNumExtraInhabitants() == 0) { + *extraInhabitantIndex = -1; + return true; + } + // If it has extra inhabitants, it must be a pointer. (The only non-pointer + // data with extra inhabitants is a non-payload enum, which doesn't get here.) + if (Name == "yyXf") { + // But there are two different conventions, one for function pointers: + return reader.readFunctionPointerExtraInhabitantIndex(address, extraInhabitantIndex); + } else { + // And one for pointers to heap-allocated blocks of memory + return reader.readHeapObjectExtraInhabitantIndex(address, extraInhabitantIndex); + } + } + + +bool RecordTypeInfo::readExtraInhabitantIndex(remote::MemoryReader &reader, + remote::RemoteAddress address, + int *extraInhabitantIndex) const { + switch (SubKind) { + case RecordKind::Invalid: + case RecordKind::ThickFunction: + case RecordKind::OpaqueExistential: + case RecordKind::ClosureContext: + return false; + + case RecordKind::ClassExistential: + case RecordKind::ExistentialMetatype: + case RecordKind::ErrorExistential: + case RecordKind::ClassInstance: { + return false; // XXX TODO XXX + } + + case RecordKind::Tuple: + case RecordKind::Struct: { + if (Fields.size() == 0) { + return false; + } + // Tuples and Structs inherit XIs from their most capacious member + auto mostCapaciousField = std::max_element( + Fields.begin(), Fields.end(), + [](const FieldInfo &lhs, const FieldInfo &rhs) { + return lhs.TI.getNumExtraInhabitants() < rhs.TI.getNumExtraInhabitants(); + }); + if (mostCapaciousField->TI.getNumExtraInhabitants() == 0) { + return false; // No child XIs? Something is broken. + } + auto fieldAddress = remote::RemoteAddress(address.getAddressData() + + mostCapaciousField->Offset); + return mostCapaciousField->TI.readExtraInhabitantIndex( + reader, fieldAddress, extraInhabitantIndex); + } + + case RecordKind::NoPayloadEnum: { + // No payload enums export XIs + auto EnumSize = getSize(); + if (EnumSize == 0) { + *extraInhabitantIndex = -1; + return true; + } + uint64_t value; + if (!reader.readInteger(address, EnumSize, &value)) { + return false; + } + if (value < getFields().size()) { + *extraInhabitantIndex = -1; + } else { + *extraInhabitantIndex = value - getFields().size(); + } + return true; + } + + case RecordKind::SinglePayloadEnum: { + // Single payload enums inherit XIs from their payload type + auto Fields = getFields(); + FieldInfo PayloadCase = Fields[0]; + if (!PayloadCase.TR) + return false; + unsigned long NonPayloadCaseCount = Fields.size() - 1; + unsigned long PayloadExtraInhabitants = PayloadCase.TI.getNumExtraInhabitants(); + unsigned discriminator = 0; + auto PayloadSize = PayloadCase.TI.getSize(); + if (NonPayloadCaseCount >= PayloadExtraInhabitants) { + // More cases than inhabitants, we need a separate discriminator + auto TagInfo = getEnumTagCounts(PayloadSize, NonPayloadCaseCount, 1); + auto TagSize = TagInfo.numTagBytes; + auto TagAddress = remote::RemoteAddress(address.getAddressData() + PayloadSize); + if (!reader.readInteger(TagAddress, TagSize, &discriminator)) + return false; + } + + if (PayloadExtraInhabitants == 0) { + *extraInhabitantIndex = -1; + return true; + } else if (discriminator == 0) { + if (PayloadCase.TI.readExtraInhabitantIndex(reader, address, extraInhabitantIndex)) { + if (*extraInhabitantIndex < 0) { + // Do nothing. + } else if ((unsigned long)*extraInhabitantIndex < NonPayloadCaseCount) { + *extraInhabitantIndex = -1; + } else { + *extraInhabitantIndex -= NonPayloadCaseCount; + } + return true; + } + } else { + *extraInhabitantIndex = -1; // XXX CHECK THIS XXX + return true; + } + + return false; + } + + case RecordKind::MultiPayloadEnum:// XXX TODO + return false; + + } + return false; +} + /// Utility class for building values that contain witness tables. class ExistentialTypeInfoBuilder { TypeConverter &TC; @@ -537,7 +694,7 @@ void RecordTypeInfoBuilder::addField(const std::string &Name, TI->getAlignment(), TI->getNumExtraInhabitants(), TI->isBitwiseTakable()); - Fields.push_back({Name, offset, TR, *TI}); + Fields.push_back({Name, offset, -1, TR, *TI}); } const RecordTypeInfo *RecordTypeInfoBuilder::build() { @@ -612,7 +769,7 @@ TypeConverter::getReferenceTypeInfo(ReferenceKind Kind, return TI; } -/// Thick functions consist of a function pointer. We do not use +/// Thin functions consist of a function pointer. We do not use /// Builtin.RawPointer here, since the extra inhabitants differ. const TypeInfo * TypeConverter::getThinFunctionTypeInfo() { @@ -963,6 +1120,10 @@ class EnumTypeInfoBuilder { return Case.TR; } + void addCase(const std::string &Name) { + Cases.push_back({Name, /*offset=*/0, /*value=*/-1, nullptr, TypeInfo()}); + } + void addCase(const std::string &Name, const TypeRef *TR, const TypeInfo *TI) { if (TI == nullptr) { @@ -975,7 +1136,7 @@ class EnumTypeInfoBuilder { Alignment = std::max(Alignment, TI->getAlignment()); BitwiseTakable &= TI->isBitwiseTakable(); - Cases.push_back({Name, /*offset=*/0, TR, *TI}); + Cases.push_back({Name, /*offset=*/0, /*value=*/-1, TR, *TI}); } public: @@ -998,14 +1159,17 @@ class EnumTypeInfoBuilder { for (auto Case : Fields) { if (Case.TR == nullptr) { NoPayloadCases++; - continue; + addCase(Case.Name); + } else { + PayloadCases.push_back(Case); + auto *CaseTR = getCaseTypeRef(Case); + auto *CaseTI = TC.getTypeInfo(CaseTR); + addCase(Case.Name, CaseTR, CaseTI); } - - PayloadCases.push_back(Case); } - // NoPayloadEnumImplStrategy if (PayloadCases.empty()) { + // NoPayloadEnumImplStrategy Kind = RecordKind::NoPayloadEnum; switch (NoPayloadCases) { case 0: @@ -1017,14 +1181,15 @@ class EnumTypeInfoBuilder { NoPayloadCases, /*payloadCases=*/0); Size += tagCounts.numTagBytes; + Alignment = tagCounts.numTagBytes; NumExtraInhabitants = (1 << (tagCounts.numTagBytes * 8)) - tagCounts.numTags; NumExtraInhabitants = std::min(NumExtraInhabitants, unsigned(ValueWitnessFlags::MaxNumExtraInhabitants)); } } - // SinglePayloadEnumImplStrategy } else if (PayloadCases.size() == 1) { + // SinglePayloadEnumImplStrategy auto *CaseTR = getCaseTypeRef(PayloadCases[0]); auto *CaseTI = TC.getTypeInfo(CaseTR); @@ -1034,37 +1199,33 @@ class EnumTypeInfoBuilder { return CaseTI; Kind = RecordKind::SinglePayloadEnum; - addCase(PayloadCases[0].Name, CaseTR, CaseTI); // If we were unable to lower the payload type, do not proceed // further. if (CaseTI != nullptr) { // Below logic should match the runtime function // swift_initEnumMetadataSinglePayload(). - NumExtraInhabitants = CaseTI->getNumExtraInhabitants(); - if (NumExtraInhabitants >= NoPayloadCases) { + auto PayloadExtraInhabitants = CaseTI->getNumExtraInhabitants(); + if (PayloadExtraInhabitants >= NoPayloadCases) { // Extra inhabitants can encode all no-payload cases. - NumExtraInhabitants -= NoPayloadCases; + NumExtraInhabitants = PayloadExtraInhabitants - NoPayloadCases; } else { // Not enough extra inhabitants for all cases. We have to add an // extra tag field. NumExtraInhabitants = 0; - Size += getEnumTagCounts(Size, - NoPayloadCases - NumExtraInhabitants, - /*payloadCases=*/1).numTagBytes; + auto tagCounts = getEnumTagCounts(Size, + NoPayloadCases - NumExtraInhabitants, + /*payloadCases=*/1); + Size += tagCounts.numTagBytes; + Alignment = std::max(Alignment, tagCounts.numTagBytes); } } - // MultiPayloadEnumImplStrategy } else { + // MultiPayloadEnumImplStrategy Kind = RecordKind::MultiPayloadEnum; // Check if this is a dynamic or static multi-payload enum - for (auto Case : PayloadCases) { - auto *CaseTR = getCaseTypeRef(Case); - auto *CaseTI = TC.getTypeInfo(CaseTR); - addCase(Case.Name, CaseTR, CaseTI); - } // If we have a fixed descriptor for this type, it is a fixed-size // multi-payload enum that possibly uses payload spare bits. @@ -1103,9 +1264,8 @@ class EnumTypeInfoBuilder { Stride = 1; return TC.makeTypeInfo( - Size, Alignment, Stride, - NumExtraInhabitants, BitwiseTakable, - Kind, Cases); + Size, Alignment, Stride, NumExtraInhabitants, + BitwiseTakable, Kind, Cases); } }; @@ -1323,7 +1483,7 @@ class LowerType if (Field.Name == "object") { auto *FieldTI = rebuildStorageTypeInfo(&Field.TI, Kind); BitwiseTakable &= FieldTI->isBitwiseTakable(); - Fields.push_back({Field.Name, Field.Offset, Field.TR, *FieldTI}); + Fields.push_back({Field.Name, Field.Offset, /*value=*/-1, Field.TR, *FieldTI}); continue; } Fields.push_back(Field); diff --git a/stdlib/public/Reflection/TypeRefBuilder.cpp b/stdlib/public/Reflection/TypeRefBuilder.cpp index b2e2a7d27afbd..4be3d8c4c8d93 100644 --- a/stdlib/public/Reflection/TypeRefBuilder.cpp +++ b/stdlib/public/Reflection/TypeRefBuilder.cpp @@ -211,14 +211,16 @@ bool TypeRefBuilder::getFieldTypeRefs( if (!Subs) return false; + int FieldValue = -1; for (auto &FieldRef : *FD.getLocalBuffer()) { auto Field = FD.getField(FieldRef); auto FieldName = getTypeRefString(readTypeRef(Field, Field->FieldName)); + FieldValue += 1; // Empty cases of enums do not have a type if (FD->isEnum() && !Field->hasMangledTypeName()) { - Fields.push_back(FieldTypeInfo::forEmptyCase(FieldName)); + Fields.push_back(FieldTypeInfo::forEmptyCase(FieldName, FieldValue)); continue; } @@ -230,11 +232,11 @@ bool TypeRefBuilder::getFieldTypeRefs( auto Substituted = Unsubstituted->subst(*this, *Subs); if (FD->isEnum() && Field->isIndirectCase()) { - Fields.push_back(FieldTypeInfo::forIndirectCase(FieldName, Substituted)); + Fields.push_back(FieldTypeInfo::forIndirectCase(FieldName, FieldValue, Substituted)); continue; } - Fields.push_back(FieldTypeInfo::forField(FieldName, Substituted)); + Fields.push_back(FieldTypeInfo::forField(FieldName, FieldValue, Substituted)); } return true; } diff --git a/stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp b/stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp index 1fedf85fbf016..649a6f09816ff 100644 --- a/stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp +++ b/stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp @@ -25,6 +25,10 @@ unsigned long long swift_reflection_classIsSwiftMask = 2; #include "swift/Remote/CMemoryReader.h" #include "swift/Runtime/Unreachable.h" +#if defined(__APPLE__) && defined(__MACH__) +#include +#endif + using namespace swift; using namespace swift::reflection; using namespace swift::remote; @@ -59,14 +63,55 @@ template static int minimalDataLayoutQueryFunction(void *ReaderContext, DataLayoutQueryType type, void *inBuffer, void *outBuffer) { + // TODO: The following should be set based on the target. + // This code sets it to match the platform this code was compiled for. +#if defined(__APPLE__) && __APPLE__ + auto applePlatform = true; +#else + auto applePlatform = false; +#endif +#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV)) + auto iosDerivedPlatform = true; +#else + auto iosDerivedPlatform = false; +#endif + if (type == DLQ_GetPointerSize || type == DLQ_GetSizeSize) { auto result = static_cast(outBuffer); *result = WordSize; return 1; } + if (type == DLQ_GetObjCReservedLowBits) { + auto result = static_cast(outBuffer); + if (applePlatform && !iosDerivedPlatform && WordSize == 8) { + // Obj-C reserves low bit on 64-bit macOS only. + // Other Apple platforms don't reserve this bit (even when + // running on x86_64-based simulators). + *result = 1; + } else { + *result = 0; + } + return 1; + } + if (type == DLQ_GetLeastValidPointerValue) { + auto result = static_cast(outBuffer); + if (applePlatform && WordSize == 8) { + // Swift reserves the first 4GiB on all 64-bit Apple platforms + *result = 0x100000000; + } else { + // Swift reserves the first 4KiB everywhere else + *result = 0x1000; + } + return 1; + } return 0; } +// Caveat: This basically only works correctly if running on the same +// host as the target. Otherwise, you'll need to use +// swift_reflection_createReflectionContextWithDataLayout() below +// with an appropriate data layout query function that understands +// the target environment. SwiftReflectionContextRef swift_reflection_createReflectionContext(void *ReaderContext, uint8_t PointerSize, @@ -251,6 +296,9 @@ swift_reflection_genericArgumentCountOfTypeRef(swift_typeref_t OpaqueTypeRef) { swift_layout_kind_t getTypeInfoKind(const TypeInfo &TI) { switch (TI.getKind()) { + case TypeInfoKind::Invalid: { + return SWIFT_UNKNOWN; + } case TypeInfoKind::Builtin: { auto &BuiltinTI = cast(TI); if (BuiltinTI.getMangledTypeName() == "Bp") @@ -414,6 +462,39 @@ int swift_reflection_projectExistential(SwiftReflectionContextRef ContextRef, return Success; } +int swift_reflection_projectEnumValue(SwiftReflectionContextRef ContextRef, + swift_addr_t EnumAddress, + swift_typeref_t EnumTypeRef, + int *CaseIndex) { + auto Context = ContextRef->nativeContext; + auto EnumTR = reinterpret_cast(EnumTypeRef); + auto RemoteEnumAddress = RemoteAddress(EnumAddress); + return Context->projectEnumValue(RemoteEnumAddress, EnumTR, CaseIndex); +} + +int swift_reflection_getEnumCaseTypeRef(SwiftReflectionContextRef ContextRef, + swift_typeref_t EnumTypeRef, + int CaseIndex, + char **CaseName, + swift_typeref_t *PayloadTypeRef) { + *PayloadTypeRef = 0; + *CaseName = nullptr; + auto Context = ContextRef->nativeContext; + auto EnumTR = reinterpret_cast(EnumTypeRef); + const TypeRef *PayloadTR = nullptr; + std::string Name; + auto success = Context->getEnumCaseTypeRef(EnumTR, CaseIndex, + Name, &PayloadTR); + if (success) { + *PayloadTypeRef = reinterpret_cast(PayloadTR); + // FIXME: Is there a better way to return a string here? + // Just returning Case.Name.c_str() doesn't work as the backing data gets + // released at the end of this function. + *CaseName = strdup(Name.c_str()); + } + return success; +} + void swift_reflection_dumpTypeRef(swift_typeref_t OpaqueTypeRef) { auto TR = reinterpret_cast(OpaqueTypeRef); if (TR == nullptr) { diff --git a/stdlib/tools/swift-reflection-test/messages.h b/stdlib/tools/swift-reflection-test/messages.h index ef61b97d8e9ba..6d4c91b77fc07 100644 --- a/stdlib/tools/swift-reflection-test/messages.h +++ b/stdlib/tools/swift-reflection-test/messages.h @@ -25,5 +25,7 @@ typedef enum InstanceKind { Object, Existential, ErrorExistential, - Closure + Closure, + Enum, + EnumValue } InstanceKind; diff --git a/stdlib/tools/swift-reflection-test/swift-reflection-test.c b/stdlib/tools/swift-reflection-test/swift-reflection-test.c index dfcfe544c1078..d6a202b86e7ac 100644 --- a/stdlib/tools/swift-reflection-test/swift-reflection-test.c +++ b/stdlib/tools/swift-reflection-test/swift-reflection-test.c @@ -34,6 +34,10 @@ #include #endif +#if defined(__APPLE__) && defined(__MACH__) +#include +#endif + #if defined(__clang__) || defined(__GNUC__) #define NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER) @@ -134,6 +138,17 @@ void PipeMemoryReader_collectBytesFromPipe(const PipeMemoryReader *Reader, static int PipeMemoryReader_queryDataLayout(void *Context, DataLayoutQueryType type, void *inBuffer, void *outBuffer) { +#if defined(__APPLE__) && __APPLE__ + int applePlatform = 1; +#else + int applePlatform = 0; +#endif +#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV)) + int iosDerivedPlatform = 1; +#else + int iosDerivedPlatform = 0; +#endif + switch (type) { case DLQ_GetPointerSize: { uint8_t *result = (uint8_t *)outBuffer; @@ -145,6 +160,28 @@ static int PipeMemoryReader_queryDataLayout(void *Context, *result = sizeof(size_t); return 1; } + case DLQ_GetObjCReservedLowBits: { + uint8_t *result = (uint8_t *)outBuffer; + if (applePlatform && !iosDerivedPlatform && (sizeof(void *) == 8)) { + // Only for 64-bit macOS (not iOS, not even when simulated on x86_64) + *result = 1; + } else { + *result = 0; + } + return 1; + } + case DLQ_GetLeastValidPointerValue: { + uint64_t *result = (uint64_t *)outBuffer; + if (applePlatform && (sizeof(void *) == 8)) { + // Swift reserves the first 4GiB on Apple 64-bit platforms + *result = 0x100000000; + return 1; + } else { + // Swift reserves the first 4KiB everywhere else + *result = 0x1000; + } + return 1; + } } return 0; @@ -478,6 +515,162 @@ int reflectExistential(SwiftReflectionContextRef RC, return 1; } +int reflectEnum(SwiftReflectionContextRef RC, + const PipeMemoryReader Pipe) { + static const char Name[] = MANGLING_PREFIX_STR "ypD"; + swift_typeref_t AnyTR + = swift_reflection_typeRefForMangledTypeName( + RC, Name, sizeof(Name)-1); + + uintptr_t AnyInstance = PipeMemoryReader_receiveInstanceAddress(&Pipe); + if (AnyInstance == 0) { + // Child has no more instances to examine + PipeMemoryReader_sendDoneMessage(&Pipe); + return 0; + } + swift_typeref_t EnumTypeRef; + swift_addr_t EnumInstance = 0; + if (!swift_reflection_projectExistential(RC, AnyInstance, AnyTR, + &EnumTypeRef, + &EnumInstance)) { + printf("swift_reflection_projectExistential failed.\n"); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 0; + } + + printf("Instance pointer in child address space: 0x%lx\n", + (uintptr_t)EnumInstance); + + printf("Type reference:\n"); + swift_reflection_dumpTypeRef(EnumTypeRef); + printf("\n"); + + printf("Type info:\n"); + swift_reflection_dumpInfoForTypeRef(RC, EnumTypeRef); + printf("\n"); + + printf("Enum value:\n"); + swift_typeinfo_t InstanceTypeInfo = swift_reflection_infoForTypeRef(RC, EnumTypeRef); + if (InstanceTypeInfo.Kind != SWIFT_NO_PAYLOAD_ENUM + && InstanceTypeInfo.Kind != SWIFT_SINGLE_PAYLOAD_ENUM + && InstanceTypeInfo.Kind != SWIFT_MULTI_PAYLOAD_ENUM) { + // Enums with a single payload case and no non-payload cases + // can get rewritten by the compiler to just the payload + // type. + swift_reflection_dumpInfoForTypeRef(RC, EnumTypeRef); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 1; + } + + int CaseIndex; + if (!swift_reflection_projectEnumValue(RC, EnumInstance, EnumTypeRef, &CaseIndex)) { + printf("swift_reflection_projectEnumValue failed.\n\n"); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 1; // <<< Test cases also verify failures, so this must "succeed" + } + + char *CaseName = NULL; + swift_typeref_t PayloadTypeRef = 0; + if (!swift_reflection_getEnumCaseTypeRef(RC, EnumTypeRef, CaseIndex, &CaseName, &PayloadTypeRef)) { + printf("swift_reflection_getEnumCaseTypeRef failed.\n"); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 0; + } + + if (PayloadTypeRef == 0) { + // Enum case has no payload + printf("(enum_value name=%s index=%llu)\n", + CaseName, (unsigned long long)CaseIndex); + } else { + printf("(enum_value name=%s index=%llu\n", + CaseName, (unsigned long long)CaseIndex); + swift_reflection_dumpTypeRef(PayloadTypeRef); + printf(")\n"); + } + printf("\n"); + // FIXME: Is there a better idiom for handling the returned case name? + free(CaseName); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 1; +} + +int reflectEnumValue(SwiftReflectionContextRef RC, + const PipeMemoryReader Pipe) { + static const char Name[] = MANGLING_PREFIX_STR "ypD"; + swift_typeref_t AnyTR + = swift_reflection_typeRefForMangledTypeName( + RC, Name, sizeof(Name)-1); + + uintptr_t AnyInstance = PipeMemoryReader_receiveInstanceAddress(&Pipe); + if (AnyInstance == 0) { + // Child has no more instances to examine + PipeMemoryReader_sendDoneMessage(&Pipe); + return 0; + } + swift_typeref_t EnumTypeRef; + swift_addr_t EnumInstance = 0; + if (!swift_reflection_projectExistential(RC, AnyInstance, AnyTR, + &EnumTypeRef, + &EnumInstance)) { + printf("swift_reflection_projectExistential failed.\n"); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 0; + } + + printf("Type reference:\n"); + swift_reflection_dumpTypeRef(EnumTypeRef); + + printf("Value: "); + int parens = 0; + while (EnumTypeRef != 0) { + swift_typeinfo_t EnumTypeInfo = swift_reflection_infoForTypeRef(RC, EnumTypeRef); + if (EnumTypeInfo.Kind != SWIFT_NO_PAYLOAD_ENUM + && EnumTypeInfo.Kind != SWIFT_SINGLE_PAYLOAD_ENUM + && EnumTypeInfo.Kind != SWIFT_MULTI_PAYLOAD_ENUM) { + if (parens == 0) { + printf(".??"); // Enum was optimized away, print "something" + } else { + printf("_"); + } + break; + } + + int CaseIndex; + if (!swift_reflection_projectEnumValue(RC, EnumInstance, EnumTypeRef, &CaseIndex)) { + printf("swift_reflection_projectEnumValue failed.\n\n"); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 1; // <<< Test cases rely on detecting this, so must "succeed" + } + + char *CaseName = NULL; + swift_typeref_t PayloadTypeRef = 0; + if (!swift_reflection_getEnumCaseTypeRef(RC, EnumTypeRef, CaseIndex, + &CaseName, &PayloadTypeRef)) { + printf("swift_reflection_getEnumCaseTypeRef failed.\n"); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 0; + } + + printf(".%s", CaseName); + // FIXME: Is there a better idiom for handling the returned case name? + free(CaseName); + + EnumTypeRef = PayloadTypeRef; + if (EnumTypeRef != 0) { + printf("("); + parens += 1; + } + } + for (int i = 0; i < parens; ++i) { + printf(")"); + } + printf("\n\n"); + PipeMemoryReader_sendDoneMessage(&Pipe); + return 1; + +} + + int doDumpHeapInstance(const char *BinaryFilename) { PipeMemoryReader Pipe = createPipeMemoryReader(); @@ -549,6 +742,18 @@ int doDumpHeapInstance(const char *BinaryFilename) { if (!reflectHeapObject(RC, Pipe)) return EXIT_SUCCESS; break; + case Enum: { + printf("Reflecting an enum.\n"); + if (!reflectEnum(RC, Pipe)) + return EXIT_SUCCESS; + break; + } + case EnumValue: { + printf("Reflecting an enum value.\n"); + if (!reflectEnumValue(RC, Pipe)) + return EXIT_SUCCESS; + break; + } case None: swift_reflection_destroyReflectionContext(RC); printf("Done.\n"); diff --git a/test/Reflection/typeref_lowering.swift b/test/Reflection/typeref_lowering.swift index d406dbcffdc0b..5f79b92dea1ed 100644 --- a/test/Reflection/typeref_lowering.swift +++ b/test/Reflection/typeref_lowering.swift @@ -405,8 +405,9 @@ // CHECK-64-NEXT: (reference kind=strong refcounting=native)) // CHECK-64-NEXT: (field name=optionalStrongRef offset=8 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1:2047|4095|2147483646]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 -// CHECK-64-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-64-NEXT: (case name=some index=0 offset=0 +// CHECK-64-NEXT: (reference kind=strong refcounting=native)) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=strongRefTuple offset=16 // CHECK-64-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field offset=0 @@ -415,12 +416,13 @@ // CHECK-64-NEXT: (reference kind=strong refcounting=native)))) // CHECK-64-NEXT: (field name=optionalStrongRefTuple offset=32 // CHECK-64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=native)) // CHECK-64-NEXT: (field offset=8 -// CHECK-64-NEXT: (reference kind=strong refcounting=native))))))) +// CHECK-64-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-64-NEXT: (case name=none index=1)))) // CHECK-32: (struct TypeLowering.ReferenceStruct) // CHECK-32-NEXT: (struct size=24 alignment=4 stride=24 num_extra_inhabitants=4096 bitwise_takable=1 @@ -428,8 +430,9 @@ // CHECK-32-NEXT: (reference kind=strong refcounting=native)) // CHECK-32-NEXT: (field name=optionalStrongRef offset=4 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 -// CHECK-32-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-32-NEXT: (case name=some index=0 offset=0 +// CHECK-32-NEXT: (reference kind=strong refcounting=native)) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=strongRefTuple offset=8 // CHECK-32-NEXT: (tuple size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field offset=0 @@ -438,12 +441,13 @@ // CHECK-32-NEXT: (reference kind=strong refcounting=native)))) // CHECK-32-NEXT: (field name=optionalStrongRefTuple offset=16 // CHECK-32-NEXT: (single_payload_enum size=8 alignment=4 stride=8 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (tuple size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field offset=0 // CHECK-32-NEXT: (reference kind=strong refcounting=native)) // CHECK-32-NEXT: (field offset=4 -// CHECK-32-NEXT: (reference kind=strong refcounting=native))))))) +// CHECK-32-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-32-NEXT: (case name=none index=1)))) 12TypeLowering22UnownedReferenceStructV // CHECK-64: (struct TypeLowering.UnownedReferenceStruct) @@ -489,24 +493,27 @@ // CHECK-64-NEXT: (reference kind=strong refcounting=native)))) // CHECK-64-NEXT: (field name=optionalThickFunction offset=16 // CHECK-64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI_2_SUB_1:4095|2147483646]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (thick_function size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1 // CHECK-64-NEXT: (field name=function offset=0 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=context offset=8 -// CHECK-64-NEXT: (reference kind=strong refcounting=native)))))) +// CHECK-64-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=thinFunction offset=32 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=optionalThinFunction offset=40 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=some index=0 offset=0 +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1)) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=cFunction offset=48 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=optionalCFunction offset=56 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1))))) +// CHECK-64-NEXT: (case name=some index=0 offset=0 +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_2]] bitwise_takable=1)) +// CHECK-64-NEXT: (case name=none index=1)))) // CHECK-32: (struct TypeLowering.FunctionStruct) // CHECK-32-NEXT: (struct size=32 alignment=4 stride=32 num_extra_inhabitants=4096 bitwise_takable=1 @@ -518,24 +525,27 @@ // CHECK-32-NEXT: (reference kind=strong refcounting=native)))) // CHECK-32-NEXT: (field name=optionalThickFunction offset=8 // CHECK-32-NEXT: (single_payload_enum size=8 alignment=4 stride=8 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (thick_function size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=function offset=0 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=context offset=4 -// CHECK-32-NEXT: (reference kind=strong refcounting=native)))))) +// CHECK-32-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=thinFunction offset=16 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=optionalThinFunction offset=20 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=some index=0 offset=0 +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=cFunction offset=24 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=optionalCFunction offset=28 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1))))) +// CHECK-32-NEXT: (case name=some index=0 offset=0 +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) +// CHECK-32-NEXT: (case name=none index=1)))) 12TypeLowering17ExistentialStructV // CHECK-64: (struct TypeLowering.ExistentialStruct) @@ -546,20 +556,22 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAny offset=32 // CHECK-64-NEXT: (single_payload_enum size=32 alignment=8 stride=32 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (opaque_existential size=32 alignment=8 stride=32 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=24 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyObject offset=64 // CHECK-64-NEXT: (class_existential size=8 alignment=8 stride=8 // CHECK-64-NEXT: (field name=object offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=unknown)))) // CHECK-64-NEXT: (field name=optionalAnyObject offset=72 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (class_existential size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 -// CHECK-64-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK-64-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyProto offset=80 // CHECK-64-NEXT: (opaque_existential size=40 alignment=8 stride=40 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=24 @@ -568,12 +580,13 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyProto offset=120 // CHECK-64-NEXT: (single_payload_enum size=40 alignment=8 stride=40 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (opaque_existential size=40 alignment=8 stride=40 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=24 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=wtable offset=32 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyProtoComposition offset=160 // CHECK-64-NEXT: (opaque_existential size=48 alignment=8 stride=48 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=24 @@ -584,14 +597,15 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyProtoComposition offset=208 // CHECK-64-NEXT: (single_payload_enum size=48 alignment=8 stride=48 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (opaque_existential size=48 alignment=8 stride=48 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=24 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=wtable offset=32 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)) // CHECK-64-NEXT: (field name=wtable offset=40 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyClassBoundProto1 offset=256 // CHECK-64-NEXT: (class_existential size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 @@ -600,12 +614,13 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyClassBoundProto1 offset=272 // CHECK-64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (class_existential size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-64-NEXT: (field name=wtable offset=8 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyClassBoundProto2 offset=288 // CHECK-64-NEXT: (class_existential size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 @@ -614,12 +629,13 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyClassBoundProto2 offset=304 // CHECK-64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (class_existential size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-64-NEXT: (field name=wtable offset=8 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyClassBoundProtoComposition1 offset=320 // CHECK-64-NEXT: (class_existential size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 @@ -628,12 +644,13 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyClassBoundProtoComposition1 offset=336 // CHECK-64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (class_existential size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-64-NEXT: (field name=wtable offset=8 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyClassBoundProtoComposition2 offset=352 // CHECK-64-NEXT: (class_existential size=24 alignment=8 stride=24 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 @@ -644,14 +661,15 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyClassBoundProtoComposition2 offset=376 // CHECK-64-NEXT: (single_payload_enum size=24 alignment=8 stride=24 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (class_existential size=24 alignment=8 stride=24 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-64-NEXT: (field name=wtable offset=8 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)) // CHECK-64-NEXT: (field name=wtable offset=16 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=classConstrainedP1 offset=400 // CHECK-64-NEXT: (class_existential size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 @@ -667,20 +685,22 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAny offset=16 // CHECK-32-NEXT: (single_payload_enum size=16 alignment=4 stride=16 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (opaque_existential size=16 alignment=4 stride=16 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=12 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyObject offset=32 // CHECK-32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 // CHECK-32-NEXT: (reference kind=strong refcounting=unknown)))) // CHECK-32-NEXT: (field name=optionalAnyObject offset=36 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 -// CHECK-32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK-32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyProto offset=40 // CHECK-32-NEXT: (opaque_existential size=20 alignment=4 stride=20 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=12 @@ -689,12 +709,13 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyProto offset=60 // CHECK-32-NEXT: (single_payload_enum size=20 alignment=4 stride=20 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (opaque_existential size=20 alignment=4 stride=20 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=12 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=wtable offset=16 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyProtoComposition offset=80 // CHECK-32-NEXT: (opaque_existential size=24 alignment=4 stride=24 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=12 @@ -705,14 +726,15 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyProtoComposition offset=104 // CHECK-32-NEXT: (single_payload_enum size=24 alignment=4 stride=24 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (opaque_existential size=24 alignment=4 stride=24 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=12 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=wtable offset=16 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)) // CHECK-32-NEXT: (field name=wtable offset=20 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyClassBoundProto1 offset=128 // CHECK-32-NEXT: (class_existential size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 @@ -721,12 +743,13 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyClassBoundProto1 offset=136 // CHECK-32-NEXT: (single_payload_enum size=8 alignment=4 stride=8 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (class_existential size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 // CHECK-32-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-32-NEXT: (field name=wtable offset=4 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyClassBoundProto2 offset=144 // CHECK-32-NEXT: (class_existential size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 @@ -735,12 +758,13 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyClassBoundProto2 offset=152 // CHECK-32-NEXT: (single_payload_enum size=8 alignment=4 stride=8 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (class_existential size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 // CHECK-32-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-32-NEXT: (field name=wtable offset=4 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyClassBoundProtoComposition1 offset=160 // CHECK-32-NEXT: (class_existential size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 @@ -749,12 +773,13 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyClassBoundProtoComposition1 offset=168 // CHECK-32-NEXT: (single_payload_enum size=8 alignment=4 stride=8 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (class_existential size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 // CHECK-32-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-32-NEXT: (field name=wtable offset=4 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyClassBoundProtoComposition2 offset=176 // CHECK-32-NEXT: (class_existential size=12 alignment=4 stride=12 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 @@ -765,14 +790,15 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyClassBoundProtoComposition2 offset=188 // CHECK-32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (class_existential size=12 alignment=4 stride=12 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 // CHECK-32-NEXT: (reference kind=strong refcounting=unknown)) // CHECK-32-NEXT: (field name=wtable offset=4 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)) // CHECK-32-NEXT: (field name=wtable offset=8 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=classConstrainedP1 offset=200 // CHECK-32-NEXT: (class_existential size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 @@ -895,20 +921,22 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAny offset=8 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (existential_metatype size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyObject offset=16 // CHECK-64-NEXT: (existential_metatype size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=0 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyObject offset=24 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (existential_metatype size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyProto offset=32 // CHECK-64-NEXT: (existential_metatype size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=0 @@ -917,12 +945,13 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyProto offset=48 // CHECK-64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (existential_metatype size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=0 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=wtable offset=8 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=anyProtoComposition offset=64 // CHECK-64-NEXT: (existential_metatype size=24 alignment=8 stride=24 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=0 @@ -933,26 +962,29 @@ // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-64-NEXT: (field name=optionalAnyProtoComposition offset=88 // CHECK-64-NEXT: (single_payload_enum size=24 alignment=8 stride=24 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (existential_metatype size=24 alignment=8 stride=24 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=metadata offset=0 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=wtable offset=8 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)) // CHECK-64-NEXT: (field name=wtable offset=16 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=structMetatype offset=112 // CHECK-64-NEXT: (builtin size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) // CHECK-64-NEXT: (field name=optionalStructMetatype offset=112 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=some index=0 offset=0 +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=classMetatype offset=120 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)) // CHECK-64-NEXT: (field name=optionalClassMetatype offset=128 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=some index=0 offset=0 +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1)) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=abstractMetatype offset=136 // CHECK-64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=[[PTR_XI]] bitwise_takable=1 // CHECK-64-NEXT: (field name=t offset=0 @@ -968,20 +1000,22 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAny offset=4 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (existential_metatype size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=0 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyObject offset=8 // CHECK-32-NEXT: (existential_metatype size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=0 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyObject offset=12 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (existential_metatype size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=0 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyProto offset=16 // CHECK-32-NEXT: (existential_metatype size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=0 @@ -990,12 +1024,13 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyProto offset=24 // CHECK-32-NEXT: (single_payload_enum size=8 alignment=4 stride=8 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (existential_metatype size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=0 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=wtable offset=4 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=anyProtoComposition offset=32 // CHECK-32-NEXT: (existential_metatype size=12 alignment=4 stride=12 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=0 @@ -1006,26 +1041,29 @@ // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) // CHECK-32-NEXT: (field name=optionalAnyProtoComposition offset=44 // CHECK-32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 +// CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (existential_metatype size=12 alignment=4 stride=12 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=metadata offset=0 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=wtable offset=4 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)) // CHECK-32-NEXT: (field name=wtable offset=8 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))))) +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=structMetatype offset=56 // CHECK-32-NEXT: (builtin size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) // CHECK-32-NEXT: (field name=optionalStructMetatype offset=56 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=some index=0 offset=0 +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=classMetatype offset=60 // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) // CHECK-32-NEXT: (field name=optionalClassMetatype offset=64 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32-NEXT: (field name=some offset=0 -// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))) +// CHECK-32-NEXT: (case name=some index=0 offset=0 +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)) +// CHECK-32-NEXT: (case name=none index=1))) // CHECK-32-NEXT: (field name=abstractMetatype offset=68 // CHECK-32-NEXT: (struct size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=t offset=0 @@ -1039,76 +1077,96 @@ // CHECK-64-NEXT: (field name=empty offset=0 // CHECK-64-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) // CHECK-64-NEXT: (field name=noPayload offset=0 -// CHECK-64-NEXT: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1)) +// CHECK-64-NEXT: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1 +// CHECK-64-NEXT: (case name=A index=0) +// CHECK-64-NEXT: (case name=B index=1) +// CHECK-64-NEXT: (case name=C index=2) +// CHECK-64-NEXT: (case name=D index=3))) // CHECK-64-NEXT: (field name=sillyNoPayload offset=1 // CHECK-64-NEXT: (multi_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1 -// CHECK-64-NEXT: (field name=A offset=0 +// CHECK-64-NEXT: (case name=A index=0 offset=0 +// CHECK-64-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-64-NEXT: (case name=B index=1 offset=0 // CHECK-64-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) -// CHECK-64-NEXT: (field name=B offset=0 -// CHECK-64-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=C index=2) +// CHECK-64-NEXT: (case name=D index=3))) // CHECK-64-NEXT: (field name=singleton offset=8 // CHECK-64-NEXT: (reference kind=strong refcounting=native)) // CHECK-64-NEXT: (field name=singlePayload offset=16 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=Indirect offset=0 -// CHECK-64-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-64-NEXT: (case name=Indirect index=0 offset=0 +// CHECK-64-NEXT: (reference kind=strong refcounting=native)) +// CHECK-64-NEXT: (case name=Nothing index=1))) // CHECK-64-NEXT: (field name=multiPayloadConcrete offset=24 // CHECK-64-NEXT: (multi_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants={{(2045|125)}} bitwise_takable=1 -// CHECK-64-NEXT: (field name=Left offset=0 +// CHECK-64-NEXT: (case name=Left index=0 offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=native)) -// CHECK-64-NEXT: (field name=Right offset=0 -// CHECK-64-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-64-NEXT: (case name=Right index=1 offset=0 +// CHECK-64-NEXT: (reference kind=strong refcounting=native)) +// CHECK-64-NEXT: (case name=Donkey index=2) +// CHECK-64-NEXT: (case name=Mule index=3) +// CHECK-64-NEXT: (case name=Horse index=4))) // CHECK-64-NEXT: (field name=multiPayloadGenericFixed offset=32 // CHECK-64-NEXT: (multi_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64-NEXT: (field name=Left offset=0 +// CHECK-64-NEXT: (case name=Left index=0 offset=0 // CHECK-64-NEXT: (reference kind=strong refcounting=native)) -// CHECK-64-NEXT: (field name=Right offset=0 -// CHECK-64-NEXT: (reference kind=strong refcounting=native)))) +// CHECK-64-NEXT: (case name=Right index=1 offset=0 +// CHECK-64-NEXT: (reference kind=strong refcounting=native)) +// CHECK-64-NEXT: (case name=Donkey index=2) +// CHECK-64-NEXT: (case name=Mule index=3) +// CHECK-64-NEXT: (case name=Horse index=4))) // CHECK-64-NEXT: (field name=multiPayloadGenericDynamic offset=48 // CHECK-64-NEXT: (multi_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64-NEXT: (field name=Left offset=0 +// CHECK-64-NEXT: (case name=Left index=0 offset=0 // CHECK-64-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field name=_value offset=0 // CHECK-64-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) -// CHECK-64-NEXT: (field name=Right offset=0 +// CHECK-64-NEXT: (case name=Right index=1 offset=0 // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field name=_value offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=Donkey index=2) +// CHECK-64-NEXT: (case name=Mule index=3) +// CHECK-64-NEXT: (case name=Horse index=4))) // CHECK-64-NEXT: (field name=optionalOptionalRef offset=64 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_2:2147483645|2046|4094]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=[[PTR_XI_SUB_1]] bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 -// CHECK-64-NEXT: (reference kind=strong refcounting=native)))))) +// CHECK-64-NEXT: (case name=some index=0 offset=0 +// CHECK-64-NEXT: (reference kind=strong refcounting=native)) +// CHECK-64-NEXT: (case name=none index=1))) +// CHECK-64-NEXT: (case name=none index=1))) // CHECK-64-NEXT: (field name=optionalOptionalPtr offset=72 // CHECK-64-NEXT: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64-NEXT: (field name=some offset=0 +// CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1 // CHECK-64-NEXT: (field name=_rawValue offset=0 -// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1))))))))) +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=1 bitwise_takable=1)))) +// CHECK-64-NEXT: (case name=none index=1))) +// CHECK-64-NEXT: (case name=none index=1)))) 12TypeLowering23EnumStructWithOwnershipV // CHECK-64: (struct TypeLowering.EnumStructWithOwnership) // CHECK-64-NEXT: (struct size=25 alignment=8 stride=32 num_extra_inhabitants=254 bitwise_takable=0 // CHECK-64-NEXT: (field name=multiPayloadConcrete offset=0 // CHECK-64-NEXT: (multi_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=254 bitwise_takable=0 -// CHECK-64-NEXT: (field name=Left offset=0 +// CHECK-64-NEXT: (case name=Left index=0 offset=0 // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-64-NEXT: (field name=weakRef offset=0 // CHECK-64-NEXT: (reference kind=weak refcounting=native)))) -// CHECK-64-NEXT: (field name=Right offset=0 +// CHECK-64-NEXT: (case name=Right index=1 offset=0 // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-64-NEXT: (field name=weakRef offset=0 // CHECK-64-NEXT: (reference kind=weak refcounting=native)))))) // CHECK-64-NEXT: (field name=multiPayloadGeneric offset=16 // CHECK-64-NEXT: (multi_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=254 bitwise_takable=0 -// CHECK-64-NEXT: (field name=Left offset=0 +// CHECK-64-NEXT: (case name=Left index=0 offset=0 // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-64-NEXT: (field name=weakRef offset=0 // CHECK-64-NEXT: (reference kind=weak refcounting=native)))) -// CHECK-64-NEXT: (field name=Right offset=0 +// CHECK-64-NEXT: (case name=Right index=1 offset=0 // CHECK-64-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field name=_value offset=0 // CHECK-64-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1))))))) @@ -1117,21 +1175,21 @@ // CHECK-32-NEXT: (struct size=13 alignment=4 stride=16 num_extra_inhabitants=254 bitwise_takable=0 // CHECK-32-NEXT: (field name=multiPayloadConcrete offset=0 // CHECK-32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=254 bitwise_takable=0 -// CHECK-32-NEXT: (field name=Left offset=0 +// CHECK-32-NEXT: (case name=Left index=0 offset=0 // CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-32-NEXT: (field name=weakRef offset=0 // CHECK-32-NEXT: (reference kind=weak refcounting=native)))) -// CHECK-32-NEXT: (field name=Right offset=0 +// CHECK-32-NEXT: (case name=Right index=1 offset=0 // CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-32-NEXT: (field name=weakRef offset=0 // CHECK-32-NEXT: (reference kind=weak refcounting=native)))))) // CHECK-32-NEXT: (field name=multiPayloadGeneric offset=8 // CHECK-32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=254 bitwise_takable=0 -// CHECK-32-NEXT: (field name=Left offset=0 +// CHECK-32-NEXT: (case name=Left index=0 offset=0 // CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-32-NEXT: (field name=weakRef offset=0 // CHECK-32-NEXT: (reference kind=weak refcounting=native)))) -// CHECK-32-NEXT: (field name=Right offset=0 +// CHECK-32-NEXT: (case name=Right index=1 offset=0 // CHECK-32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32-NEXT: (field name=_value offset=0 // CHECK-32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1))))))) diff --git a/test/Reflection/typeref_lowering_objc.swift b/test/Reflection/typeref_lowering_objc.swift index 0f164c0a0b138..64237f928a167 100644 --- a/test/Reflection/typeref_lowering_objc.swift +++ b/test/Reflection/typeref_lowering_objc.swift @@ -23,8 +23,9 @@ // CHECK: (struct size=24 alignment=8 stride=24 num_extra_inhabitants=2147483647 bitwise_takable=1 // CHECK-NEXT: (field name=optionalEnum offset=0 // CHECK-NEXT: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-NEXT: (field name=some offset=0 -// CHECK-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-NEXT: (case name=some index=0 offset=0 +// CHECK-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-NEXT: (case name=none index=1))) // CHECK-NEXT: (field name=reference offset=16 // CHECK-NEXT: (class_existential size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 // CHECK-NEXT: (field name=object offset=0 diff --git a/tools/swift-reflection-dump/swift-reflection-dump.cpp b/tools/swift-reflection-dump/swift-reflection-dump.cpp index 69dc1120f7e11..62b10d0e450dc 100644 --- a/tools/swift-reflection-dump/swift-reflection-dump.cpp +++ b/tools/swift-reflection-dump/swift-reflection-dump.cpp @@ -35,6 +35,10 @@ #include #endif +#if defined(__APPLE__) && defined(__MACH__) +#include +#endif + #include #include @@ -426,6 +430,19 @@ class ObjectMemoryReader : public MemoryReader { bool queryDataLayout(DataLayoutQueryType type, void *inBuffer, void *outBuffer) override { auto wordSize = Images.front().TheImage.getBytesInAddress(); + // TODO: The following should be set based on inspecting the image. + // This code sets it to match the platform this code was compiled for. +#if defined(__APPLE__) && __APPLE__ + auto applePlatform = true; +#else + auto applePlatform = false; +#endif +#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV)) + auto iosDerivedPlatform = true; +#else + auto iosDerivedPlatform = false; +#endif + switch (type) { case DLQ_GetPointerSize: { auto result = static_cast(outBuffer); @@ -437,6 +454,29 @@ class ObjectMemoryReader : public MemoryReader { *result = wordSize; return true; } + case DLQ_GetObjCReservedLowBits: { + auto result = static_cast(outBuffer); + if (applePlatform && !iosDerivedPlatform && wordSize == 8) { + // Obj-C reserves low bit on 64-bit macOS only. + // Other Apple platforms don't reserve this bit (even when + // running on x86_64-based simulators). + *result = 1; + } else { + *result = 0; + } + return true; + } + case DLQ_GetLeastValidPointerValue: { + auto result = static_cast(outBuffer); + if (applePlatform && wordSize == 8) { + // Swift reserves the first 4GiB on 64-bit Apple platforms + *result = 0x100000000; + } else { + // Swift reserves the first 4KiB everywhere else + *result = 0x1000; + } + return true; + } } return false; diff --git a/tools/swift-reflection-fuzzer/swift-reflection-fuzzer.cpp b/tools/swift-reflection-fuzzer/swift-reflection-fuzzer.cpp index 2e9b89b77b48d..80aaf7d4ca6fd 100644 --- a/tools/swift-reflection-fuzzer/swift-reflection-fuzzer.cpp +++ b/tools/swift-reflection-fuzzer/swift-reflection-fuzzer.cpp @@ -31,6 +31,10 @@ #include #include +#if defined(__APPLE__) && defined(__MACH__) +#include +#endif + using namespace llvm::object; using namespace swift; @@ -52,6 +56,17 @@ class ObjectMemoryReader : public MemoryReader { bool queryDataLayout(DataLayoutQueryType type, void *inBuffer, void *outBuffer) override { +#if defined(__APPLE__) && __APPLE__ + auto applePlatform = true; +#else + auto applePlatform = false; +#endif +#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV)) + auto iosDerivedPlatform = true; +#else + auto iosDerivedPlatform = false; +#endif + switch (type) { case DLQ_GetPointerSize: { auto result = static_cast(outBuffer); @@ -63,6 +78,30 @@ class ObjectMemoryReader : public MemoryReader { *result = sizeof(size_t); return true; } + case DLQ_GetObjCReservedLowBits: { + auto result = static_cast(outBuffer); + if (applePlatform && !iosDerivedPlatform && (sizeof(void *) == 8)) { + // Obj-C reserves low bit on 64-bit macOS only. + // Other Apple platforms don't reserve this bit (even when + // running on x86_64-based simulators). + *result = 1; + } else { + *result = 0; + } + return true; + } + case DLQ_GetLeastValidPointerValue: { + auto result = static_cast(outBuffer); + if (applePlatform && (sizeof(void *) == 8)) { + // Swift reserves the first 4GiB on Apple 64-bit platforms + *result = 0x100000000; + return 1; + } else { + // Swift reserves the first 4KiB everywhere else + *result = 0x1000; + } + return true; + } } return false; diff --git a/validation-test/Reflection/functions.swift b/validation-test/Reflection/functions.swift index 5672816a0efcc..4c7e490acb66f 100644 --- a/validation-test/Reflection/functions.swift +++ b/validation-test/Reflection/functions.swift @@ -161,19 +161,15 @@ genericWithSources(a: (), b: ((), ()), c: ((), (), ()), gc: GC<(), ((), ()), (() class CapturingClass { - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (class functions.CapturingClass) + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (class functions.CapturingClass) // CHECK-64: Type info: - // CHECK-64: (class_instance size=16 alignment=1 stride=16 - - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (class functions.CapturingClass) + // CHECK-64-NEXT: (class_instance size=16 alignment=1 stride=16 // CHECK-32: Type info: - // CHECK-32: (class_instance size=8 alignment=1 stride=8 + // CHECK-32-NEXT: (class_instance size=8 alignment=1 stride=8 @_optimize(none) func arity0Capture1() -> () -> () { let closure = { @@ -184,12 +180,12 @@ class CapturingClass { return closure } - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (builtin Builtin.NativeObject) + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: - // CHECK-64: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field offset=16 // CHECK-64-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field offset=0 @@ -201,12 +197,8 @@ class CapturingClass { // CHECK-64-NEXT: (field name=_value offset=0 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (builtin Builtin.NativeObject) - // CHECK-32: Type info: - // CHECK-32: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32-NEXT: (field offset=8 // CHECK-32-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32-NEXT: (field offset=0 @@ -227,12 +219,12 @@ class CapturingClass { return closure } - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (builtin Builtin.NativeObject) + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: - // CHECK-64: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field offset=16 // CHECK-64-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 // CHECK-64-NEXT: (field offset=0 @@ -242,12 +234,8 @@ class CapturingClass { // CHECK-64-NEXT: (field offset=8 // CHECK-64-NEXT: (reference kind=strong refcounting=native))))) - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (builtin Builtin.NativeObject) - // CHECK-32: Type info: - // CHECK-32: (closure_context size=16 alignment=4 stride=16 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (closure_context size=16 alignment=4 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32-NEXT: (field offset=8 // CHECK-32-NEXT: (tuple size=8 alignment=4 stride=8 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field offset=0 @@ -267,31 +255,29 @@ class CapturingClass { return closure } - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (builtin Builtin.NativeObject) + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: - // CHECK-64: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field offset=16 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 - // CHECK-64-NEXT: (field name=some offset=0 + // CHECK-64-NEXT: (case name=some index=0 offset=0 // CHECK-64-NEXT: (class_existential size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 // CHECK-64-NEXT: (field name=object offset=0 - // CHECK-64-NEXT: (reference kind=strong refcounting=unknown)))))) + // CHECK-64-NEXT: (reference kind=strong refcounting=unknown)))) + // CHECK-64-NEXT: (case name=none index=1)))) - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (builtin Builtin.NativeObject) - // CHECK-32: Type info: - // CHECK-32: (closure_context size=12 alignment=4 stride=12 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (closure_context size=12 alignment=4 stride=12 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32-NEXT: (field offset=8 // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 - // CHECK-32-NEXT: (field name=some offset=0 + // CHECK-32-NEXT: (case name=some index=0 offset=0 // CHECK-32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 // CHECK-32-NEXT: (field name=object offset=0 - // CHECK-32-NEXT: (reference kind=strong refcounting=unknown))))) + // CHECK-32-NEXT: (reference kind=strong refcounting=unknown)))) + // CHECK-32-NEXT: (case name=none index=1)))) @_optimize(none) func arity3Capture1() -> (Int, String, AnyObject?) -> () { let c: AnyObject? = C() @@ -304,11 +290,12 @@ class CapturingClass { } - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (builtin Builtin.NativeObject) - // CHECK-64: Type info: - // CHECK-64: (closure_context size=40 alignment=8 stride=40 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (builtin Builtin.NativeObject) + + // CHECK-64: Type info: + // CHECK-64-NEXT: (closure_context size=40 alignment=8 stride=40 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field offset=16 // CHECK-64-NEXT: (reference kind=strong refcounting=native)) // CHECK-64-NEXT: (field offset=24 @@ -322,12 +309,8 @@ class CapturingClass { // CHECK-64-NEXT: (field name=_value offset=0 // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (builtin Builtin.NativeObject) - // CHECK-32: Type info: - // CHECK-32: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32-NEXT: (field offset=8 // CHECK-32-NEXT: (reference kind=strong refcounting=native)) // CHECK-32-NEXT: (field offset=16 @@ -351,29 +334,29 @@ class CapturingClass { return closure } - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (builtin Builtin.NativeObject) + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: - // CHECK-64: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field offset=16 // CHECK-64-NEXT: (reference kind=strong refcounting=native)) // CHECK-64-NEXT: (field offset=24 // CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 - // CHECK-64-NEXT: (field name=some offset=0 - // CHECK-64-NEXT: (reference kind=strong refcounting=native)))) + // CHECK-64-NEXT: (case name=some index=0 offset=0 + // CHECK-64-NEXT: (reference kind=strong refcounting=native)) + // CHECK-64-NEXT: (case name=none index=1)))) - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (builtin Builtin.NativeObject) - // CHECK-32: Type info: - // CHECK-32: (closure_context size=16 alignment=4 stride=16 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field offset=8 - // CHECK-32: (reference kind=strong refcounting=native)) - // CHECK-32: (field offset=12 - // CHECK-32: (reference kind=strong refcounting=native))) + // CHECK-32-NEXT: (closure_context size=16 alignment=4 stride=16 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field offset=8 + // CHECK-32-NEXT: (reference kind=strong refcounting=native)) + // CHECK-32-NEXT: (field offset=12 + // CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 + // CHECK-32-NEXT: (case name=some index=0 offset=0 + // CHECK-32-NEXT: (reference kind=strong refcounting=native)) + // CHECK-32-NEXT: (case name=none index=1)))) @_optimize(none) func arity1Capture2() -> (Int) -> () { let x: C? = C() @@ -385,43 +368,39 @@ class CapturingClass { return closure } - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (builtin Builtin.NativeObject) + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: - // CHECK-64: (closure_context size=40 alignment=8 stride=40 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field offset=16 - // CHECK-64: (reference kind=strong refcounting=native)) - // CHECK-64: (field offset=24 - // CHECK-64: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field offset=0 - // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field name=_value offset=0 - // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) - // CHECK-64: (field offset=8 - // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field name=_value offset=0 - // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) - - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (builtin Builtin.NativeObject) - + // CHECK-64-NEXT: (closure_context size=40 alignment=8 stride=40 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field offset=16 + // CHECK-64-NEXT: (reference kind=strong refcounting=native)) + // CHECK-64-NEXT: (field offset=24 + // CHECK-64-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field offset=0 + // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field name=_value offset=0 + // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) + // CHECK-64-NEXT: (field offset=8 + // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field name=_value offset=0 + // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) + // CHECK-32: Type info: - // CHECK-32: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field offset=8 - // CHECK-32: (reference kind=strong refcounting=native)) - // CHECK-32: (field offset=16 - // CHECK-32: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field offset=0 - // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field name=_value offset=0 - // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) - // CHECK-32: (field offset=8 - // CHECK-32: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field name=_value offset=0 - // CHECK-32: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) + // CHECK-32-NEXT: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field offset=8 + // CHECK-32-NEXT: (reference kind=strong refcounting=native)) + // CHECK-32-NEXT: (field offset=16 + // CHECK-32-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field offset=0 + // CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field name=_value offset=0 + // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) + // CHECK-32-NEXT: (field offset=8 + // CHECK-32-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field name=_value offset=0 + // CHECK-32-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) @_optimize(none) func arity2Capture2() -> (Int, String) -> () { let pair = (999, 1010.2) @@ -434,43 +413,39 @@ class CapturingClass { return closure } - // CHECK-64: Reflecting an object. - // CHECK-64: Type reference: - // CHECK-64: (builtin Builtin.NativeObject) + // CHECK: Reflecting an object. + // CHECK: Type reference: + // CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: - // CHECK-64: (closure_context size=40 alignment=8 stride=40 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field offset=16 - // CHECK-64: (reference kind=strong refcounting=native)) - // CHECK-64: (field offset=24 - // CHECK-64: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field offset=0 - // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field name=_value offset=0 - // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) - // CHECK-64: (field offset=8 - // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-64: (field name=_value offset=0 - // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) - - // CHECK-32: Reflecting an object. - // CHECK-32: Type reference: - // CHECK-32: (builtin Builtin.NativeObject) - + // CHECK-64-NEXT: (closure_context size=40 alignment=8 stride=40 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field offset=16 + // CHECK-64-NEXT: (reference kind=strong refcounting=native)) + // CHECK-64-NEXT: (field offset=24 + // CHECK-64-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field offset=0 + // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field name=_value offset=0 + // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) + // CHECK-64-NEXT: (field offset=8 + // CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-64-NEXT: (field name=_value offset=0 + // CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) + // CHECK-32: Type info: - // CHECK-32: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field offset=8 - // CHECK-32: (reference kind=strong refcounting=native)) - // CHECK-32: (field offset=16 - // CHECK-32: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field offset=0 - // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field name=_value offset=0 - // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) - // CHECK-32: (field offset=8 - // CHECK-32: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 - // CHECK-32: (field name=_value offset=0 - // CHECK-32: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) + // CHECK-32-NEXT: (closure_context size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field offset=8 + // CHECK-32-NEXT: (reference kind=strong refcounting=native)) + // CHECK-32-NEXT: (field offset=16 + // CHECK-32-NEXT: (tuple size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field offset=0 + // CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field name=_value offset=0 + // CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) + // CHECK-32-NEXT: (field offset=8 + // CHECK-32-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 + // CHECK-32-NEXT: (field name=_value offset=0 + // CHECK-32-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))) @_optimize(none) func arity3Capture2() -> (Int, String, AnyObject?) -> () { let pair = (999, 1010.2) @@ -496,44 +471,34 @@ _ = cc.arity2Capture2() _ = cc.arity3Capture2() reflect(function: C().captureWeakSelf()) -// CHECK-64: Reflecting an object. -// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} -// CHECK-64: Type reference: -// CHECK-64: (builtin Builtin.NativeObject) +// CHECK: Reflecting an object. +// CHECK-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: -// CHECK-64: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=0 +// CHECK-64-NEXT: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-64-NEXT: (field offset=16 // CHECK-64-NEXT: (reference kind=weak refcounting=native))) -// CHECK-32: Reflecting an object. -// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} -// CHECK-32: Type reference: -// CHECK-32: (builtin Builtin.NativeObject) - // CHECK-32: Type info: -// CHECK-32: (closure_context size=12 alignment=4 stride=12 num_extra_inhabitants=0 bitwise_takable=0 +// CHECK-32-NEXT: (closure_context size=12 alignment=4 stride=12 num_extra_inhabitants=0 bitwise_takable=0 // CHECK-32-NEXT: (field offset=8 // CHECK-32-NEXT: (reference kind=weak refcounting=native))) reflect(function: C().captureUnownedSelf()) -// CHECK-64: Reflecting an object. -// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} -// CHECK-64: Type reference: -// CHECK-64: (builtin Builtin.NativeObject) +// CHECK: Reflecting an object. +// CHECK-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (builtin Builtin.NativeObject) // CHECK-64: Type info: -// CHECK-64: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64-NEXT: (closure_context size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64-NEXT: (field offset=16 // CHECK-64-NEXT: (reference kind=unowned refcounting=native))) -// CHECK-32: Reflecting an object. -// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} -// CHECK-32: Type reference: -// CHECK-32: (builtin Builtin.NativeObject) - // CHECK-32: Type info: -// CHECK-32: (closure_context size=12 alignment=4 stride=12 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32-NEXT: (closure_context size=12 alignment=4 stride=12 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32-NEXT: (field offset=8 // CHECK-32-NEXT: (reference kind=unowned refcounting=native))) diff --git a/validation-test/Reflection/reflect_Enum_254CaseNoPayloads.swift b/validation-test/Reflection/reflect_Enum_254CaseNoPayloads.swift index 9a6faf06360c2..61b115ba72abf 100644 --- a/validation-test/Reflection/reflect_Enum_254CaseNoPayloads.swift +++ b/validation-test/Reflection/reflect_Enum_254CaseNoPayloads.swift @@ -290,35 +290,1315 @@ reflect(object: ClassWith254CaseEnum()) // CHECK-64: Type info: // CHECK-64: (class_instance size=24 alignment=1 stride=24 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=e1 offset=16 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)) +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-64: (case name=option0 index=0) +// CHECK-64: (case name=option1 index=1) +// CHECK-64: (case name=option2 index=2) +// CHECK-64: (case name=option3 index=3) +// CHECK-64: (case name=option4 index=4) +// CHECK-64: (case name=option5 index=5) +// CHECK-64: (case name=option6 index=6) +// CHECK-64: (case name=option7 index=7) +// CHECK-64: (case name=option8 index=8) +// CHECK-64: (case name=option9 index=9) +// CHECK-64: (case name=option10 index=10) +// CHECK-64: (case name=option11 index=11) +// CHECK-64: (case name=option12 index=12) +// CHECK-64: (case name=option13 index=13) +// CHECK-64: (case name=option14 index=14) +// CHECK-64: (case name=option15 index=15) +// CHECK-64: (case name=option16 index=16) +// CHECK-64: (case name=option17 index=17) +// CHECK-64: (case name=option18 index=18) +// CHECK-64: (case name=option19 index=19) +// CHECK-64: (case name=option20 index=20) +// CHECK-64: (case name=option21 index=21) +// CHECK-64: (case name=option22 index=22) +// CHECK-64: (case name=option23 index=23) +// CHECK-64: (case name=option24 index=24) +// CHECK-64: (case name=option25 index=25) +// CHECK-64: (case name=option26 index=26) +// CHECK-64: (case name=option27 index=27) +// CHECK-64: (case name=option28 index=28) +// CHECK-64: (case name=option29 index=29) +// CHECK-64: (case name=option30 index=30) +// CHECK-64: (case name=option31 index=31) +// CHECK-64: (case name=option32 index=32) +// CHECK-64: (case name=option33 index=33) +// CHECK-64: (case name=option34 index=34) +// CHECK-64: (case name=option35 index=35) +// CHECK-64: (case name=option36 index=36) +// CHECK-64: (case name=option37 index=37) +// CHECK-64: (case name=option38 index=38) +// CHECK-64: (case name=option39 index=39) +// CHECK-64: (case name=option40 index=40) +// CHECK-64: (case name=option41 index=41) +// CHECK-64: (case name=option42 index=42) +// CHECK-64: (case name=option43 index=43) +// CHECK-64: (case name=option44 index=44) +// CHECK-64: (case name=option45 index=45) +// CHECK-64: (case name=option46 index=46) +// CHECK-64: (case name=option47 index=47) +// CHECK-64: (case name=option48 index=48) +// CHECK-64: (case name=option49 index=49) +// CHECK-64: (case name=option50 index=50) +// CHECK-64: (case name=option51 index=51) +// CHECK-64: (case name=option52 index=52) +// CHECK-64: (case name=option53 index=53) +// CHECK-64: (case name=option54 index=54) +// CHECK-64: (case name=option55 index=55) +// CHECK-64: (case name=option56 index=56) +// CHECK-64: (case name=option57 index=57) +// CHECK-64: (case name=option58 index=58) +// CHECK-64: (case name=option59 index=59) +// CHECK-64: (case name=option60 index=60) +// CHECK-64: (case name=option61 index=61) +// CHECK-64: (case name=option62 index=62) +// CHECK-64: (case name=option63 index=63) +// CHECK-64: (case name=option64 index=64) +// CHECK-64: (case name=option65 index=65) +// CHECK-64: (case name=option66 index=66) +// CHECK-64: (case name=option67 index=67) +// CHECK-64: (case name=option68 index=68) +// CHECK-64: (case name=option69 index=69) +// CHECK-64: (case name=option70 index=70) +// CHECK-64: (case name=option71 index=71) +// CHECK-64: (case name=option72 index=72) +// CHECK-64: (case name=option73 index=73) +// CHECK-64: (case name=option74 index=74) +// CHECK-64: (case name=option75 index=75) +// CHECK-64: (case name=option76 index=76) +// CHECK-64: (case name=option77 index=77) +// CHECK-64: (case name=option78 index=78) +// CHECK-64: (case name=option79 index=79) +// CHECK-64: (case name=option80 index=80) +// CHECK-64: (case name=option81 index=81) +// CHECK-64: (case name=option82 index=82) +// CHECK-64: (case name=option83 index=83) +// CHECK-64: (case name=option84 index=84) +// CHECK-64: (case name=option85 index=85) +// CHECK-64: (case name=option86 index=86) +// CHECK-64: (case name=option87 index=87) +// CHECK-64: (case name=option88 index=88) +// CHECK-64: (case name=option89 index=89) +// CHECK-64: (case name=option90 index=90) +// CHECK-64: (case name=option91 index=91) +// CHECK-64: (case name=option92 index=92) +// CHECK-64: (case name=option93 index=93) +// CHECK-64: (case name=option94 index=94) +// CHECK-64: (case name=option95 index=95) +// CHECK-64: (case name=option96 index=96) +// CHECK-64: (case name=option97 index=97) +// CHECK-64: (case name=option98 index=98) +// CHECK-64: (case name=option99 index=99) +// CHECK-64: (case name=option100 index=100) +// CHECK-64: (case name=option101 index=101) +// CHECK-64: (case name=option102 index=102) +// CHECK-64: (case name=option103 index=103) +// CHECK-64: (case name=option104 index=104) +// CHECK-64: (case name=option105 index=105) +// CHECK-64: (case name=option106 index=106) +// CHECK-64: (case name=option107 index=107) +// CHECK-64: (case name=option108 index=108) +// CHECK-64: (case name=option109 index=109) +// CHECK-64: (case name=option110 index=110) +// CHECK-64: (case name=option111 index=111) +// CHECK-64: (case name=option112 index=112) +// CHECK-64: (case name=option113 index=113) +// CHECK-64: (case name=option114 index=114) +// CHECK-64: (case name=option115 index=115) +// CHECK-64: (case name=option116 index=116) +// CHECK-64: (case name=option117 index=117) +// CHECK-64: (case name=option118 index=118) +// CHECK-64: (case name=option119 index=119) +// CHECK-64: (case name=option120 index=120) +// CHECK-64: (case name=option121 index=121) +// CHECK-64: (case name=option122 index=122) +// CHECK-64: (case name=option123 index=123) +// CHECK-64: (case name=option124 index=124) +// CHECK-64: (case name=option125 index=125) +// CHECK-64: (case name=option126 index=126) +// CHECK-64: (case name=option127 index=127) +// CHECK-64: (case name=option128 index=128) +// CHECK-64: (case name=option129 index=129) +// CHECK-64: (case name=option130 index=130) +// CHECK-64: (case name=option131 index=131) +// CHECK-64: (case name=option132 index=132) +// CHECK-64: (case name=option133 index=133) +// CHECK-64: (case name=option134 index=134) +// CHECK-64: (case name=option135 index=135) +// CHECK-64: (case name=option136 index=136) +// CHECK-64: (case name=option137 index=137) +// CHECK-64: (case name=option138 index=138) +// CHECK-64: (case name=option139 index=139) +// CHECK-64: (case name=option140 index=140) +// CHECK-64: (case name=option141 index=141) +// CHECK-64: (case name=option142 index=142) +// CHECK-64: (case name=option143 index=143) +// CHECK-64: (case name=option144 index=144) +// CHECK-64: (case name=option145 index=145) +// CHECK-64: (case name=option146 index=146) +// CHECK-64: (case name=option147 index=147) +// CHECK-64: (case name=option148 index=148) +// CHECK-64: (case name=option149 index=149) +// CHECK-64: (case name=option150 index=150) +// CHECK-64: (case name=option151 index=151) +// CHECK-64: (case name=option152 index=152) +// CHECK-64: (case name=option153 index=153) +// CHECK-64: (case name=option154 index=154) +// CHECK-64: (case name=option155 index=155) +// CHECK-64: (case name=option156 index=156) +// CHECK-64: (case name=option157 index=157) +// CHECK-64: (case name=option158 index=158) +// CHECK-64: (case name=option159 index=159) +// CHECK-64: (case name=option160 index=160) +// CHECK-64: (case name=option161 index=161) +// CHECK-64: (case name=option162 index=162) +// CHECK-64: (case name=option163 index=163) +// CHECK-64: (case name=option164 index=164) +// CHECK-64: (case name=option165 index=165) +// CHECK-64: (case name=option166 index=166) +// CHECK-64: (case name=option167 index=167) +// CHECK-64: (case name=option168 index=168) +// CHECK-64: (case name=option169 index=169) +// CHECK-64: (case name=option170 index=170) +// CHECK-64: (case name=option171 index=171) +// CHECK-64: (case name=option172 index=172) +// CHECK-64: (case name=option173 index=173) +// CHECK-64: (case name=option174 index=174) +// CHECK-64: (case name=option175 index=175) +// CHECK-64: (case name=option176 index=176) +// CHECK-64: (case name=option177 index=177) +// CHECK-64: (case name=option178 index=178) +// CHECK-64: (case name=option179 index=179) +// CHECK-64: (case name=option180 index=180) +// CHECK-64: (case name=option181 index=181) +// CHECK-64: (case name=option182 index=182) +// CHECK-64: (case name=option183 index=183) +// CHECK-64: (case name=option184 index=184) +// CHECK-64: (case name=option185 index=185) +// CHECK-64: (case name=option186 index=186) +// CHECK-64: (case name=option187 index=187) +// CHECK-64: (case name=option188 index=188) +// CHECK-64: (case name=option189 index=189) +// CHECK-64: (case name=option190 index=190) +// CHECK-64: (case name=option191 index=191) +// CHECK-64: (case name=option192 index=192) +// CHECK-64: (case name=option193 index=193) +// CHECK-64: (case name=option194 index=194) +// CHECK-64: (case name=option195 index=195) +// CHECK-64: (case name=option196 index=196) +// CHECK-64: (case name=option197 index=197) +// CHECK-64: (case name=option198 index=198) +// CHECK-64: (case name=option199 index=199) +// CHECK-64: (case name=option200 index=200) +// CHECK-64: (case name=option201 index=201) +// CHECK-64: (case name=option202 index=202) +// CHECK-64: (case name=option203 index=203) +// CHECK-64: (case name=option204 index=204) +// CHECK-64: (case name=option205 index=205) +// CHECK-64: (case name=option206 index=206) +// CHECK-64: (case name=option207 index=207) +// CHECK-64: (case name=option208 index=208) +// CHECK-64: (case name=option209 index=209) +// CHECK-64: (case name=option210 index=210) +// CHECK-64: (case name=option211 index=211) +// CHECK-64: (case name=option212 index=212) +// CHECK-64: (case name=option213 index=213) +// CHECK-64: (case name=option214 index=214) +// CHECK-64: (case name=option215 index=215) +// CHECK-64: (case name=option216 index=216) +// CHECK-64: (case name=option217 index=217) +// CHECK-64: (case name=option218 index=218) +// CHECK-64: (case name=option219 index=219) +// CHECK-64: (case name=option220 index=220) +// CHECK-64: (case name=option221 index=221) +// CHECK-64: (case name=option222 index=222) +// CHECK-64: (case name=option223 index=223) +// CHECK-64: (case name=option224 index=224) +// CHECK-64: (case name=option225 index=225) +// CHECK-64: (case name=option226 index=226) +// CHECK-64: (case name=option227 index=227) +// CHECK-64: (case name=option228 index=228) +// CHECK-64: (case name=option229 index=229) +// CHECK-64: (case name=option230 index=230) +// CHECK-64: (case name=option231 index=231) +// CHECK-64: (case name=option232 index=232) +// CHECK-64: (case name=option233 index=233) +// CHECK-64: (case name=option234 index=234) +// CHECK-64: (case name=option235 index=235) +// CHECK-64: (case name=option236 index=236) +// CHECK-64: (case name=option237 index=237) +// CHECK-64: (case name=option238 index=238) +// CHECK-64: (case name=option239 index=239) +// CHECK-64: (case name=option240 index=240) +// CHECK-64: (case name=option241 index=241) +// CHECK-64: (case name=option242 index=242) +// CHECK-64: (case name=option243 index=243) +// CHECK-64: (case name=option244 index=244) +// CHECK-64: (case name=option245 index=245) +// CHECK-64: (case name=option246 index=246) +// CHECK-64: (case name=option247 index=247) +// CHECK-64: (case name=option248 index=248) +// CHECK-64: (case name=option249 index=249) +// CHECK-64: (case name=option250 index=250) +// CHECK-64: (case name=option251 index=251) +// CHECK-64: (case name=option252 index=252) +// CHECK-64: (case name=option253 index=253))) // CHECK-64: (field name=e2 offset=17 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-64: (case name=option0 index=0) +// CHECK-64: (case name=option1 index=1) +// CHECK-64: (case name=option2 index=2) +// CHECK-64: (case name=option3 index=3) +// CHECK-64: (case name=option4 index=4) +// CHECK-64: (case name=option5 index=5) +// CHECK-64: (case name=option6 index=6) +// CHECK-64: (case name=option7 index=7) +// CHECK-64: (case name=option8 index=8) +// CHECK-64: (case name=option9 index=9) +// CHECK-64: (case name=option10 index=10) +// CHECK-64: (case name=option11 index=11) +// CHECK-64: (case name=option12 index=12) +// CHECK-64: (case name=option13 index=13) +// CHECK-64: (case name=option14 index=14) +// CHECK-64: (case name=option15 index=15) +// CHECK-64: (case name=option16 index=16) +// CHECK-64: (case name=option17 index=17) +// CHECK-64: (case name=option18 index=18) +// CHECK-64: (case name=option19 index=19) +// CHECK-64: (case name=option20 index=20) +// CHECK-64: (case name=option21 index=21) +// CHECK-64: (case name=option22 index=22) +// CHECK-64: (case name=option23 index=23) +// CHECK-64: (case name=option24 index=24) +// CHECK-64: (case name=option25 index=25) +// CHECK-64: (case name=option26 index=26) +// CHECK-64: (case name=option27 index=27) +// CHECK-64: (case name=option28 index=28) +// CHECK-64: (case name=option29 index=29) +// CHECK-64: (case name=option30 index=30) +// CHECK-64: (case name=option31 index=31) +// CHECK-64: (case name=option32 index=32) +// CHECK-64: (case name=option33 index=33) +// CHECK-64: (case name=option34 index=34) +// CHECK-64: (case name=option35 index=35) +// CHECK-64: (case name=option36 index=36) +// CHECK-64: (case name=option37 index=37) +// CHECK-64: (case name=option38 index=38) +// CHECK-64: (case name=option39 index=39) +// CHECK-64: (case name=option40 index=40) +// CHECK-64: (case name=option41 index=41) +// CHECK-64: (case name=option42 index=42) +// CHECK-64: (case name=option43 index=43) +// CHECK-64: (case name=option44 index=44) +// CHECK-64: (case name=option45 index=45) +// CHECK-64: (case name=option46 index=46) +// CHECK-64: (case name=option47 index=47) +// CHECK-64: (case name=option48 index=48) +// CHECK-64: (case name=option49 index=49) +// CHECK-64: (case name=option50 index=50) +// CHECK-64: (case name=option51 index=51) +// CHECK-64: (case name=option52 index=52) +// CHECK-64: (case name=option53 index=53) +// CHECK-64: (case name=option54 index=54) +// CHECK-64: (case name=option55 index=55) +// CHECK-64: (case name=option56 index=56) +// CHECK-64: (case name=option57 index=57) +// CHECK-64: (case name=option58 index=58) +// CHECK-64: (case name=option59 index=59) +// CHECK-64: (case name=option60 index=60) +// CHECK-64: (case name=option61 index=61) +// CHECK-64: (case name=option62 index=62) +// CHECK-64: (case name=option63 index=63) +// CHECK-64: (case name=option64 index=64) +// CHECK-64: (case name=option65 index=65) +// CHECK-64: (case name=option66 index=66) +// CHECK-64: (case name=option67 index=67) +// CHECK-64: (case name=option68 index=68) +// CHECK-64: (case name=option69 index=69) +// CHECK-64: (case name=option70 index=70) +// CHECK-64: (case name=option71 index=71) +// CHECK-64: (case name=option72 index=72) +// CHECK-64: (case name=option73 index=73) +// CHECK-64: (case name=option74 index=74) +// CHECK-64: (case name=option75 index=75) +// CHECK-64: (case name=option76 index=76) +// CHECK-64: (case name=option77 index=77) +// CHECK-64: (case name=option78 index=78) +// CHECK-64: (case name=option79 index=79) +// CHECK-64: (case name=option80 index=80) +// CHECK-64: (case name=option81 index=81) +// CHECK-64: (case name=option82 index=82) +// CHECK-64: (case name=option83 index=83) +// CHECK-64: (case name=option84 index=84) +// CHECK-64: (case name=option85 index=85) +// CHECK-64: (case name=option86 index=86) +// CHECK-64: (case name=option87 index=87) +// CHECK-64: (case name=option88 index=88) +// CHECK-64: (case name=option89 index=89) +// CHECK-64: (case name=option90 index=90) +// CHECK-64: (case name=option91 index=91) +// CHECK-64: (case name=option92 index=92) +// CHECK-64: (case name=option93 index=93) +// CHECK-64: (case name=option94 index=94) +// CHECK-64: (case name=option95 index=95) +// CHECK-64: (case name=option96 index=96) +// CHECK-64: (case name=option97 index=97) +// CHECK-64: (case name=option98 index=98) +// CHECK-64: (case name=option99 index=99) +// CHECK-64: (case name=option100 index=100) +// CHECK-64: (case name=option101 index=101) +// CHECK-64: (case name=option102 index=102) +// CHECK-64: (case name=option103 index=103) +// CHECK-64: (case name=option104 index=104) +// CHECK-64: (case name=option105 index=105) +// CHECK-64: (case name=option106 index=106) +// CHECK-64: (case name=option107 index=107) +// CHECK-64: (case name=option108 index=108) +// CHECK-64: (case name=option109 index=109) +// CHECK-64: (case name=option110 index=110) +// CHECK-64: (case name=option111 index=111) +// CHECK-64: (case name=option112 index=112) +// CHECK-64: (case name=option113 index=113) +// CHECK-64: (case name=option114 index=114) +// CHECK-64: (case name=option115 index=115) +// CHECK-64: (case name=option116 index=116) +// CHECK-64: (case name=option117 index=117) +// CHECK-64: (case name=option118 index=118) +// CHECK-64: (case name=option119 index=119) +// CHECK-64: (case name=option120 index=120) +// CHECK-64: (case name=option121 index=121) +// CHECK-64: (case name=option122 index=122) +// CHECK-64: (case name=option123 index=123) +// CHECK-64: (case name=option124 index=124) +// CHECK-64: (case name=option125 index=125) +// CHECK-64: (case name=option126 index=126) +// CHECK-64: (case name=option127 index=127) +// CHECK-64: (case name=option128 index=128) +// CHECK-64: (case name=option129 index=129) +// CHECK-64: (case name=option130 index=130) +// CHECK-64: (case name=option131 index=131) +// CHECK-64: (case name=option132 index=132) +// CHECK-64: (case name=option133 index=133) +// CHECK-64: (case name=option134 index=134) +// CHECK-64: (case name=option135 index=135) +// CHECK-64: (case name=option136 index=136) +// CHECK-64: (case name=option137 index=137) +// CHECK-64: (case name=option138 index=138) +// CHECK-64: (case name=option139 index=139) +// CHECK-64: (case name=option140 index=140) +// CHECK-64: (case name=option141 index=141) +// CHECK-64: (case name=option142 index=142) +// CHECK-64: (case name=option143 index=143) +// CHECK-64: (case name=option144 index=144) +// CHECK-64: (case name=option145 index=145) +// CHECK-64: (case name=option146 index=146) +// CHECK-64: (case name=option147 index=147) +// CHECK-64: (case name=option148 index=148) +// CHECK-64: (case name=option149 index=149) +// CHECK-64: (case name=option150 index=150) +// CHECK-64: (case name=option151 index=151) +// CHECK-64: (case name=option152 index=152) +// CHECK-64: (case name=option153 index=153) +// CHECK-64: (case name=option154 index=154) +// CHECK-64: (case name=option155 index=155) +// CHECK-64: (case name=option156 index=156) +// CHECK-64: (case name=option157 index=157) +// CHECK-64: (case name=option158 index=158) +// CHECK-64: (case name=option159 index=159) +// CHECK-64: (case name=option160 index=160) +// CHECK-64: (case name=option161 index=161) +// CHECK-64: (case name=option162 index=162) +// CHECK-64: (case name=option163 index=163) +// CHECK-64: (case name=option164 index=164) +// CHECK-64: (case name=option165 index=165) +// CHECK-64: (case name=option166 index=166) +// CHECK-64: (case name=option167 index=167) +// CHECK-64: (case name=option168 index=168) +// CHECK-64: (case name=option169 index=169) +// CHECK-64: (case name=option170 index=170) +// CHECK-64: (case name=option171 index=171) +// CHECK-64: (case name=option172 index=172) +// CHECK-64: (case name=option173 index=173) +// CHECK-64: (case name=option174 index=174) +// CHECK-64: (case name=option175 index=175) +// CHECK-64: (case name=option176 index=176) +// CHECK-64: (case name=option177 index=177) +// CHECK-64: (case name=option178 index=178) +// CHECK-64: (case name=option179 index=179) +// CHECK-64: (case name=option180 index=180) +// CHECK-64: (case name=option181 index=181) +// CHECK-64: (case name=option182 index=182) +// CHECK-64: (case name=option183 index=183) +// CHECK-64: (case name=option184 index=184) +// CHECK-64: (case name=option185 index=185) +// CHECK-64: (case name=option186 index=186) +// CHECK-64: (case name=option187 index=187) +// CHECK-64: (case name=option188 index=188) +// CHECK-64: (case name=option189 index=189) +// CHECK-64: (case name=option190 index=190) +// CHECK-64: (case name=option191 index=191) +// CHECK-64: (case name=option192 index=192) +// CHECK-64: (case name=option193 index=193) +// CHECK-64: (case name=option194 index=194) +// CHECK-64: (case name=option195 index=195) +// CHECK-64: (case name=option196 index=196) +// CHECK-64: (case name=option197 index=197) +// CHECK-64: (case name=option198 index=198) +// CHECK-64: (case name=option199 index=199) +// CHECK-64: (case name=option200 index=200) +// CHECK-64: (case name=option201 index=201) +// CHECK-64: (case name=option202 index=202) +// CHECK-64: (case name=option203 index=203) +// CHECK-64: (case name=option204 index=204) +// CHECK-64: (case name=option205 index=205) +// CHECK-64: (case name=option206 index=206) +// CHECK-64: (case name=option207 index=207) +// CHECK-64: (case name=option208 index=208) +// CHECK-64: (case name=option209 index=209) +// CHECK-64: (case name=option210 index=210) +// CHECK-64: (case name=option211 index=211) +// CHECK-64: (case name=option212 index=212) +// CHECK-64: (case name=option213 index=213) +// CHECK-64: (case name=option214 index=214) +// CHECK-64: (case name=option215 index=215) +// CHECK-64: (case name=option216 index=216) +// CHECK-64: (case name=option217 index=217) +// CHECK-64: (case name=option218 index=218) +// CHECK-64: (case name=option219 index=219) +// CHECK-64: (case name=option220 index=220) +// CHECK-64: (case name=option221 index=221) +// CHECK-64: (case name=option222 index=222) +// CHECK-64: (case name=option223 index=223) +// CHECK-64: (case name=option224 index=224) +// CHECK-64: (case name=option225 index=225) +// CHECK-64: (case name=option226 index=226) +// CHECK-64: (case name=option227 index=227) +// CHECK-64: (case name=option228 index=228) +// CHECK-64: (case name=option229 index=229) +// CHECK-64: (case name=option230 index=230) +// CHECK-64: (case name=option231 index=231) +// CHECK-64: (case name=option232 index=232) +// CHECK-64: (case name=option233 index=233) +// CHECK-64: (case name=option234 index=234) +// CHECK-64: (case name=option235 index=235) +// CHECK-64: (case name=option236 index=236) +// CHECK-64: (case name=option237 index=237) +// CHECK-64: (case name=option238 index=238) +// CHECK-64: (case name=option239 index=239) +// CHECK-64: (case name=option240 index=240) +// CHECK-64: (case name=option241 index=241) +// CHECK-64: (case name=option242 index=242) +// CHECK-64: (case name=option243 index=243) +// CHECK-64: (case name=option244 index=244) +// CHECK-64: (case name=option245 index=245) +// CHECK-64: (case name=option246 index=246) +// CHECK-64: (case name=option247 index=247) +// CHECK-64: (case name=option248 index=248) +// CHECK-64: (case name=option249 index=249) +// CHECK-64: (case name=option250 index=250) +// CHECK-64: (case name=option251 index=251) +// CHECK-64: (case name=option252 index=252) +// CHECK-64: (case name=option253 index=253))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e3 offset=18 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-64: (case name=option0 index=0) +// CHECK-64: (case name=option1 index=1) +// CHECK-64: (case name=option2 index=2) +// CHECK-64: (case name=option3 index=3) +// CHECK-64: (case name=option4 index=4) +// CHECK-64: (case name=option5 index=5) +// CHECK-64: (case name=option6 index=6) +// CHECK-64: (case name=option7 index=7) +// CHECK-64: (case name=option8 index=8) +// CHECK-64: (case name=option9 index=9) +// CHECK-64: (case name=option10 index=10) +// CHECK-64: (case name=option11 index=11) +// CHECK-64: (case name=option12 index=12) +// CHECK-64: (case name=option13 index=13) +// CHECK-64: (case name=option14 index=14) +// CHECK-64: (case name=option15 index=15) +// CHECK-64: (case name=option16 index=16) +// CHECK-64: (case name=option17 index=17) +// CHECK-64: (case name=option18 index=18) +// CHECK-64: (case name=option19 index=19) +// CHECK-64: (case name=option20 index=20) +// CHECK-64: (case name=option21 index=21) +// CHECK-64: (case name=option22 index=22) +// CHECK-64: (case name=option23 index=23) +// CHECK-64: (case name=option24 index=24) +// CHECK-64: (case name=option25 index=25) +// CHECK-64: (case name=option26 index=26) +// CHECK-64: (case name=option27 index=27) +// CHECK-64: (case name=option28 index=28) +// CHECK-64: (case name=option29 index=29) +// CHECK-64: (case name=option30 index=30) +// CHECK-64: (case name=option31 index=31) +// CHECK-64: (case name=option32 index=32) +// CHECK-64: (case name=option33 index=33) +// CHECK-64: (case name=option34 index=34) +// CHECK-64: (case name=option35 index=35) +// CHECK-64: (case name=option36 index=36) +// CHECK-64: (case name=option37 index=37) +// CHECK-64: (case name=option38 index=38) +// CHECK-64: (case name=option39 index=39) +// CHECK-64: (case name=option40 index=40) +// CHECK-64: (case name=option41 index=41) +// CHECK-64: (case name=option42 index=42) +// CHECK-64: (case name=option43 index=43) +// CHECK-64: (case name=option44 index=44) +// CHECK-64: (case name=option45 index=45) +// CHECK-64: (case name=option46 index=46) +// CHECK-64: (case name=option47 index=47) +// CHECK-64: (case name=option48 index=48) +// CHECK-64: (case name=option49 index=49) +// CHECK-64: (case name=option50 index=50) +// CHECK-64: (case name=option51 index=51) +// CHECK-64: (case name=option52 index=52) +// CHECK-64: (case name=option53 index=53) +// CHECK-64: (case name=option54 index=54) +// CHECK-64: (case name=option55 index=55) +// CHECK-64: (case name=option56 index=56) +// CHECK-64: (case name=option57 index=57) +// CHECK-64: (case name=option58 index=58) +// CHECK-64: (case name=option59 index=59) +// CHECK-64: (case name=option60 index=60) +// CHECK-64: (case name=option61 index=61) +// CHECK-64: (case name=option62 index=62) +// CHECK-64: (case name=option63 index=63) +// CHECK-64: (case name=option64 index=64) +// CHECK-64: (case name=option65 index=65) +// CHECK-64: (case name=option66 index=66) +// CHECK-64: (case name=option67 index=67) +// CHECK-64: (case name=option68 index=68) +// CHECK-64: (case name=option69 index=69) +// CHECK-64: (case name=option70 index=70) +// CHECK-64: (case name=option71 index=71) +// CHECK-64: (case name=option72 index=72) +// CHECK-64: (case name=option73 index=73) +// CHECK-64: (case name=option74 index=74) +// CHECK-64: (case name=option75 index=75) +// CHECK-64: (case name=option76 index=76) +// CHECK-64: (case name=option77 index=77) +// CHECK-64: (case name=option78 index=78) +// CHECK-64: (case name=option79 index=79) +// CHECK-64: (case name=option80 index=80) +// CHECK-64: (case name=option81 index=81) +// CHECK-64: (case name=option82 index=82) +// CHECK-64: (case name=option83 index=83) +// CHECK-64: (case name=option84 index=84) +// CHECK-64: (case name=option85 index=85) +// CHECK-64: (case name=option86 index=86) +// CHECK-64: (case name=option87 index=87) +// CHECK-64: (case name=option88 index=88) +// CHECK-64: (case name=option89 index=89) +// CHECK-64: (case name=option90 index=90) +// CHECK-64: (case name=option91 index=91) +// CHECK-64: (case name=option92 index=92) +// CHECK-64: (case name=option93 index=93) +// CHECK-64: (case name=option94 index=94) +// CHECK-64: (case name=option95 index=95) +// CHECK-64: (case name=option96 index=96) +// CHECK-64: (case name=option97 index=97) +// CHECK-64: (case name=option98 index=98) +// CHECK-64: (case name=option99 index=99) +// CHECK-64: (case name=option100 index=100) +// CHECK-64: (case name=option101 index=101) +// CHECK-64: (case name=option102 index=102) +// CHECK-64: (case name=option103 index=103) +// CHECK-64: (case name=option104 index=104) +// CHECK-64: (case name=option105 index=105) +// CHECK-64: (case name=option106 index=106) +// CHECK-64: (case name=option107 index=107) +// CHECK-64: (case name=option108 index=108) +// CHECK-64: (case name=option109 index=109) +// CHECK-64: (case name=option110 index=110) +// CHECK-64: (case name=option111 index=111) +// CHECK-64: (case name=option112 index=112) +// CHECK-64: (case name=option113 index=113) +// CHECK-64: (case name=option114 index=114) +// CHECK-64: (case name=option115 index=115) +// CHECK-64: (case name=option116 index=116) +// CHECK-64: (case name=option117 index=117) +// CHECK-64: (case name=option118 index=118) +// CHECK-64: (case name=option119 index=119) +// CHECK-64: (case name=option120 index=120) +// CHECK-64: (case name=option121 index=121) +// CHECK-64: (case name=option122 index=122) +// CHECK-64: (case name=option123 index=123) +// CHECK-64: (case name=option124 index=124) +// CHECK-64: (case name=option125 index=125) +// CHECK-64: (case name=option126 index=126) +// CHECK-64: (case name=option127 index=127) +// CHECK-64: (case name=option128 index=128) +// CHECK-64: (case name=option129 index=129) +// CHECK-64: (case name=option130 index=130) +// CHECK-64: (case name=option131 index=131) +// CHECK-64: (case name=option132 index=132) +// CHECK-64: (case name=option133 index=133) +// CHECK-64: (case name=option134 index=134) +// CHECK-64: (case name=option135 index=135) +// CHECK-64: (case name=option136 index=136) +// CHECK-64: (case name=option137 index=137) +// CHECK-64: (case name=option138 index=138) +// CHECK-64: (case name=option139 index=139) +// CHECK-64: (case name=option140 index=140) +// CHECK-64: (case name=option141 index=141) +// CHECK-64: (case name=option142 index=142) +// CHECK-64: (case name=option143 index=143) +// CHECK-64: (case name=option144 index=144) +// CHECK-64: (case name=option145 index=145) +// CHECK-64: (case name=option146 index=146) +// CHECK-64: (case name=option147 index=147) +// CHECK-64: (case name=option148 index=148) +// CHECK-64: (case name=option149 index=149) +// CHECK-64: (case name=option150 index=150) +// CHECK-64: (case name=option151 index=151) +// CHECK-64: (case name=option152 index=152) +// CHECK-64: (case name=option153 index=153) +// CHECK-64: (case name=option154 index=154) +// CHECK-64: (case name=option155 index=155) +// CHECK-64: (case name=option156 index=156) +// CHECK-64: (case name=option157 index=157) +// CHECK-64: (case name=option158 index=158) +// CHECK-64: (case name=option159 index=159) +// CHECK-64: (case name=option160 index=160) +// CHECK-64: (case name=option161 index=161) +// CHECK-64: (case name=option162 index=162) +// CHECK-64: (case name=option163 index=163) +// CHECK-64: (case name=option164 index=164) +// CHECK-64: (case name=option165 index=165) +// CHECK-64: (case name=option166 index=166) +// CHECK-64: (case name=option167 index=167) +// CHECK-64: (case name=option168 index=168) +// CHECK-64: (case name=option169 index=169) +// CHECK-64: (case name=option170 index=170) +// CHECK-64: (case name=option171 index=171) +// CHECK-64: (case name=option172 index=172) +// CHECK-64: (case name=option173 index=173) +// CHECK-64: (case name=option174 index=174) +// CHECK-64: (case name=option175 index=175) +// CHECK-64: (case name=option176 index=176) +// CHECK-64: (case name=option177 index=177) +// CHECK-64: (case name=option178 index=178) +// CHECK-64: (case name=option179 index=179) +// CHECK-64: (case name=option180 index=180) +// CHECK-64: (case name=option181 index=181) +// CHECK-64: (case name=option182 index=182) +// CHECK-64: (case name=option183 index=183) +// CHECK-64: (case name=option184 index=184) +// CHECK-64: (case name=option185 index=185) +// CHECK-64: (case name=option186 index=186) +// CHECK-64: (case name=option187 index=187) +// CHECK-64: (case name=option188 index=188) +// CHECK-64: (case name=option189 index=189) +// CHECK-64: (case name=option190 index=190) +// CHECK-64: (case name=option191 index=191) +// CHECK-64: (case name=option192 index=192) +// CHECK-64: (case name=option193 index=193) +// CHECK-64: (case name=option194 index=194) +// CHECK-64: (case name=option195 index=195) +// CHECK-64: (case name=option196 index=196) +// CHECK-64: (case name=option197 index=197) +// CHECK-64: (case name=option198 index=198) +// CHECK-64: (case name=option199 index=199) +// CHECK-64: (case name=option200 index=200) +// CHECK-64: (case name=option201 index=201) +// CHECK-64: (case name=option202 index=202) +// CHECK-64: (case name=option203 index=203) +// CHECK-64: (case name=option204 index=204) +// CHECK-64: (case name=option205 index=205) +// CHECK-64: (case name=option206 index=206) +// CHECK-64: (case name=option207 index=207) +// CHECK-64: (case name=option208 index=208) +// CHECK-64: (case name=option209 index=209) +// CHECK-64: (case name=option210 index=210) +// CHECK-64: (case name=option211 index=211) +// CHECK-64: (case name=option212 index=212) +// CHECK-64: (case name=option213 index=213) +// CHECK-64: (case name=option214 index=214) +// CHECK-64: (case name=option215 index=215) +// CHECK-64: (case name=option216 index=216) +// CHECK-64: (case name=option217 index=217) +// CHECK-64: (case name=option218 index=218) +// CHECK-64: (case name=option219 index=219) +// CHECK-64: (case name=option220 index=220) +// CHECK-64: (case name=option221 index=221) +// CHECK-64: (case name=option222 index=222) +// CHECK-64: (case name=option223 index=223) +// CHECK-64: (case name=option224 index=224) +// CHECK-64: (case name=option225 index=225) +// CHECK-64: (case name=option226 index=226) +// CHECK-64: (case name=option227 index=227) +// CHECK-64: (case name=option228 index=228) +// CHECK-64: (case name=option229 index=229) +// CHECK-64: (case name=option230 index=230) +// CHECK-64: (case name=option231 index=231) +// CHECK-64: (case name=option232 index=232) +// CHECK-64: (case name=option233 index=233) +// CHECK-64: (case name=option234 index=234) +// CHECK-64: (case name=option235 index=235) +// CHECK-64: (case name=option236 index=236) +// CHECK-64: (case name=option237 index=237) +// CHECK-64: (case name=option238 index=238) +// CHECK-64: (case name=option239 index=239) +// CHECK-64: (case name=option240 index=240) +// CHECK-64: (case name=option241 index=241) +// CHECK-64: (case name=option242 index=242) +// CHECK-64: (case name=option243 index=243) +// CHECK-64: (case name=option244 index=244) +// CHECK-64: (case name=option245 index=245) +// CHECK-64: (case name=option246 index=246) +// CHECK-64: (case name=option247 index=247) +// CHECK-64: (case name=option248 index=248) +// CHECK-64: (case name=option249 index=249) +// CHECK-64: (case name=option250 index=250) +// CHECK-64: (case name=option251 index=251) +// CHECK-64: (case name=option252 index=252) +// CHECK-64: (case name=option253 index=253))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e4 offset=19 // CHECK-64: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)))))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-64: (case name=option0 index=0) +// CHECK-64: (case name=option1 index=1) +// CHECK-64: (case name=option2 index=2) +// CHECK-64: (case name=option3 index=3) +// CHECK-64: (case name=option4 index=4) +// CHECK-64: (case name=option5 index=5) +// CHECK-64: (case name=option6 index=6) +// CHECK-64: (case name=option7 index=7) +// CHECK-64: (case name=option8 index=8) +// CHECK-64: (case name=option9 index=9) +// CHECK-64: (case name=option10 index=10) +// CHECK-64: (case name=option11 index=11) +// CHECK-64: (case name=option12 index=12) +// CHECK-64: (case name=option13 index=13) +// CHECK-64: (case name=option14 index=14) +// CHECK-64: (case name=option15 index=15) +// CHECK-64: (case name=option16 index=16) +// CHECK-64: (case name=option17 index=17) +// CHECK-64: (case name=option18 index=18) +// CHECK-64: (case name=option19 index=19) +// CHECK-64: (case name=option20 index=20) +// CHECK-64: (case name=option21 index=21) +// CHECK-64: (case name=option22 index=22) +// CHECK-64: (case name=option23 index=23) +// CHECK-64: (case name=option24 index=24) +// CHECK-64: (case name=option25 index=25) +// CHECK-64: (case name=option26 index=26) +// CHECK-64: (case name=option27 index=27) +// CHECK-64: (case name=option28 index=28) +// CHECK-64: (case name=option29 index=29) +// CHECK-64: (case name=option30 index=30) +// CHECK-64: (case name=option31 index=31) +// CHECK-64: (case name=option32 index=32) +// CHECK-64: (case name=option33 index=33) +// CHECK-64: (case name=option34 index=34) +// CHECK-64: (case name=option35 index=35) +// CHECK-64: (case name=option36 index=36) +// CHECK-64: (case name=option37 index=37) +// CHECK-64: (case name=option38 index=38) +// CHECK-64: (case name=option39 index=39) +// CHECK-64: (case name=option40 index=40) +// CHECK-64: (case name=option41 index=41) +// CHECK-64: (case name=option42 index=42) +// CHECK-64: (case name=option43 index=43) +// CHECK-64: (case name=option44 index=44) +// CHECK-64: (case name=option45 index=45) +// CHECK-64: (case name=option46 index=46) +// CHECK-64: (case name=option47 index=47) +// CHECK-64: (case name=option48 index=48) +// CHECK-64: (case name=option49 index=49) +// CHECK-64: (case name=option50 index=50) +// CHECK-64: (case name=option51 index=51) +// CHECK-64: (case name=option52 index=52) +// CHECK-64: (case name=option53 index=53) +// CHECK-64: (case name=option54 index=54) +// CHECK-64: (case name=option55 index=55) +// CHECK-64: (case name=option56 index=56) +// CHECK-64: (case name=option57 index=57) +// CHECK-64: (case name=option58 index=58) +// CHECK-64: (case name=option59 index=59) +// CHECK-64: (case name=option60 index=60) +// CHECK-64: (case name=option61 index=61) +// CHECK-64: (case name=option62 index=62) +// CHECK-64: (case name=option63 index=63) +// CHECK-64: (case name=option64 index=64) +// CHECK-64: (case name=option65 index=65) +// CHECK-64: (case name=option66 index=66) +// CHECK-64: (case name=option67 index=67) +// CHECK-64: (case name=option68 index=68) +// CHECK-64: (case name=option69 index=69) +// CHECK-64: (case name=option70 index=70) +// CHECK-64: (case name=option71 index=71) +// CHECK-64: (case name=option72 index=72) +// CHECK-64: (case name=option73 index=73) +// CHECK-64: (case name=option74 index=74) +// CHECK-64: (case name=option75 index=75) +// CHECK-64: (case name=option76 index=76) +// CHECK-64: (case name=option77 index=77) +// CHECK-64: (case name=option78 index=78) +// CHECK-64: (case name=option79 index=79) +// CHECK-64: (case name=option80 index=80) +// CHECK-64: (case name=option81 index=81) +// CHECK-64: (case name=option82 index=82) +// CHECK-64: (case name=option83 index=83) +// CHECK-64: (case name=option84 index=84) +// CHECK-64: (case name=option85 index=85) +// CHECK-64: (case name=option86 index=86) +// CHECK-64: (case name=option87 index=87) +// CHECK-64: (case name=option88 index=88) +// CHECK-64: (case name=option89 index=89) +// CHECK-64: (case name=option90 index=90) +// CHECK-64: (case name=option91 index=91) +// CHECK-64: (case name=option92 index=92) +// CHECK-64: (case name=option93 index=93) +// CHECK-64: (case name=option94 index=94) +// CHECK-64: (case name=option95 index=95) +// CHECK-64: (case name=option96 index=96) +// CHECK-64: (case name=option97 index=97) +// CHECK-64: (case name=option98 index=98) +// CHECK-64: (case name=option99 index=99) +// CHECK-64: (case name=option100 index=100) +// CHECK-64: (case name=option101 index=101) +// CHECK-64: (case name=option102 index=102) +// CHECK-64: (case name=option103 index=103) +// CHECK-64: (case name=option104 index=104) +// CHECK-64: (case name=option105 index=105) +// CHECK-64: (case name=option106 index=106) +// CHECK-64: (case name=option107 index=107) +// CHECK-64: (case name=option108 index=108) +// CHECK-64: (case name=option109 index=109) +// CHECK-64: (case name=option110 index=110) +// CHECK-64: (case name=option111 index=111) +// CHECK-64: (case name=option112 index=112) +// CHECK-64: (case name=option113 index=113) +// CHECK-64: (case name=option114 index=114) +// CHECK-64: (case name=option115 index=115) +// CHECK-64: (case name=option116 index=116) +// CHECK-64: (case name=option117 index=117) +// CHECK-64: (case name=option118 index=118) +// CHECK-64: (case name=option119 index=119) +// CHECK-64: (case name=option120 index=120) +// CHECK-64: (case name=option121 index=121) +// CHECK-64: (case name=option122 index=122) +// CHECK-64: (case name=option123 index=123) +// CHECK-64: (case name=option124 index=124) +// CHECK-64: (case name=option125 index=125) +// CHECK-64: (case name=option126 index=126) +// CHECK-64: (case name=option127 index=127) +// CHECK-64: (case name=option128 index=128) +// CHECK-64: (case name=option129 index=129) +// CHECK-64: (case name=option130 index=130) +// CHECK-64: (case name=option131 index=131) +// CHECK-64: (case name=option132 index=132) +// CHECK-64: (case name=option133 index=133) +// CHECK-64: (case name=option134 index=134) +// CHECK-64: (case name=option135 index=135) +// CHECK-64: (case name=option136 index=136) +// CHECK-64: (case name=option137 index=137) +// CHECK-64: (case name=option138 index=138) +// CHECK-64: (case name=option139 index=139) +// CHECK-64: (case name=option140 index=140) +// CHECK-64: (case name=option141 index=141) +// CHECK-64: (case name=option142 index=142) +// CHECK-64: (case name=option143 index=143) +// CHECK-64: (case name=option144 index=144) +// CHECK-64: (case name=option145 index=145) +// CHECK-64: (case name=option146 index=146) +// CHECK-64: (case name=option147 index=147) +// CHECK-64: (case name=option148 index=148) +// CHECK-64: (case name=option149 index=149) +// CHECK-64: (case name=option150 index=150) +// CHECK-64: (case name=option151 index=151) +// CHECK-64: (case name=option152 index=152) +// CHECK-64: (case name=option153 index=153) +// CHECK-64: (case name=option154 index=154) +// CHECK-64: (case name=option155 index=155) +// CHECK-64: (case name=option156 index=156) +// CHECK-64: (case name=option157 index=157) +// CHECK-64: (case name=option158 index=158) +// CHECK-64: (case name=option159 index=159) +// CHECK-64: (case name=option160 index=160) +// CHECK-64: (case name=option161 index=161) +// CHECK-64: (case name=option162 index=162) +// CHECK-64: (case name=option163 index=163) +// CHECK-64: (case name=option164 index=164) +// CHECK-64: (case name=option165 index=165) +// CHECK-64: (case name=option166 index=166) +// CHECK-64: (case name=option167 index=167) +// CHECK-64: (case name=option168 index=168) +// CHECK-64: (case name=option169 index=169) +// CHECK-64: (case name=option170 index=170) +// CHECK-64: (case name=option171 index=171) +// CHECK-64: (case name=option172 index=172) +// CHECK-64: (case name=option173 index=173) +// CHECK-64: (case name=option174 index=174) +// CHECK-64: (case name=option175 index=175) +// CHECK-64: (case name=option176 index=176) +// CHECK-64: (case name=option177 index=177) +// CHECK-64: (case name=option178 index=178) +// CHECK-64: (case name=option179 index=179) +// CHECK-64: (case name=option180 index=180) +// CHECK-64: (case name=option181 index=181) +// CHECK-64: (case name=option182 index=182) +// CHECK-64: (case name=option183 index=183) +// CHECK-64: (case name=option184 index=184) +// CHECK-64: (case name=option185 index=185) +// CHECK-64: (case name=option186 index=186) +// CHECK-64: (case name=option187 index=187) +// CHECK-64: (case name=option188 index=188) +// CHECK-64: (case name=option189 index=189) +// CHECK-64: (case name=option190 index=190) +// CHECK-64: (case name=option191 index=191) +// CHECK-64: (case name=option192 index=192) +// CHECK-64: (case name=option193 index=193) +// CHECK-64: (case name=option194 index=194) +// CHECK-64: (case name=option195 index=195) +// CHECK-64: (case name=option196 index=196) +// CHECK-64: (case name=option197 index=197) +// CHECK-64: (case name=option198 index=198) +// CHECK-64: (case name=option199 index=199) +// CHECK-64: (case name=option200 index=200) +// CHECK-64: (case name=option201 index=201) +// CHECK-64: (case name=option202 index=202) +// CHECK-64: (case name=option203 index=203) +// CHECK-64: (case name=option204 index=204) +// CHECK-64: (case name=option205 index=205) +// CHECK-64: (case name=option206 index=206) +// CHECK-64: (case name=option207 index=207) +// CHECK-64: (case name=option208 index=208) +// CHECK-64: (case name=option209 index=209) +// CHECK-64: (case name=option210 index=210) +// CHECK-64: (case name=option211 index=211) +// CHECK-64: (case name=option212 index=212) +// CHECK-64: (case name=option213 index=213) +// CHECK-64: (case name=option214 index=214) +// CHECK-64: (case name=option215 index=215) +// CHECK-64: (case name=option216 index=216) +// CHECK-64: (case name=option217 index=217) +// CHECK-64: (case name=option218 index=218) +// CHECK-64: (case name=option219 index=219) +// CHECK-64: (case name=option220 index=220) +// CHECK-64: (case name=option221 index=221) +// CHECK-64: (case name=option222 index=222) +// CHECK-64: (case name=option223 index=223) +// CHECK-64: (case name=option224 index=224) +// CHECK-64: (case name=option225 index=225) +// CHECK-64: (case name=option226 index=226) +// CHECK-64: (case name=option227 index=227) +// CHECK-64: (case name=option228 index=228) +// CHECK-64: (case name=option229 index=229) +// CHECK-64: (case name=option230 index=230) +// CHECK-64: (case name=option231 index=231) +// CHECK-64: (case name=option232 index=232) +// CHECK-64: (case name=option233 index=233) +// CHECK-64: (case name=option234 index=234) +// CHECK-64: (case name=option235 index=235) +// CHECK-64: (case name=option236 index=236) +// CHECK-64: (case name=option237 index=237) +// CHECK-64: (case name=option238 index=238) +// CHECK-64: (case name=option239 index=239) +// CHECK-64: (case name=option240 index=240) +// CHECK-64: (case name=option241 index=241) +// CHECK-64: (case name=option242 index=242) +// CHECK-64: (case name=option243 index=243) +// CHECK-64: (case name=option244 index=244) +// CHECK-64: (case name=option245 index=245) +// CHECK-64: (case name=option246 index=246) +// CHECK-64: (case name=option247 index=247) +// CHECK-64: (case name=option248 index=248) +// CHECK-64: (case name=option249 index=249) +// CHECK-64: (case name=option250 index=250) +// CHECK-64: (case name=option251 index=251) +// CHECK-64: (case name=option252 index=252) +// CHECK-64: (case name=option253 index=253))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e5 offset=21 // CHECK-64: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1))))))))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-64: (case name=option0 index=0) +// CHECK-64: (case name=option1 index=1) +// CHECK-64: (case name=option2 index=2) +// CHECK-64: (case name=option3 index=3) +// CHECK-64: (case name=option4 index=4) +// CHECK-64: (case name=option5 index=5) +// CHECK-64: (case name=option6 index=6) +// CHECK-64: (case name=option7 index=7) +// CHECK-64: (case name=option8 index=8) +// CHECK-64: (case name=option9 index=9) +// CHECK-64: (case name=option10 index=10) +// CHECK-64: (case name=option11 index=11) +// CHECK-64: (case name=option12 index=12) +// CHECK-64: (case name=option13 index=13) +// CHECK-64: (case name=option14 index=14) +// CHECK-64: (case name=option15 index=15) +// CHECK-64: (case name=option16 index=16) +// CHECK-64: (case name=option17 index=17) +// CHECK-64: (case name=option18 index=18) +// CHECK-64: (case name=option19 index=19) +// CHECK-64: (case name=option20 index=20) +// CHECK-64: (case name=option21 index=21) +// CHECK-64: (case name=option22 index=22) +// CHECK-64: (case name=option23 index=23) +// CHECK-64: (case name=option24 index=24) +// CHECK-64: (case name=option25 index=25) +// CHECK-64: (case name=option26 index=26) +// CHECK-64: (case name=option27 index=27) +// CHECK-64: (case name=option28 index=28) +// CHECK-64: (case name=option29 index=29) +// CHECK-64: (case name=option30 index=30) +// CHECK-64: (case name=option31 index=31) +// CHECK-64: (case name=option32 index=32) +// CHECK-64: (case name=option33 index=33) +// CHECK-64: (case name=option34 index=34) +// CHECK-64: (case name=option35 index=35) +// CHECK-64: (case name=option36 index=36) +// CHECK-64: (case name=option37 index=37) +// CHECK-64: (case name=option38 index=38) +// CHECK-64: (case name=option39 index=39) +// CHECK-64: (case name=option40 index=40) +// CHECK-64: (case name=option41 index=41) +// CHECK-64: (case name=option42 index=42) +// CHECK-64: (case name=option43 index=43) +// CHECK-64: (case name=option44 index=44) +// CHECK-64: (case name=option45 index=45) +// CHECK-64: (case name=option46 index=46) +// CHECK-64: (case name=option47 index=47) +// CHECK-64: (case name=option48 index=48) +// CHECK-64: (case name=option49 index=49) +// CHECK-64: (case name=option50 index=50) +// CHECK-64: (case name=option51 index=51) +// CHECK-64: (case name=option52 index=52) +// CHECK-64: (case name=option53 index=53) +// CHECK-64: (case name=option54 index=54) +// CHECK-64: (case name=option55 index=55) +// CHECK-64: (case name=option56 index=56) +// CHECK-64: (case name=option57 index=57) +// CHECK-64: (case name=option58 index=58) +// CHECK-64: (case name=option59 index=59) +// CHECK-64: (case name=option60 index=60) +// CHECK-64: (case name=option61 index=61) +// CHECK-64: (case name=option62 index=62) +// CHECK-64: (case name=option63 index=63) +// CHECK-64: (case name=option64 index=64) +// CHECK-64: (case name=option65 index=65) +// CHECK-64: (case name=option66 index=66) +// CHECK-64: (case name=option67 index=67) +// CHECK-64: (case name=option68 index=68) +// CHECK-64: (case name=option69 index=69) +// CHECK-64: (case name=option70 index=70) +// CHECK-64: (case name=option71 index=71) +// CHECK-64: (case name=option72 index=72) +// CHECK-64: (case name=option73 index=73) +// CHECK-64: (case name=option74 index=74) +// CHECK-64: (case name=option75 index=75) +// CHECK-64: (case name=option76 index=76) +// CHECK-64: (case name=option77 index=77) +// CHECK-64: (case name=option78 index=78) +// CHECK-64: (case name=option79 index=79) +// CHECK-64: (case name=option80 index=80) +// CHECK-64: (case name=option81 index=81) +// CHECK-64: (case name=option82 index=82) +// CHECK-64: (case name=option83 index=83) +// CHECK-64: (case name=option84 index=84) +// CHECK-64: (case name=option85 index=85) +// CHECK-64: (case name=option86 index=86) +// CHECK-64: (case name=option87 index=87) +// CHECK-64: (case name=option88 index=88) +// CHECK-64: (case name=option89 index=89) +// CHECK-64: (case name=option90 index=90) +// CHECK-64: (case name=option91 index=91) +// CHECK-64: (case name=option92 index=92) +// CHECK-64: (case name=option93 index=93) +// CHECK-64: (case name=option94 index=94) +// CHECK-64: (case name=option95 index=95) +// CHECK-64: (case name=option96 index=96) +// CHECK-64: (case name=option97 index=97) +// CHECK-64: (case name=option98 index=98) +// CHECK-64: (case name=option99 index=99) +// CHECK-64: (case name=option100 index=100) +// CHECK-64: (case name=option101 index=101) +// CHECK-64: (case name=option102 index=102) +// CHECK-64: (case name=option103 index=103) +// CHECK-64: (case name=option104 index=104) +// CHECK-64: (case name=option105 index=105) +// CHECK-64: (case name=option106 index=106) +// CHECK-64: (case name=option107 index=107) +// CHECK-64: (case name=option108 index=108) +// CHECK-64: (case name=option109 index=109) +// CHECK-64: (case name=option110 index=110) +// CHECK-64: (case name=option111 index=111) +// CHECK-64: (case name=option112 index=112) +// CHECK-64: (case name=option113 index=113) +// CHECK-64: (case name=option114 index=114) +// CHECK-64: (case name=option115 index=115) +// CHECK-64: (case name=option116 index=116) +// CHECK-64: (case name=option117 index=117) +// CHECK-64: (case name=option118 index=118) +// CHECK-64: (case name=option119 index=119) +// CHECK-64: (case name=option120 index=120) +// CHECK-64: (case name=option121 index=121) +// CHECK-64: (case name=option122 index=122) +// CHECK-64: (case name=option123 index=123) +// CHECK-64: (case name=option124 index=124) +// CHECK-64: (case name=option125 index=125) +// CHECK-64: (case name=option126 index=126) +// CHECK-64: (case name=option127 index=127) +// CHECK-64: (case name=option128 index=128) +// CHECK-64: (case name=option129 index=129) +// CHECK-64: (case name=option130 index=130) +// CHECK-64: (case name=option131 index=131) +// CHECK-64: (case name=option132 index=132) +// CHECK-64: (case name=option133 index=133) +// CHECK-64: (case name=option134 index=134) +// CHECK-64: (case name=option135 index=135) +// CHECK-64: (case name=option136 index=136) +// CHECK-64: (case name=option137 index=137) +// CHECK-64: (case name=option138 index=138) +// CHECK-64: (case name=option139 index=139) +// CHECK-64: (case name=option140 index=140) +// CHECK-64: (case name=option141 index=141) +// CHECK-64: (case name=option142 index=142) +// CHECK-64: (case name=option143 index=143) +// CHECK-64: (case name=option144 index=144) +// CHECK-64: (case name=option145 index=145) +// CHECK-64: (case name=option146 index=146) +// CHECK-64: (case name=option147 index=147) +// CHECK-64: (case name=option148 index=148) +// CHECK-64: (case name=option149 index=149) +// CHECK-64: (case name=option150 index=150) +// CHECK-64: (case name=option151 index=151) +// CHECK-64: (case name=option152 index=152) +// CHECK-64: (case name=option153 index=153) +// CHECK-64: (case name=option154 index=154) +// CHECK-64: (case name=option155 index=155) +// CHECK-64: (case name=option156 index=156) +// CHECK-64: (case name=option157 index=157) +// CHECK-64: (case name=option158 index=158) +// CHECK-64: (case name=option159 index=159) +// CHECK-64: (case name=option160 index=160) +// CHECK-64: (case name=option161 index=161) +// CHECK-64: (case name=option162 index=162) +// CHECK-64: (case name=option163 index=163) +// CHECK-64: (case name=option164 index=164) +// CHECK-64: (case name=option165 index=165) +// CHECK-64: (case name=option166 index=166) +// CHECK-64: (case name=option167 index=167) +// CHECK-64: (case name=option168 index=168) +// CHECK-64: (case name=option169 index=169) +// CHECK-64: (case name=option170 index=170) +// CHECK-64: (case name=option171 index=171) +// CHECK-64: (case name=option172 index=172) +// CHECK-64: (case name=option173 index=173) +// CHECK-64: (case name=option174 index=174) +// CHECK-64: (case name=option175 index=175) +// CHECK-64: (case name=option176 index=176) +// CHECK-64: (case name=option177 index=177) +// CHECK-64: (case name=option178 index=178) +// CHECK-64: (case name=option179 index=179) +// CHECK-64: (case name=option180 index=180) +// CHECK-64: (case name=option181 index=181) +// CHECK-64: (case name=option182 index=182) +// CHECK-64: (case name=option183 index=183) +// CHECK-64: (case name=option184 index=184) +// CHECK-64: (case name=option185 index=185) +// CHECK-64: (case name=option186 index=186) +// CHECK-64: (case name=option187 index=187) +// CHECK-64: (case name=option188 index=188) +// CHECK-64: (case name=option189 index=189) +// CHECK-64: (case name=option190 index=190) +// CHECK-64: (case name=option191 index=191) +// CHECK-64: (case name=option192 index=192) +// CHECK-64: (case name=option193 index=193) +// CHECK-64: (case name=option194 index=194) +// CHECK-64: (case name=option195 index=195) +// CHECK-64: (case name=option196 index=196) +// CHECK-64: (case name=option197 index=197) +// CHECK-64: (case name=option198 index=198) +// CHECK-64: (case name=option199 index=199) +// CHECK-64: (case name=option200 index=200) +// CHECK-64: (case name=option201 index=201) +// CHECK-64: (case name=option202 index=202) +// CHECK-64: (case name=option203 index=203) +// CHECK-64: (case name=option204 index=204) +// CHECK-64: (case name=option205 index=205) +// CHECK-64: (case name=option206 index=206) +// CHECK-64: (case name=option207 index=207) +// CHECK-64: (case name=option208 index=208) +// CHECK-64: (case name=option209 index=209) +// CHECK-64: (case name=option210 index=210) +// CHECK-64: (case name=option211 index=211) +// CHECK-64: (case name=option212 index=212) +// CHECK-64: (case name=option213 index=213) +// CHECK-64: (case name=option214 index=214) +// CHECK-64: (case name=option215 index=215) +// CHECK-64: (case name=option216 index=216) +// CHECK-64: (case name=option217 index=217) +// CHECK-64: (case name=option218 index=218) +// CHECK-64: (case name=option219 index=219) +// CHECK-64: (case name=option220 index=220) +// CHECK-64: (case name=option221 index=221) +// CHECK-64: (case name=option222 index=222) +// CHECK-64: (case name=option223 index=223) +// CHECK-64: (case name=option224 index=224) +// CHECK-64: (case name=option225 index=225) +// CHECK-64: (case name=option226 index=226) +// CHECK-64: (case name=option227 index=227) +// CHECK-64: (case name=option228 index=228) +// CHECK-64: (case name=option229 index=229) +// CHECK-64: (case name=option230 index=230) +// CHECK-64: (case name=option231 index=231) +// CHECK-64: (case name=option232 index=232) +// CHECK-64: (case name=option233 index=233) +// CHECK-64: (case name=option234 index=234) +// CHECK-64: (case name=option235 index=235) +// CHECK-64: (case name=option236 index=236) +// CHECK-64: (case name=option237 index=237) +// CHECK-64: (case name=option238 index=238) +// CHECK-64: (case name=option239 index=239) +// CHECK-64: (case name=option240 index=240) +// CHECK-64: (case name=option241 index=241) +// CHECK-64: (case name=option242 index=242) +// CHECK-64: (case name=option243 index=243) +// CHECK-64: (case name=option244 index=244) +// CHECK-64: (case name=option245 index=245) +// CHECK-64: (case name=option246 index=246) +// CHECK-64: (case name=option247 index=247) +// CHECK-64: (case name=option248 index=248) +// CHECK-64: (case name=option249 index=249) +// CHECK-64: (case name=option250 index=250) +// CHECK-64: (case name=option251 index=251) +// CHECK-64: (case name=option252 index=252) +// CHECK-64: (case name=option253 index=253))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1)))) // CHECK-32: Reflecting an object. // CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} @@ -328,35 +1608,1315 @@ reflect(object: ClassWith254CaseEnum()) // CHECK-32: Type info: // CHECK-32: (class_instance size=16 alignment=1 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=e1 offset=8 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)) +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-32: (case name=option0 index=0) +// CHECK-32: (case name=option1 index=1) +// CHECK-32: (case name=option2 index=2) +// CHECK-32: (case name=option3 index=3) +// CHECK-32: (case name=option4 index=4) +// CHECK-32: (case name=option5 index=5) +// CHECK-32: (case name=option6 index=6) +// CHECK-32: (case name=option7 index=7) +// CHECK-32: (case name=option8 index=8) +// CHECK-32: (case name=option9 index=9) +// CHECK-32: (case name=option10 index=10) +// CHECK-32: (case name=option11 index=11) +// CHECK-32: (case name=option12 index=12) +// CHECK-32: (case name=option13 index=13) +// CHECK-32: (case name=option14 index=14) +// CHECK-32: (case name=option15 index=15) +// CHECK-32: (case name=option16 index=16) +// CHECK-32: (case name=option17 index=17) +// CHECK-32: (case name=option18 index=18) +// CHECK-32: (case name=option19 index=19) +// CHECK-32: (case name=option20 index=20) +// CHECK-32: (case name=option21 index=21) +// CHECK-32: (case name=option22 index=22) +// CHECK-32: (case name=option23 index=23) +// CHECK-32: (case name=option24 index=24) +// CHECK-32: (case name=option25 index=25) +// CHECK-32: (case name=option26 index=26) +// CHECK-32: (case name=option27 index=27) +// CHECK-32: (case name=option28 index=28) +// CHECK-32: (case name=option29 index=29) +// CHECK-32: (case name=option30 index=30) +// CHECK-32: (case name=option31 index=31) +// CHECK-32: (case name=option32 index=32) +// CHECK-32: (case name=option33 index=33) +// CHECK-32: (case name=option34 index=34) +// CHECK-32: (case name=option35 index=35) +// CHECK-32: (case name=option36 index=36) +// CHECK-32: (case name=option37 index=37) +// CHECK-32: (case name=option38 index=38) +// CHECK-32: (case name=option39 index=39) +// CHECK-32: (case name=option40 index=40) +// CHECK-32: (case name=option41 index=41) +// CHECK-32: (case name=option42 index=42) +// CHECK-32: (case name=option43 index=43) +// CHECK-32: (case name=option44 index=44) +// CHECK-32: (case name=option45 index=45) +// CHECK-32: (case name=option46 index=46) +// CHECK-32: (case name=option47 index=47) +// CHECK-32: (case name=option48 index=48) +// CHECK-32: (case name=option49 index=49) +// CHECK-32: (case name=option50 index=50) +// CHECK-32: (case name=option51 index=51) +// CHECK-32: (case name=option52 index=52) +// CHECK-32: (case name=option53 index=53) +// CHECK-32: (case name=option54 index=54) +// CHECK-32: (case name=option55 index=55) +// CHECK-32: (case name=option56 index=56) +// CHECK-32: (case name=option57 index=57) +// CHECK-32: (case name=option58 index=58) +// CHECK-32: (case name=option59 index=59) +// CHECK-32: (case name=option60 index=60) +// CHECK-32: (case name=option61 index=61) +// CHECK-32: (case name=option62 index=62) +// CHECK-32: (case name=option63 index=63) +// CHECK-32: (case name=option64 index=64) +// CHECK-32: (case name=option65 index=65) +// CHECK-32: (case name=option66 index=66) +// CHECK-32: (case name=option67 index=67) +// CHECK-32: (case name=option68 index=68) +// CHECK-32: (case name=option69 index=69) +// CHECK-32: (case name=option70 index=70) +// CHECK-32: (case name=option71 index=71) +// CHECK-32: (case name=option72 index=72) +// CHECK-32: (case name=option73 index=73) +// CHECK-32: (case name=option74 index=74) +// CHECK-32: (case name=option75 index=75) +// CHECK-32: (case name=option76 index=76) +// CHECK-32: (case name=option77 index=77) +// CHECK-32: (case name=option78 index=78) +// CHECK-32: (case name=option79 index=79) +// CHECK-32: (case name=option80 index=80) +// CHECK-32: (case name=option81 index=81) +// CHECK-32: (case name=option82 index=82) +// CHECK-32: (case name=option83 index=83) +// CHECK-32: (case name=option84 index=84) +// CHECK-32: (case name=option85 index=85) +// CHECK-32: (case name=option86 index=86) +// CHECK-32: (case name=option87 index=87) +// CHECK-32: (case name=option88 index=88) +// CHECK-32: (case name=option89 index=89) +// CHECK-32: (case name=option90 index=90) +// CHECK-32: (case name=option91 index=91) +// CHECK-32: (case name=option92 index=92) +// CHECK-32: (case name=option93 index=93) +// CHECK-32: (case name=option94 index=94) +// CHECK-32: (case name=option95 index=95) +// CHECK-32: (case name=option96 index=96) +// CHECK-32: (case name=option97 index=97) +// CHECK-32: (case name=option98 index=98) +// CHECK-32: (case name=option99 index=99) +// CHECK-32: (case name=option100 index=100) +// CHECK-32: (case name=option101 index=101) +// CHECK-32: (case name=option102 index=102) +// CHECK-32: (case name=option103 index=103) +// CHECK-32: (case name=option104 index=104) +// CHECK-32: (case name=option105 index=105) +// CHECK-32: (case name=option106 index=106) +// CHECK-32: (case name=option107 index=107) +// CHECK-32: (case name=option108 index=108) +// CHECK-32: (case name=option109 index=109) +// CHECK-32: (case name=option110 index=110) +// CHECK-32: (case name=option111 index=111) +// CHECK-32: (case name=option112 index=112) +// CHECK-32: (case name=option113 index=113) +// CHECK-32: (case name=option114 index=114) +// CHECK-32: (case name=option115 index=115) +// CHECK-32: (case name=option116 index=116) +// CHECK-32: (case name=option117 index=117) +// CHECK-32: (case name=option118 index=118) +// CHECK-32: (case name=option119 index=119) +// CHECK-32: (case name=option120 index=120) +// CHECK-32: (case name=option121 index=121) +// CHECK-32: (case name=option122 index=122) +// CHECK-32: (case name=option123 index=123) +// CHECK-32: (case name=option124 index=124) +// CHECK-32: (case name=option125 index=125) +// CHECK-32: (case name=option126 index=126) +// CHECK-32: (case name=option127 index=127) +// CHECK-32: (case name=option128 index=128) +// CHECK-32: (case name=option129 index=129) +// CHECK-32: (case name=option130 index=130) +// CHECK-32: (case name=option131 index=131) +// CHECK-32: (case name=option132 index=132) +// CHECK-32: (case name=option133 index=133) +// CHECK-32: (case name=option134 index=134) +// CHECK-32: (case name=option135 index=135) +// CHECK-32: (case name=option136 index=136) +// CHECK-32: (case name=option137 index=137) +// CHECK-32: (case name=option138 index=138) +// CHECK-32: (case name=option139 index=139) +// CHECK-32: (case name=option140 index=140) +// CHECK-32: (case name=option141 index=141) +// CHECK-32: (case name=option142 index=142) +// CHECK-32: (case name=option143 index=143) +// CHECK-32: (case name=option144 index=144) +// CHECK-32: (case name=option145 index=145) +// CHECK-32: (case name=option146 index=146) +// CHECK-32: (case name=option147 index=147) +// CHECK-32: (case name=option148 index=148) +// CHECK-32: (case name=option149 index=149) +// CHECK-32: (case name=option150 index=150) +// CHECK-32: (case name=option151 index=151) +// CHECK-32: (case name=option152 index=152) +// CHECK-32: (case name=option153 index=153) +// CHECK-32: (case name=option154 index=154) +// CHECK-32: (case name=option155 index=155) +// CHECK-32: (case name=option156 index=156) +// CHECK-32: (case name=option157 index=157) +// CHECK-32: (case name=option158 index=158) +// CHECK-32: (case name=option159 index=159) +// CHECK-32: (case name=option160 index=160) +// CHECK-32: (case name=option161 index=161) +// CHECK-32: (case name=option162 index=162) +// CHECK-32: (case name=option163 index=163) +// CHECK-32: (case name=option164 index=164) +// CHECK-32: (case name=option165 index=165) +// CHECK-32: (case name=option166 index=166) +// CHECK-32: (case name=option167 index=167) +// CHECK-32: (case name=option168 index=168) +// CHECK-32: (case name=option169 index=169) +// CHECK-32: (case name=option170 index=170) +// CHECK-32: (case name=option171 index=171) +// CHECK-32: (case name=option172 index=172) +// CHECK-32: (case name=option173 index=173) +// CHECK-32: (case name=option174 index=174) +// CHECK-32: (case name=option175 index=175) +// CHECK-32: (case name=option176 index=176) +// CHECK-32: (case name=option177 index=177) +// CHECK-32: (case name=option178 index=178) +// CHECK-32: (case name=option179 index=179) +// CHECK-32: (case name=option180 index=180) +// CHECK-32: (case name=option181 index=181) +// CHECK-32: (case name=option182 index=182) +// CHECK-32: (case name=option183 index=183) +// CHECK-32: (case name=option184 index=184) +// CHECK-32: (case name=option185 index=185) +// CHECK-32: (case name=option186 index=186) +// CHECK-32: (case name=option187 index=187) +// CHECK-32: (case name=option188 index=188) +// CHECK-32: (case name=option189 index=189) +// CHECK-32: (case name=option190 index=190) +// CHECK-32: (case name=option191 index=191) +// CHECK-32: (case name=option192 index=192) +// CHECK-32: (case name=option193 index=193) +// CHECK-32: (case name=option194 index=194) +// CHECK-32: (case name=option195 index=195) +// CHECK-32: (case name=option196 index=196) +// CHECK-32: (case name=option197 index=197) +// CHECK-32: (case name=option198 index=198) +// CHECK-32: (case name=option199 index=199) +// CHECK-32: (case name=option200 index=200) +// CHECK-32: (case name=option201 index=201) +// CHECK-32: (case name=option202 index=202) +// CHECK-32: (case name=option203 index=203) +// CHECK-32: (case name=option204 index=204) +// CHECK-32: (case name=option205 index=205) +// CHECK-32: (case name=option206 index=206) +// CHECK-32: (case name=option207 index=207) +// CHECK-32: (case name=option208 index=208) +// CHECK-32: (case name=option209 index=209) +// CHECK-32: (case name=option210 index=210) +// CHECK-32: (case name=option211 index=211) +// CHECK-32: (case name=option212 index=212) +// CHECK-32: (case name=option213 index=213) +// CHECK-32: (case name=option214 index=214) +// CHECK-32: (case name=option215 index=215) +// CHECK-32: (case name=option216 index=216) +// CHECK-32: (case name=option217 index=217) +// CHECK-32: (case name=option218 index=218) +// CHECK-32: (case name=option219 index=219) +// CHECK-32: (case name=option220 index=220) +// CHECK-32: (case name=option221 index=221) +// CHECK-32: (case name=option222 index=222) +// CHECK-32: (case name=option223 index=223) +// CHECK-32: (case name=option224 index=224) +// CHECK-32: (case name=option225 index=225) +// CHECK-32: (case name=option226 index=226) +// CHECK-32: (case name=option227 index=227) +// CHECK-32: (case name=option228 index=228) +// CHECK-32: (case name=option229 index=229) +// CHECK-32: (case name=option230 index=230) +// CHECK-32: (case name=option231 index=231) +// CHECK-32: (case name=option232 index=232) +// CHECK-32: (case name=option233 index=233) +// CHECK-32: (case name=option234 index=234) +// CHECK-32: (case name=option235 index=235) +// CHECK-32: (case name=option236 index=236) +// CHECK-32: (case name=option237 index=237) +// CHECK-32: (case name=option238 index=238) +// CHECK-32: (case name=option239 index=239) +// CHECK-32: (case name=option240 index=240) +// CHECK-32: (case name=option241 index=241) +// CHECK-32: (case name=option242 index=242) +// CHECK-32: (case name=option243 index=243) +// CHECK-32: (case name=option244 index=244) +// CHECK-32: (case name=option245 index=245) +// CHECK-32: (case name=option246 index=246) +// CHECK-32: (case name=option247 index=247) +// CHECK-32: (case name=option248 index=248) +// CHECK-32: (case name=option249 index=249) +// CHECK-32: (case name=option250 index=250) +// CHECK-32: (case name=option251 index=251) +// CHECK-32: (case name=option252 index=252) +// CHECK-32: (case name=option253 index=253))) // CHECK-32: (field name=e2 offset=9 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-32: (case name=option0 index=0) +// CHECK-32: (case name=option1 index=1) +// CHECK-32: (case name=option2 index=2) +// CHECK-32: (case name=option3 index=3) +// CHECK-32: (case name=option4 index=4) +// CHECK-32: (case name=option5 index=5) +// CHECK-32: (case name=option6 index=6) +// CHECK-32: (case name=option7 index=7) +// CHECK-32: (case name=option8 index=8) +// CHECK-32: (case name=option9 index=9) +// CHECK-32: (case name=option10 index=10) +// CHECK-32: (case name=option11 index=11) +// CHECK-32: (case name=option12 index=12) +// CHECK-32: (case name=option13 index=13) +// CHECK-32: (case name=option14 index=14) +// CHECK-32: (case name=option15 index=15) +// CHECK-32: (case name=option16 index=16) +// CHECK-32: (case name=option17 index=17) +// CHECK-32: (case name=option18 index=18) +// CHECK-32: (case name=option19 index=19) +// CHECK-32: (case name=option20 index=20) +// CHECK-32: (case name=option21 index=21) +// CHECK-32: (case name=option22 index=22) +// CHECK-32: (case name=option23 index=23) +// CHECK-32: (case name=option24 index=24) +// CHECK-32: (case name=option25 index=25) +// CHECK-32: (case name=option26 index=26) +// CHECK-32: (case name=option27 index=27) +// CHECK-32: (case name=option28 index=28) +// CHECK-32: (case name=option29 index=29) +// CHECK-32: (case name=option30 index=30) +// CHECK-32: (case name=option31 index=31) +// CHECK-32: (case name=option32 index=32) +// CHECK-32: (case name=option33 index=33) +// CHECK-32: (case name=option34 index=34) +// CHECK-32: (case name=option35 index=35) +// CHECK-32: (case name=option36 index=36) +// CHECK-32: (case name=option37 index=37) +// CHECK-32: (case name=option38 index=38) +// CHECK-32: (case name=option39 index=39) +// CHECK-32: (case name=option40 index=40) +// CHECK-32: (case name=option41 index=41) +// CHECK-32: (case name=option42 index=42) +// CHECK-32: (case name=option43 index=43) +// CHECK-32: (case name=option44 index=44) +// CHECK-32: (case name=option45 index=45) +// CHECK-32: (case name=option46 index=46) +// CHECK-32: (case name=option47 index=47) +// CHECK-32: (case name=option48 index=48) +// CHECK-32: (case name=option49 index=49) +// CHECK-32: (case name=option50 index=50) +// CHECK-32: (case name=option51 index=51) +// CHECK-32: (case name=option52 index=52) +// CHECK-32: (case name=option53 index=53) +// CHECK-32: (case name=option54 index=54) +// CHECK-32: (case name=option55 index=55) +// CHECK-32: (case name=option56 index=56) +// CHECK-32: (case name=option57 index=57) +// CHECK-32: (case name=option58 index=58) +// CHECK-32: (case name=option59 index=59) +// CHECK-32: (case name=option60 index=60) +// CHECK-32: (case name=option61 index=61) +// CHECK-32: (case name=option62 index=62) +// CHECK-32: (case name=option63 index=63) +// CHECK-32: (case name=option64 index=64) +// CHECK-32: (case name=option65 index=65) +// CHECK-32: (case name=option66 index=66) +// CHECK-32: (case name=option67 index=67) +// CHECK-32: (case name=option68 index=68) +// CHECK-32: (case name=option69 index=69) +// CHECK-32: (case name=option70 index=70) +// CHECK-32: (case name=option71 index=71) +// CHECK-32: (case name=option72 index=72) +// CHECK-32: (case name=option73 index=73) +// CHECK-32: (case name=option74 index=74) +// CHECK-32: (case name=option75 index=75) +// CHECK-32: (case name=option76 index=76) +// CHECK-32: (case name=option77 index=77) +// CHECK-32: (case name=option78 index=78) +// CHECK-32: (case name=option79 index=79) +// CHECK-32: (case name=option80 index=80) +// CHECK-32: (case name=option81 index=81) +// CHECK-32: (case name=option82 index=82) +// CHECK-32: (case name=option83 index=83) +// CHECK-32: (case name=option84 index=84) +// CHECK-32: (case name=option85 index=85) +// CHECK-32: (case name=option86 index=86) +// CHECK-32: (case name=option87 index=87) +// CHECK-32: (case name=option88 index=88) +// CHECK-32: (case name=option89 index=89) +// CHECK-32: (case name=option90 index=90) +// CHECK-32: (case name=option91 index=91) +// CHECK-32: (case name=option92 index=92) +// CHECK-32: (case name=option93 index=93) +// CHECK-32: (case name=option94 index=94) +// CHECK-32: (case name=option95 index=95) +// CHECK-32: (case name=option96 index=96) +// CHECK-32: (case name=option97 index=97) +// CHECK-32: (case name=option98 index=98) +// CHECK-32: (case name=option99 index=99) +// CHECK-32: (case name=option100 index=100) +// CHECK-32: (case name=option101 index=101) +// CHECK-32: (case name=option102 index=102) +// CHECK-32: (case name=option103 index=103) +// CHECK-32: (case name=option104 index=104) +// CHECK-32: (case name=option105 index=105) +// CHECK-32: (case name=option106 index=106) +// CHECK-32: (case name=option107 index=107) +// CHECK-32: (case name=option108 index=108) +// CHECK-32: (case name=option109 index=109) +// CHECK-32: (case name=option110 index=110) +// CHECK-32: (case name=option111 index=111) +// CHECK-32: (case name=option112 index=112) +// CHECK-32: (case name=option113 index=113) +// CHECK-32: (case name=option114 index=114) +// CHECK-32: (case name=option115 index=115) +// CHECK-32: (case name=option116 index=116) +// CHECK-32: (case name=option117 index=117) +// CHECK-32: (case name=option118 index=118) +// CHECK-32: (case name=option119 index=119) +// CHECK-32: (case name=option120 index=120) +// CHECK-32: (case name=option121 index=121) +// CHECK-32: (case name=option122 index=122) +// CHECK-32: (case name=option123 index=123) +// CHECK-32: (case name=option124 index=124) +// CHECK-32: (case name=option125 index=125) +// CHECK-32: (case name=option126 index=126) +// CHECK-32: (case name=option127 index=127) +// CHECK-32: (case name=option128 index=128) +// CHECK-32: (case name=option129 index=129) +// CHECK-32: (case name=option130 index=130) +// CHECK-32: (case name=option131 index=131) +// CHECK-32: (case name=option132 index=132) +// CHECK-32: (case name=option133 index=133) +// CHECK-32: (case name=option134 index=134) +// CHECK-32: (case name=option135 index=135) +// CHECK-32: (case name=option136 index=136) +// CHECK-32: (case name=option137 index=137) +// CHECK-32: (case name=option138 index=138) +// CHECK-32: (case name=option139 index=139) +// CHECK-32: (case name=option140 index=140) +// CHECK-32: (case name=option141 index=141) +// CHECK-32: (case name=option142 index=142) +// CHECK-32: (case name=option143 index=143) +// CHECK-32: (case name=option144 index=144) +// CHECK-32: (case name=option145 index=145) +// CHECK-32: (case name=option146 index=146) +// CHECK-32: (case name=option147 index=147) +// CHECK-32: (case name=option148 index=148) +// CHECK-32: (case name=option149 index=149) +// CHECK-32: (case name=option150 index=150) +// CHECK-32: (case name=option151 index=151) +// CHECK-32: (case name=option152 index=152) +// CHECK-32: (case name=option153 index=153) +// CHECK-32: (case name=option154 index=154) +// CHECK-32: (case name=option155 index=155) +// CHECK-32: (case name=option156 index=156) +// CHECK-32: (case name=option157 index=157) +// CHECK-32: (case name=option158 index=158) +// CHECK-32: (case name=option159 index=159) +// CHECK-32: (case name=option160 index=160) +// CHECK-32: (case name=option161 index=161) +// CHECK-32: (case name=option162 index=162) +// CHECK-32: (case name=option163 index=163) +// CHECK-32: (case name=option164 index=164) +// CHECK-32: (case name=option165 index=165) +// CHECK-32: (case name=option166 index=166) +// CHECK-32: (case name=option167 index=167) +// CHECK-32: (case name=option168 index=168) +// CHECK-32: (case name=option169 index=169) +// CHECK-32: (case name=option170 index=170) +// CHECK-32: (case name=option171 index=171) +// CHECK-32: (case name=option172 index=172) +// CHECK-32: (case name=option173 index=173) +// CHECK-32: (case name=option174 index=174) +// CHECK-32: (case name=option175 index=175) +// CHECK-32: (case name=option176 index=176) +// CHECK-32: (case name=option177 index=177) +// CHECK-32: (case name=option178 index=178) +// CHECK-32: (case name=option179 index=179) +// CHECK-32: (case name=option180 index=180) +// CHECK-32: (case name=option181 index=181) +// CHECK-32: (case name=option182 index=182) +// CHECK-32: (case name=option183 index=183) +// CHECK-32: (case name=option184 index=184) +// CHECK-32: (case name=option185 index=185) +// CHECK-32: (case name=option186 index=186) +// CHECK-32: (case name=option187 index=187) +// CHECK-32: (case name=option188 index=188) +// CHECK-32: (case name=option189 index=189) +// CHECK-32: (case name=option190 index=190) +// CHECK-32: (case name=option191 index=191) +// CHECK-32: (case name=option192 index=192) +// CHECK-32: (case name=option193 index=193) +// CHECK-32: (case name=option194 index=194) +// CHECK-32: (case name=option195 index=195) +// CHECK-32: (case name=option196 index=196) +// CHECK-32: (case name=option197 index=197) +// CHECK-32: (case name=option198 index=198) +// CHECK-32: (case name=option199 index=199) +// CHECK-32: (case name=option200 index=200) +// CHECK-32: (case name=option201 index=201) +// CHECK-32: (case name=option202 index=202) +// CHECK-32: (case name=option203 index=203) +// CHECK-32: (case name=option204 index=204) +// CHECK-32: (case name=option205 index=205) +// CHECK-32: (case name=option206 index=206) +// CHECK-32: (case name=option207 index=207) +// CHECK-32: (case name=option208 index=208) +// CHECK-32: (case name=option209 index=209) +// CHECK-32: (case name=option210 index=210) +// CHECK-32: (case name=option211 index=211) +// CHECK-32: (case name=option212 index=212) +// CHECK-32: (case name=option213 index=213) +// CHECK-32: (case name=option214 index=214) +// CHECK-32: (case name=option215 index=215) +// CHECK-32: (case name=option216 index=216) +// CHECK-32: (case name=option217 index=217) +// CHECK-32: (case name=option218 index=218) +// CHECK-32: (case name=option219 index=219) +// CHECK-32: (case name=option220 index=220) +// CHECK-32: (case name=option221 index=221) +// CHECK-32: (case name=option222 index=222) +// CHECK-32: (case name=option223 index=223) +// CHECK-32: (case name=option224 index=224) +// CHECK-32: (case name=option225 index=225) +// CHECK-32: (case name=option226 index=226) +// CHECK-32: (case name=option227 index=227) +// CHECK-32: (case name=option228 index=228) +// CHECK-32: (case name=option229 index=229) +// CHECK-32: (case name=option230 index=230) +// CHECK-32: (case name=option231 index=231) +// CHECK-32: (case name=option232 index=232) +// CHECK-32: (case name=option233 index=233) +// CHECK-32: (case name=option234 index=234) +// CHECK-32: (case name=option235 index=235) +// CHECK-32: (case name=option236 index=236) +// CHECK-32: (case name=option237 index=237) +// CHECK-32: (case name=option238 index=238) +// CHECK-32: (case name=option239 index=239) +// CHECK-32: (case name=option240 index=240) +// CHECK-32: (case name=option241 index=241) +// CHECK-32: (case name=option242 index=242) +// CHECK-32: (case name=option243 index=243) +// CHECK-32: (case name=option244 index=244) +// CHECK-32: (case name=option245 index=245) +// CHECK-32: (case name=option246 index=246) +// CHECK-32: (case name=option247 index=247) +// CHECK-32: (case name=option248 index=248) +// CHECK-32: (case name=option249 index=249) +// CHECK-32: (case name=option250 index=250) +// CHECK-32: (case name=option251 index=251) +// CHECK-32: (case name=option252 index=252) +// CHECK-32: (case name=option253 index=253))) // CHECK-32: (field name=e3 offset=10 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-32: (case name=option0 index=0) +// CHECK-32: (case name=option1 index=1) +// CHECK-32: (case name=option2 index=2) +// CHECK-32: (case name=option3 index=3) +// CHECK-32: (case name=option4 index=4) +// CHECK-32: (case name=option5 index=5) +// CHECK-32: (case name=option6 index=6) +// CHECK-32: (case name=option7 index=7) +// CHECK-32: (case name=option8 index=8) +// CHECK-32: (case name=option9 index=9) +// CHECK-32: (case name=option10 index=10) +// CHECK-32: (case name=option11 index=11) +// CHECK-32: (case name=option12 index=12) +// CHECK-32: (case name=option13 index=13) +// CHECK-32: (case name=option14 index=14) +// CHECK-32: (case name=option15 index=15) +// CHECK-32: (case name=option16 index=16) +// CHECK-32: (case name=option17 index=17) +// CHECK-32: (case name=option18 index=18) +// CHECK-32: (case name=option19 index=19) +// CHECK-32: (case name=option20 index=20) +// CHECK-32: (case name=option21 index=21) +// CHECK-32: (case name=option22 index=22) +// CHECK-32: (case name=option23 index=23) +// CHECK-32: (case name=option24 index=24) +// CHECK-32: (case name=option25 index=25) +// CHECK-32: (case name=option26 index=26) +// CHECK-32: (case name=option27 index=27) +// CHECK-32: (case name=option28 index=28) +// CHECK-32: (case name=option29 index=29) +// CHECK-32: (case name=option30 index=30) +// CHECK-32: (case name=option31 index=31) +// CHECK-32: (case name=option32 index=32) +// CHECK-32: (case name=option33 index=33) +// CHECK-32: (case name=option34 index=34) +// CHECK-32: (case name=option35 index=35) +// CHECK-32: (case name=option36 index=36) +// CHECK-32: (case name=option37 index=37) +// CHECK-32: (case name=option38 index=38) +// CHECK-32: (case name=option39 index=39) +// CHECK-32: (case name=option40 index=40) +// CHECK-32: (case name=option41 index=41) +// CHECK-32: (case name=option42 index=42) +// CHECK-32: (case name=option43 index=43) +// CHECK-32: (case name=option44 index=44) +// CHECK-32: (case name=option45 index=45) +// CHECK-32: (case name=option46 index=46) +// CHECK-32: (case name=option47 index=47) +// CHECK-32: (case name=option48 index=48) +// CHECK-32: (case name=option49 index=49) +// CHECK-32: (case name=option50 index=50) +// CHECK-32: (case name=option51 index=51) +// CHECK-32: (case name=option52 index=52) +// CHECK-32: (case name=option53 index=53) +// CHECK-32: (case name=option54 index=54) +// CHECK-32: (case name=option55 index=55) +// CHECK-32: (case name=option56 index=56) +// CHECK-32: (case name=option57 index=57) +// CHECK-32: (case name=option58 index=58) +// CHECK-32: (case name=option59 index=59) +// CHECK-32: (case name=option60 index=60) +// CHECK-32: (case name=option61 index=61) +// CHECK-32: (case name=option62 index=62) +// CHECK-32: (case name=option63 index=63) +// CHECK-32: (case name=option64 index=64) +// CHECK-32: (case name=option65 index=65) +// CHECK-32: (case name=option66 index=66) +// CHECK-32: (case name=option67 index=67) +// CHECK-32: (case name=option68 index=68) +// CHECK-32: (case name=option69 index=69) +// CHECK-32: (case name=option70 index=70) +// CHECK-32: (case name=option71 index=71) +// CHECK-32: (case name=option72 index=72) +// CHECK-32: (case name=option73 index=73) +// CHECK-32: (case name=option74 index=74) +// CHECK-32: (case name=option75 index=75) +// CHECK-32: (case name=option76 index=76) +// CHECK-32: (case name=option77 index=77) +// CHECK-32: (case name=option78 index=78) +// CHECK-32: (case name=option79 index=79) +// CHECK-32: (case name=option80 index=80) +// CHECK-32: (case name=option81 index=81) +// CHECK-32: (case name=option82 index=82) +// CHECK-32: (case name=option83 index=83) +// CHECK-32: (case name=option84 index=84) +// CHECK-32: (case name=option85 index=85) +// CHECK-32: (case name=option86 index=86) +// CHECK-32: (case name=option87 index=87) +// CHECK-32: (case name=option88 index=88) +// CHECK-32: (case name=option89 index=89) +// CHECK-32: (case name=option90 index=90) +// CHECK-32: (case name=option91 index=91) +// CHECK-32: (case name=option92 index=92) +// CHECK-32: (case name=option93 index=93) +// CHECK-32: (case name=option94 index=94) +// CHECK-32: (case name=option95 index=95) +// CHECK-32: (case name=option96 index=96) +// CHECK-32: (case name=option97 index=97) +// CHECK-32: (case name=option98 index=98) +// CHECK-32: (case name=option99 index=99) +// CHECK-32: (case name=option100 index=100) +// CHECK-32: (case name=option101 index=101) +// CHECK-32: (case name=option102 index=102) +// CHECK-32: (case name=option103 index=103) +// CHECK-32: (case name=option104 index=104) +// CHECK-32: (case name=option105 index=105) +// CHECK-32: (case name=option106 index=106) +// CHECK-32: (case name=option107 index=107) +// CHECK-32: (case name=option108 index=108) +// CHECK-32: (case name=option109 index=109) +// CHECK-32: (case name=option110 index=110) +// CHECK-32: (case name=option111 index=111) +// CHECK-32: (case name=option112 index=112) +// CHECK-32: (case name=option113 index=113) +// CHECK-32: (case name=option114 index=114) +// CHECK-32: (case name=option115 index=115) +// CHECK-32: (case name=option116 index=116) +// CHECK-32: (case name=option117 index=117) +// CHECK-32: (case name=option118 index=118) +// CHECK-32: (case name=option119 index=119) +// CHECK-32: (case name=option120 index=120) +// CHECK-32: (case name=option121 index=121) +// CHECK-32: (case name=option122 index=122) +// CHECK-32: (case name=option123 index=123) +// CHECK-32: (case name=option124 index=124) +// CHECK-32: (case name=option125 index=125) +// CHECK-32: (case name=option126 index=126) +// CHECK-32: (case name=option127 index=127) +// CHECK-32: (case name=option128 index=128) +// CHECK-32: (case name=option129 index=129) +// CHECK-32: (case name=option130 index=130) +// CHECK-32: (case name=option131 index=131) +// CHECK-32: (case name=option132 index=132) +// CHECK-32: (case name=option133 index=133) +// CHECK-32: (case name=option134 index=134) +// CHECK-32: (case name=option135 index=135) +// CHECK-32: (case name=option136 index=136) +// CHECK-32: (case name=option137 index=137) +// CHECK-32: (case name=option138 index=138) +// CHECK-32: (case name=option139 index=139) +// CHECK-32: (case name=option140 index=140) +// CHECK-32: (case name=option141 index=141) +// CHECK-32: (case name=option142 index=142) +// CHECK-32: (case name=option143 index=143) +// CHECK-32: (case name=option144 index=144) +// CHECK-32: (case name=option145 index=145) +// CHECK-32: (case name=option146 index=146) +// CHECK-32: (case name=option147 index=147) +// CHECK-32: (case name=option148 index=148) +// CHECK-32: (case name=option149 index=149) +// CHECK-32: (case name=option150 index=150) +// CHECK-32: (case name=option151 index=151) +// CHECK-32: (case name=option152 index=152) +// CHECK-32: (case name=option153 index=153) +// CHECK-32: (case name=option154 index=154) +// CHECK-32: (case name=option155 index=155) +// CHECK-32: (case name=option156 index=156) +// CHECK-32: (case name=option157 index=157) +// CHECK-32: (case name=option158 index=158) +// CHECK-32: (case name=option159 index=159) +// CHECK-32: (case name=option160 index=160) +// CHECK-32: (case name=option161 index=161) +// CHECK-32: (case name=option162 index=162) +// CHECK-32: (case name=option163 index=163) +// CHECK-32: (case name=option164 index=164) +// CHECK-32: (case name=option165 index=165) +// CHECK-32: (case name=option166 index=166) +// CHECK-32: (case name=option167 index=167) +// CHECK-32: (case name=option168 index=168) +// CHECK-32: (case name=option169 index=169) +// CHECK-32: (case name=option170 index=170) +// CHECK-32: (case name=option171 index=171) +// CHECK-32: (case name=option172 index=172) +// CHECK-32: (case name=option173 index=173) +// CHECK-32: (case name=option174 index=174) +// CHECK-32: (case name=option175 index=175) +// CHECK-32: (case name=option176 index=176) +// CHECK-32: (case name=option177 index=177) +// CHECK-32: (case name=option178 index=178) +// CHECK-32: (case name=option179 index=179) +// CHECK-32: (case name=option180 index=180) +// CHECK-32: (case name=option181 index=181) +// CHECK-32: (case name=option182 index=182) +// CHECK-32: (case name=option183 index=183) +// CHECK-32: (case name=option184 index=184) +// CHECK-32: (case name=option185 index=185) +// CHECK-32: (case name=option186 index=186) +// CHECK-32: (case name=option187 index=187) +// CHECK-32: (case name=option188 index=188) +// CHECK-32: (case name=option189 index=189) +// CHECK-32: (case name=option190 index=190) +// CHECK-32: (case name=option191 index=191) +// CHECK-32: (case name=option192 index=192) +// CHECK-32: (case name=option193 index=193) +// CHECK-32: (case name=option194 index=194) +// CHECK-32: (case name=option195 index=195) +// CHECK-32: (case name=option196 index=196) +// CHECK-32: (case name=option197 index=197) +// CHECK-32: (case name=option198 index=198) +// CHECK-32: (case name=option199 index=199) +// CHECK-32: (case name=option200 index=200) +// CHECK-32: (case name=option201 index=201) +// CHECK-32: (case name=option202 index=202) +// CHECK-32: (case name=option203 index=203) +// CHECK-32: (case name=option204 index=204) +// CHECK-32: (case name=option205 index=205) +// CHECK-32: (case name=option206 index=206) +// CHECK-32: (case name=option207 index=207) +// CHECK-32: (case name=option208 index=208) +// CHECK-32: (case name=option209 index=209) +// CHECK-32: (case name=option210 index=210) +// CHECK-32: (case name=option211 index=211) +// CHECK-32: (case name=option212 index=212) +// CHECK-32: (case name=option213 index=213) +// CHECK-32: (case name=option214 index=214) +// CHECK-32: (case name=option215 index=215) +// CHECK-32: (case name=option216 index=216) +// CHECK-32: (case name=option217 index=217) +// CHECK-32: (case name=option218 index=218) +// CHECK-32: (case name=option219 index=219) +// CHECK-32: (case name=option220 index=220) +// CHECK-32: (case name=option221 index=221) +// CHECK-32: (case name=option222 index=222) +// CHECK-32: (case name=option223 index=223) +// CHECK-32: (case name=option224 index=224) +// CHECK-32: (case name=option225 index=225) +// CHECK-32: (case name=option226 index=226) +// CHECK-32: (case name=option227 index=227) +// CHECK-32: (case name=option228 index=228) +// CHECK-32: (case name=option229 index=229) +// CHECK-32: (case name=option230 index=230) +// CHECK-32: (case name=option231 index=231) +// CHECK-32: (case name=option232 index=232) +// CHECK-32: (case name=option233 index=233) +// CHECK-32: (case name=option234 index=234) +// CHECK-32: (case name=option235 index=235) +// CHECK-32: (case name=option236 index=236) +// CHECK-32: (case name=option237 index=237) +// CHECK-32: (case name=option238 index=238) +// CHECK-32: (case name=option239 index=239) +// CHECK-32: (case name=option240 index=240) +// CHECK-32: (case name=option241 index=241) +// CHECK-32: (case name=option242 index=242) +// CHECK-32: (case name=option243 index=243) +// CHECK-32: (case name=option244 index=244) +// CHECK-32: (case name=option245 index=245) +// CHECK-32: (case name=option246 index=246) +// CHECK-32: (case name=option247 index=247) +// CHECK-32: (case name=option248 index=248) +// CHECK-32: (case name=option249 index=249) +// CHECK-32: (case name=option250 index=250) +// CHECK-32: (case name=option251 index=251) +// CHECK-32: (case name=option252 index=252) +// CHECK-32: (case name=option253 index=253))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e4 offset=11 // CHECK-32: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1)))))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-32: (case name=option0 index=0) +// CHECK-32: (case name=option1 index=1) +// CHECK-32: (case name=option2 index=2) +// CHECK-32: (case name=option3 index=3) +// CHECK-32: (case name=option4 index=4) +// CHECK-32: (case name=option5 index=5) +// CHECK-32: (case name=option6 index=6) +// CHECK-32: (case name=option7 index=7) +// CHECK-32: (case name=option8 index=8) +// CHECK-32: (case name=option9 index=9) +// CHECK-32: (case name=option10 index=10) +// CHECK-32: (case name=option11 index=11) +// CHECK-32: (case name=option12 index=12) +// CHECK-32: (case name=option13 index=13) +// CHECK-32: (case name=option14 index=14) +// CHECK-32: (case name=option15 index=15) +// CHECK-32: (case name=option16 index=16) +// CHECK-32: (case name=option17 index=17) +// CHECK-32: (case name=option18 index=18) +// CHECK-32: (case name=option19 index=19) +// CHECK-32: (case name=option20 index=20) +// CHECK-32: (case name=option21 index=21) +// CHECK-32: (case name=option22 index=22) +// CHECK-32: (case name=option23 index=23) +// CHECK-32: (case name=option24 index=24) +// CHECK-32: (case name=option25 index=25) +// CHECK-32: (case name=option26 index=26) +// CHECK-32: (case name=option27 index=27) +// CHECK-32: (case name=option28 index=28) +// CHECK-32: (case name=option29 index=29) +// CHECK-32: (case name=option30 index=30) +// CHECK-32: (case name=option31 index=31) +// CHECK-32: (case name=option32 index=32) +// CHECK-32: (case name=option33 index=33) +// CHECK-32: (case name=option34 index=34) +// CHECK-32: (case name=option35 index=35) +// CHECK-32: (case name=option36 index=36) +// CHECK-32: (case name=option37 index=37) +// CHECK-32: (case name=option38 index=38) +// CHECK-32: (case name=option39 index=39) +// CHECK-32: (case name=option40 index=40) +// CHECK-32: (case name=option41 index=41) +// CHECK-32: (case name=option42 index=42) +// CHECK-32: (case name=option43 index=43) +// CHECK-32: (case name=option44 index=44) +// CHECK-32: (case name=option45 index=45) +// CHECK-32: (case name=option46 index=46) +// CHECK-32: (case name=option47 index=47) +// CHECK-32: (case name=option48 index=48) +// CHECK-32: (case name=option49 index=49) +// CHECK-32: (case name=option50 index=50) +// CHECK-32: (case name=option51 index=51) +// CHECK-32: (case name=option52 index=52) +// CHECK-32: (case name=option53 index=53) +// CHECK-32: (case name=option54 index=54) +// CHECK-32: (case name=option55 index=55) +// CHECK-32: (case name=option56 index=56) +// CHECK-32: (case name=option57 index=57) +// CHECK-32: (case name=option58 index=58) +// CHECK-32: (case name=option59 index=59) +// CHECK-32: (case name=option60 index=60) +// CHECK-32: (case name=option61 index=61) +// CHECK-32: (case name=option62 index=62) +// CHECK-32: (case name=option63 index=63) +// CHECK-32: (case name=option64 index=64) +// CHECK-32: (case name=option65 index=65) +// CHECK-32: (case name=option66 index=66) +// CHECK-32: (case name=option67 index=67) +// CHECK-32: (case name=option68 index=68) +// CHECK-32: (case name=option69 index=69) +// CHECK-32: (case name=option70 index=70) +// CHECK-32: (case name=option71 index=71) +// CHECK-32: (case name=option72 index=72) +// CHECK-32: (case name=option73 index=73) +// CHECK-32: (case name=option74 index=74) +// CHECK-32: (case name=option75 index=75) +// CHECK-32: (case name=option76 index=76) +// CHECK-32: (case name=option77 index=77) +// CHECK-32: (case name=option78 index=78) +// CHECK-32: (case name=option79 index=79) +// CHECK-32: (case name=option80 index=80) +// CHECK-32: (case name=option81 index=81) +// CHECK-32: (case name=option82 index=82) +// CHECK-32: (case name=option83 index=83) +// CHECK-32: (case name=option84 index=84) +// CHECK-32: (case name=option85 index=85) +// CHECK-32: (case name=option86 index=86) +// CHECK-32: (case name=option87 index=87) +// CHECK-32: (case name=option88 index=88) +// CHECK-32: (case name=option89 index=89) +// CHECK-32: (case name=option90 index=90) +// CHECK-32: (case name=option91 index=91) +// CHECK-32: (case name=option92 index=92) +// CHECK-32: (case name=option93 index=93) +// CHECK-32: (case name=option94 index=94) +// CHECK-32: (case name=option95 index=95) +// CHECK-32: (case name=option96 index=96) +// CHECK-32: (case name=option97 index=97) +// CHECK-32: (case name=option98 index=98) +// CHECK-32: (case name=option99 index=99) +// CHECK-32: (case name=option100 index=100) +// CHECK-32: (case name=option101 index=101) +// CHECK-32: (case name=option102 index=102) +// CHECK-32: (case name=option103 index=103) +// CHECK-32: (case name=option104 index=104) +// CHECK-32: (case name=option105 index=105) +// CHECK-32: (case name=option106 index=106) +// CHECK-32: (case name=option107 index=107) +// CHECK-32: (case name=option108 index=108) +// CHECK-32: (case name=option109 index=109) +// CHECK-32: (case name=option110 index=110) +// CHECK-32: (case name=option111 index=111) +// CHECK-32: (case name=option112 index=112) +// CHECK-32: (case name=option113 index=113) +// CHECK-32: (case name=option114 index=114) +// CHECK-32: (case name=option115 index=115) +// CHECK-32: (case name=option116 index=116) +// CHECK-32: (case name=option117 index=117) +// CHECK-32: (case name=option118 index=118) +// CHECK-32: (case name=option119 index=119) +// CHECK-32: (case name=option120 index=120) +// CHECK-32: (case name=option121 index=121) +// CHECK-32: (case name=option122 index=122) +// CHECK-32: (case name=option123 index=123) +// CHECK-32: (case name=option124 index=124) +// CHECK-32: (case name=option125 index=125) +// CHECK-32: (case name=option126 index=126) +// CHECK-32: (case name=option127 index=127) +// CHECK-32: (case name=option128 index=128) +// CHECK-32: (case name=option129 index=129) +// CHECK-32: (case name=option130 index=130) +// CHECK-32: (case name=option131 index=131) +// CHECK-32: (case name=option132 index=132) +// CHECK-32: (case name=option133 index=133) +// CHECK-32: (case name=option134 index=134) +// CHECK-32: (case name=option135 index=135) +// CHECK-32: (case name=option136 index=136) +// CHECK-32: (case name=option137 index=137) +// CHECK-32: (case name=option138 index=138) +// CHECK-32: (case name=option139 index=139) +// CHECK-32: (case name=option140 index=140) +// CHECK-32: (case name=option141 index=141) +// CHECK-32: (case name=option142 index=142) +// CHECK-32: (case name=option143 index=143) +// CHECK-32: (case name=option144 index=144) +// CHECK-32: (case name=option145 index=145) +// CHECK-32: (case name=option146 index=146) +// CHECK-32: (case name=option147 index=147) +// CHECK-32: (case name=option148 index=148) +// CHECK-32: (case name=option149 index=149) +// CHECK-32: (case name=option150 index=150) +// CHECK-32: (case name=option151 index=151) +// CHECK-32: (case name=option152 index=152) +// CHECK-32: (case name=option153 index=153) +// CHECK-32: (case name=option154 index=154) +// CHECK-32: (case name=option155 index=155) +// CHECK-32: (case name=option156 index=156) +// CHECK-32: (case name=option157 index=157) +// CHECK-32: (case name=option158 index=158) +// CHECK-32: (case name=option159 index=159) +// CHECK-32: (case name=option160 index=160) +// CHECK-32: (case name=option161 index=161) +// CHECK-32: (case name=option162 index=162) +// CHECK-32: (case name=option163 index=163) +// CHECK-32: (case name=option164 index=164) +// CHECK-32: (case name=option165 index=165) +// CHECK-32: (case name=option166 index=166) +// CHECK-32: (case name=option167 index=167) +// CHECK-32: (case name=option168 index=168) +// CHECK-32: (case name=option169 index=169) +// CHECK-32: (case name=option170 index=170) +// CHECK-32: (case name=option171 index=171) +// CHECK-32: (case name=option172 index=172) +// CHECK-32: (case name=option173 index=173) +// CHECK-32: (case name=option174 index=174) +// CHECK-32: (case name=option175 index=175) +// CHECK-32: (case name=option176 index=176) +// CHECK-32: (case name=option177 index=177) +// CHECK-32: (case name=option178 index=178) +// CHECK-32: (case name=option179 index=179) +// CHECK-32: (case name=option180 index=180) +// CHECK-32: (case name=option181 index=181) +// CHECK-32: (case name=option182 index=182) +// CHECK-32: (case name=option183 index=183) +// CHECK-32: (case name=option184 index=184) +// CHECK-32: (case name=option185 index=185) +// CHECK-32: (case name=option186 index=186) +// CHECK-32: (case name=option187 index=187) +// CHECK-32: (case name=option188 index=188) +// CHECK-32: (case name=option189 index=189) +// CHECK-32: (case name=option190 index=190) +// CHECK-32: (case name=option191 index=191) +// CHECK-32: (case name=option192 index=192) +// CHECK-32: (case name=option193 index=193) +// CHECK-32: (case name=option194 index=194) +// CHECK-32: (case name=option195 index=195) +// CHECK-32: (case name=option196 index=196) +// CHECK-32: (case name=option197 index=197) +// CHECK-32: (case name=option198 index=198) +// CHECK-32: (case name=option199 index=199) +// CHECK-32: (case name=option200 index=200) +// CHECK-32: (case name=option201 index=201) +// CHECK-32: (case name=option202 index=202) +// CHECK-32: (case name=option203 index=203) +// CHECK-32: (case name=option204 index=204) +// CHECK-32: (case name=option205 index=205) +// CHECK-32: (case name=option206 index=206) +// CHECK-32: (case name=option207 index=207) +// CHECK-32: (case name=option208 index=208) +// CHECK-32: (case name=option209 index=209) +// CHECK-32: (case name=option210 index=210) +// CHECK-32: (case name=option211 index=211) +// CHECK-32: (case name=option212 index=212) +// CHECK-32: (case name=option213 index=213) +// CHECK-32: (case name=option214 index=214) +// CHECK-32: (case name=option215 index=215) +// CHECK-32: (case name=option216 index=216) +// CHECK-32: (case name=option217 index=217) +// CHECK-32: (case name=option218 index=218) +// CHECK-32: (case name=option219 index=219) +// CHECK-32: (case name=option220 index=220) +// CHECK-32: (case name=option221 index=221) +// CHECK-32: (case name=option222 index=222) +// CHECK-32: (case name=option223 index=223) +// CHECK-32: (case name=option224 index=224) +// CHECK-32: (case name=option225 index=225) +// CHECK-32: (case name=option226 index=226) +// CHECK-32: (case name=option227 index=227) +// CHECK-32: (case name=option228 index=228) +// CHECK-32: (case name=option229 index=229) +// CHECK-32: (case name=option230 index=230) +// CHECK-32: (case name=option231 index=231) +// CHECK-32: (case name=option232 index=232) +// CHECK-32: (case name=option233 index=233) +// CHECK-32: (case name=option234 index=234) +// CHECK-32: (case name=option235 index=235) +// CHECK-32: (case name=option236 index=236) +// CHECK-32: (case name=option237 index=237) +// CHECK-32: (case name=option238 index=238) +// CHECK-32: (case name=option239 index=239) +// CHECK-32: (case name=option240 index=240) +// CHECK-32: (case name=option241 index=241) +// CHECK-32: (case name=option242 index=242) +// CHECK-32: (case name=option243 index=243) +// CHECK-32: (case name=option244 index=244) +// CHECK-32: (case name=option245 index=245) +// CHECK-32: (case name=option246 index=246) +// CHECK-32: (case name=option247 index=247) +// CHECK-32: (case name=option248 index=248) +// CHECK-32: (case name=option249 index=249) +// CHECK-32: (case name=option250 index=250) +// CHECK-32: (case name=option251 index=251) +// CHECK-32: (case name=option252 index=252) +// CHECK-32: (case name=option253 index=253))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e5 offset=13 // CHECK-32: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=1 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1))))))))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=2 bitwise_takable=1 +// CHECK-32: (case name=option0 index=0) +// CHECK-32: (case name=option1 index=1) +// CHECK-32: (case name=option2 index=2) +// CHECK-32: (case name=option3 index=3) +// CHECK-32: (case name=option4 index=4) +// CHECK-32: (case name=option5 index=5) +// CHECK-32: (case name=option6 index=6) +// CHECK-32: (case name=option7 index=7) +// CHECK-32: (case name=option8 index=8) +// CHECK-32: (case name=option9 index=9) +// CHECK-32: (case name=option10 index=10) +// CHECK-32: (case name=option11 index=11) +// CHECK-32: (case name=option12 index=12) +// CHECK-32: (case name=option13 index=13) +// CHECK-32: (case name=option14 index=14) +// CHECK-32: (case name=option15 index=15) +// CHECK-32: (case name=option16 index=16) +// CHECK-32: (case name=option17 index=17) +// CHECK-32: (case name=option18 index=18) +// CHECK-32: (case name=option19 index=19) +// CHECK-32: (case name=option20 index=20) +// CHECK-32: (case name=option21 index=21) +// CHECK-32: (case name=option22 index=22) +// CHECK-32: (case name=option23 index=23) +// CHECK-32: (case name=option24 index=24) +// CHECK-32: (case name=option25 index=25) +// CHECK-32: (case name=option26 index=26) +// CHECK-32: (case name=option27 index=27) +// CHECK-32: (case name=option28 index=28) +// CHECK-32: (case name=option29 index=29) +// CHECK-32: (case name=option30 index=30) +// CHECK-32: (case name=option31 index=31) +// CHECK-32: (case name=option32 index=32) +// CHECK-32: (case name=option33 index=33) +// CHECK-32: (case name=option34 index=34) +// CHECK-32: (case name=option35 index=35) +// CHECK-32: (case name=option36 index=36) +// CHECK-32: (case name=option37 index=37) +// CHECK-32: (case name=option38 index=38) +// CHECK-32: (case name=option39 index=39) +// CHECK-32: (case name=option40 index=40) +// CHECK-32: (case name=option41 index=41) +// CHECK-32: (case name=option42 index=42) +// CHECK-32: (case name=option43 index=43) +// CHECK-32: (case name=option44 index=44) +// CHECK-32: (case name=option45 index=45) +// CHECK-32: (case name=option46 index=46) +// CHECK-32: (case name=option47 index=47) +// CHECK-32: (case name=option48 index=48) +// CHECK-32: (case name=option49 index=49) +// CHECK-32: (case name=option50 index=50) +// CHECK-32: (case name=option51 index=51) +// CHECK-32: (case name=option52 index=52) +// CHECK-32: (case name=option53 index=53) +// CHECK-32: (case name=option54 index=54) +// CHECK-32: (case name=option55 index=55) +// CHECK-32: (case name=option56 index=56) +// CHECK-32: (case name=option57 index=57) +// CHECK-32: (case name=option58 index=58) +// CHECK-32: (case name=option59 index=59) +// CHECK-32: (case name=option60 index=60) +// CHECK-32: (case name=option61 index=61) +// CHECK-32: (case name=option62 index=62) +// CHECK-32: (case name=option63 index=63) +// CHECK-32: (case name=option64 index=64) +// CHECK-32: (case name=option65 index=65) +// CHECK-32: (case name=option66 index=66) +// CHECK-32: (case name=option67 index=67) +// CHECK-32: (case name=option68 index=68) +// CHECK-32: (case name=option69 index=69) +// CHECK-32: (case name=option70 index=70) +// CHECK-32: (case name=option71 index=71) +// CHECK-32: (case name=option72 index=72) +// CHECK-32: (case name=option73 index=73) +// CHECK-32: (case name=option74 index=74) +// CHECK-32: (case name=option75 index=75) +// CHECK-32: (case name=option76 index=76) +// CHECK-32: (case name=option77 index=77) +// CHECK-32: (case name=option78 index=78) +// CHECK-32: (case name=option79 index=79) +// CHECK-32: (case name=option80 index=80) +// CHECK-32: (case name=option81 index=81) +// CHECK-32: (case name=option82 index=82) +// CHECK-32: (case name=option83 index=83) +// CHECK-32: (case name=option84 index=84) +// CHECK-32: (case name=option85 index=85) +// CHECK-32: (case name=option86 index=86) +// CHECK-32: (case name=option87 index=87) +// CHECK-32: (case name=option88 index=88) +// CHECK-32: (case name=option89 index=89) +// CHECK-32: (case name=option90 index=90) +// CHECK-32: (case name=option91 index=91) +// CHECK-32: (case name=option92 index=92) +// CHECK-32: (case name=option93 index=93) +// CHECK-32: (case name=option94 index=94) +// CHECK-32: (case name=option95 index=95) +// CHECK-32: (case name=option96 index=96) +// CHECK-32: (case name=option97 index=97) +// CHECK-32: (case name=option98 index=98) +// CHECK-32: (case name=option99 index=99) +// CHECK-32: (case name=option100 index=100) +// CHECK-32: (case name=option101 index=101) +// CHECK-32: (case name=option102 index=102) +// CHECK-32: (case name=option103 index=103) +// CHECK-32: (case name=option104 index=104) +// CHECK-32: (case name=option105 index=105) +// CHECK-32: (case name=option106 index=106) +// CHECK-32: (case name=option107 index=107) +// CHECK-32: (case name=option108 index=108) +// CHECK-32: (case name=option109 index=109) +// CHECK-32: (case name=option110 index=110) +// CHECK-32: (case name=option111 index=111) +// CHECK-32: (case name=option112 index=112) +// CHECK-32: (case name=option113 index=113) +// CHECK-32: (case name=option114 index=114) +// CHECK-32: (case name=option115 index=115) +// CHECK-32: (case name=option116 index=116) +// CHECK-32: (case name=option117 index=117) +// CHECK-32: (case name=option118 index=118) +// CHECK-32: (case name=option119 index=119) +// CHECK-32: (case name=option120 index=120) +// CHECK-32: (case name=option121 index=121) +// CHECK-32: (case name=option122 index=122) +// CHECK-32: (case name=option123 index=123) +// CHECK-32: (case name=option124 index=124) +// CHECK-32: (case name=option125 index=125) +// CHECK-32: (case name=option126 index=126) +// CHECK-32: (case name=option127 index=127) +// CHECK-32: (case name=option128 index=128) +// CHECK-32: (case name=option129 index=129) +// CHECK-32: (case name=option130 index=130) +// CHECK-32: (case name=option131 index=131) +// CHECK-32: (case name=option132 index=132) +// CHECK-32: (case name=option133 index=133) +// CHECK-32: (case name=option134 index=134) +// CHECK-32: (case name=option135 index=135) +// CHECK-32: (case name=option136 index=136) +// CHECK-32: (case name=option137 index=137) +// CHECK-32: (case name=option138 index=138) +// CHECK-32: (case name=option139 index=139) +// CHECK-32: (case name=option140 index=140) +// CHECK-32: (case name=option141 index=141) +// CHECK-32: (case name=option142 index=142) +// CHECK-32: (case name=option143 index=143) +// CHECK-32: (case name=option144 index=144) +// CHECK-32: (case name=option145 index=145) +// CHECK-32: (case name=option146 index=146) +// CHECK-32: (case name=option147 index=147) +// CHECK-32: (case name=option148 index=148) +// CHECK-32: (case name=option149 index=149) +// CHECK-32: (case name=option150 index=150) +// CHECK-32: (case name=option151 index=151) +// CHECK-32: (case name=option152 index=152) +// CHECK-32: (case name=option153 index=153) +// CHECK-32: (case name=option154 index=154) +// CHECK-32: (case name=option155 index=155) +// CHECK-32: (case name=option156 index=156) +// CHECK-32: (case name=option157 index=157) +// CHECK-32: (case name=option158 index=158) +// CHECK-32: (case name=option159 index=159) +// CHECK-32: (case name=option160 index=160) +// CHECK-32: (case name=option161 index=161) +// CHECK-32: (case name=option162 index=162) +// CHECK-32: (case name=option163 index=163) +// CHECK-32: (case name=option164 index=164) +// CHECK-32: (case name=option165 index=165) +// CHECK-32: (case name=option166 index=166) +// CHECK-32: (case name=option167 index=167) +// CHECK-32: (case name=option168 index=168) +// CHECK-32: (case name=option169 index=169) +// CHECK-32: (case name=option170 index=170) +// CHECK-32: (case name=option171 index=171) +// CHECK-32: (case name=option172 index=172) +// CHECK-32: (case name=option173 index=173) +// CHECK-32: (case name=option174 index=174) +// CHECK-32: (case name=option175 index=175) +// CHECK-32: (case name=option176 index=176) +// CHECK-32: (case name=option177 index=177) +// CHECK-32: (case name=option178 index=178) +// CHECK-32: (case name=option179 index=179) +// CHECK-32: (case name=option180 index=180) +// CHECK-32: (case name=option181 index=181) +// CHECK-32: (case name=option182 index=182) +// CHECK-32: (case name=option183 index=183) +// CHECK-32: (case name=option184 index=184) +// CHECK-32: (case name=option185 index=185) +// CHECK-32: (case name=option186 index=186) +// CHECK-32: (case name=option187 index=187) +// CHECK-32: (case name=option188 index=188) +// CHECK-32: (case name=option189 index=189) +// CHECK-32: (case name=option190 index=190) +// CHECK-32: (case name=option191 index=191) +// CHECK-32: (case name=option192 index=192) +// CHECK-32: (case name=option193 index=193) +// CHECK-32: (case name=option194 index=194) +// CHECK-32: (case name=option195 index=195) +// CHECK-32: (case name=option196 index=196) +// CHECK-32: (case name=option197 index=197) +// CHECK-32: (case name=option198 index=198) +// CHECK-32: (case name=option199 index=199) +// CHECK-32: (case name=option200 index=200) +// CHECK-32: (case name=option201 index=201) +// CHECK-32: (case name=option202 index=202) +// CHECK-32: (case name=option203 index=203) +// CHECK-32: (case name=option204 index=204) +// CHECK-32: (case name=option205 index=205) +// CHECK-32: (case name=option206 index=206) +// CHECK-32: (case name=option207 index=207) +// CHECK-32: (case name=option208 index=208) +// CHECK-32: (case name=option209 index=209) +// CHECK-32: (case name=option210 index=210) +// CHECK-32: (case name=option211 index=211) +// CHECK-32: (case name=option212 index=212) +// CHECK-32: (case name=option213 index=213) +// CHECK-32: (case name=option214 index=214) +// CHECK-32: (case name=option215 index=215) +// CHECK-32: (case name=option216 index=216) +// CHECK-32: (case name=option217 index=217) +// CHECK-32: (case name=option218 index=218) +// CHECK-32: (case name=option219 index=219) +// CHECK-32: (case name=option220 index=220) +// CHECK-32: (case name=option221 index=221) +// CHECK-32: (case name=option222 index=222) +// CHECK-32: (case name=option223 index=223) +// CHECK-32: (case name=option224 index=224) +// CHECK-32: (case name=option225 index=225) +// CHECK-32: (case name=option226 index=226) +// CHECK-32: (case name=option227 index=227) +// CHECK-32: (case name=option228 index=228) +// CHECK-32: (case name=option229 index=229) +// CHECK-32: (case name=option230 index=230) +// CHECK-32: (case name=option231 index=231) +// CHECK-32: (case name=option232 index=232) +// CHECK-32: (case name=option233 index=233) +// CHECK-32: (case name=option234 index=234) +// CHECK-32: (case name=option235 index=235) +// CHECK-32: (case name=option236 index=236) +// CHECK-32: (case name=option237 index=237) +// CHECK-32: (case name=option238 index=238) +// CHECK-32: (case name=option239 index=239) +// CHECK-32: (case name=option240 index=240) +// CHECK-32: (case name=option241 index=241) +// CHECK-32: (case name=option242 index=242) +// CHECK-32: (case name=option243 index=243) +// CHECK-32: (case name=option244 index=244) +// CHECK-32: (case name=option245 index=245) +// CHECK-32: (case name=option246 index=246) +// CHECK-32: (case name=option247 index=247) +// CHECK-32: (case name=option248 index=248) +// CHECK-32: (case name=option249 index=249) +// CHECK-32: (case name=option250 index=250) +// CHECK-32: (case name=option251 index=251) +// CHECK-32: (case name=option252 index=252) +// CHECK-32: (case name=option253 index=253))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1)))) + doneReflecting() diff --git a/validation-test/Reflection/reflect_Enum_NoCase.swift b/validation-test/Reflection/reflect_Enum_NoCase.swift index 537750d6308d3..ca6a1132b0f5f 100644 --- a/validation-test/Reflection/reflect_Enum_NoCase.swift +++ b/validation-test/Reflection/reflect_Enum_NoCase.swift @@ -31,44 +31,59 @@ reflect(object: ClassWithNoCaseEnum()) // CHECK-64: (class_instance size=31 alignment=1 stride=31 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=e1 offset=16 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e2 offset=17 // CHECK-64: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e3 offset=19 // CHECK-64: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e4 offset=22 // CHECK-64: (single_payload_enum size=4 alignment=1 stride=4 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e5 offset=26 // CHECK-64: (single_payload_enum size=5 alignment=1 stride=5 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=4 alignment=1 stride=4 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1))))))))))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1)))) // CHECK-32: Reflecting an object. // CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} @@ -79,44 +94,58 @@ reflect(object: ClassWithNoCaseEnum()) // CHECK-32: (class_instance size=23 alignment=1 stride=23 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=e1 offset=8 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e2 offset=9 // CHECK-32: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e3 offset=11 // CHECK-32: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e4 offset=14 // CHECK-32: (single_payload_enum size=4 alignment=1 stride=4 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e5 offset=18 // CHECK-32: (single_payload_enum size=5 alignment=1 stride=5 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=4 alignment=1 stride=4 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=3 alignment=1 stride=3 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1))))))))))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1)))) doneReflecting() diff --git a/validation-test/Reflection/reflect_Enum_SingleCaseIntPayload.swift b/validation-test/Reflection/reflect_Enum_SingleCaseIntPayload.swift new file mode 100644 index 0000000000000..c2084141fe6b0 --- /dev/null +++ b/validation-test/Reflection/reflect_Enum_SingleCaseIntPayload.swift @@ -0,0 +1,119 @@ +// RUN: %empty-directory(%t) +// RUN: %target-build-swift -g -lswiftSwiftReflectionTest %s -o %t/reflect_Enum_SingleCaseIntPayload +// RUN: %target-codesign %t/reflect_Enum_SingleCaseIntPayload + +// RUN: %target-run %target-swift-reflection-test %t/reflect_Enum_SingleCaseIntPayload | %FileCheck %s --check-prefix=CHECK-%target-ptrsize + +// REQUIRES: objc_interop +// REQUIRES: executable_test + +import SwiftReflectionTest + +enum SingleCaseIntPayloadEnum { +case only(Int) +} + +class ClassWithSingleCaseIntPayloadEnum { + var e1: SingleCaseIntPayloadEnum? + var e2: SingleCaseIntPayloadEnum = .only(1) + var e3: SingleCaseIntPayloadEnum? = .some(.only(2)) + var e4: SingleCaseIntPayloadEnum?? +} + +reflect(object: ClassWithSingleCaseIntPayloadEnum()) + +// CHECK-64: Reflecting an object. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64: Type reference: +// CHECK-64: (class reflect_Enum_SingleCaseIntPayload.ClassWithSingleCaseIntPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64: (class_instance size=66 alignment=8 stride=72 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=e1 offset=16 +// CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=_value offset=0 +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (field name=e2 offset=32 +// CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=_value offset=0 +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (field name=e3 offset=40 +// CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=_value offset=0 +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (field name=e4 offset=56 +// CHECK-64: (single_payload_enum size=10 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=_value offset=0 +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1)))) + +// CHECK-32: Reflecting an object. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32: Type reference: +// CHECK-32: (class reflect_Enum_SingleCaseIntPayload.ClassWithSingleCaseIntPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32: (class_instance size=34 alignment=4 stride=36 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (field name=e1 offset=8 +// CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (field name=_value offset=0 +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (field name=e2 offset=16 +// CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (field name=_value offset=0 +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-32: (field name=e3 offset=20 +// CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (field name=_value offset=0 +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (field name=e4 offset=28 +// CHECK-32: (single_payload_enum size=6 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (field name=_value offset=0 +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-32: (case name=none index=1)) +// CHECK-32: (case name=none index=1)))) + +reflect(enum: SingleCaseIntPayloadEnum.only(77)) + +// CHECK-64: Reflecting an enum. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} + +// CHECK-64: Type reference: +// CHECK-64: (enum reflect_Enum_SingleCaseIntPayload.SingleCaseIntPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=_value offset=0 +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))) + +// CHECK-64: Enum value: +// CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=_value offset=0 +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))) + +doneReflecting() + +// CHECK-64: Done. + +// CHECK-32: Done. diff --git a/validation-test/Reflection/reflect_Enum_SingleCaseNoPayload.swift b/validation-test/Reflection/reflect_Enum_SingleCaseNoPayload.swift index 98a61263b3b69..5f86f7aae6bf9 100644 --- a/validation-test/Reflection/reflect_Enum_SingleCaseNoPayload.swift +++ b/validation-test/Reflection/reflect_Enum_SingleCaseNoPayload.swift @@ -37,18 +37,25 @@ reflect(object: ClassWithSingleCaseNoPayloadEnum()) // CHECK-64: (class_instance size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=e1 offset=16 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=default index=0))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e2 offset=17 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=default index=0))) // CHECK-64: (field name=e3 offset=17 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=default index=0))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e4 offset=18 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=default index=0))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=marker offset=24 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 @@ -65,20 +72,28 @@ reflect(object: ClassWithSingleCaseNoPayloadEnum()) // CHECK-32: (class_instance size=16 alignment=4 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=e1 offset=8 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=default index=0))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e2 offset=9 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)) +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=default index=0))) // CHECK-32: (field name=e3 offset=9 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=default index=0))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e4 offset=10 // CHECK-32: (single_payload_enum size=2 alignment=1 stride=2 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=default index=0))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=marker offset=12 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 @@ -86,6 +101,32 @@ reflect(object: ClassWithSingleCaseNoPayloadEnum()) // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1))))))) +reflect(enum: SingleCaseNoPayloadEnum.`default`) + +// CHECK-64: Reflecting an enum. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64: Type reference: +// CHECK-64: (enum reflect_Enum_SingleCaseNoPayload.SingleCaseNoPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (case name=default index=0)) + +// CHECK-64: Enum value: +// CHECK-64: (enum_value name=default index=0) + +// CHECK-32: Reflecting an enum. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32: Type reference: +// CHECK-32: (enum reflect_Enum_SingleCaseNoPayload.SingleCaseNoPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (case name=default index=0)) + +// CHECK-32: Enum value: +// CHECK-32: (enum_value name=default index=0) + doneReflecting() // CHECK-64: Done. diff --git a/validation-test/Reflection/reflect_Enum_SingleCasePointerPayload.swift b/validation-test/Reflection/reflect_Enum_SingleCasePointerPayload.swift index 5cac117d30283..12f09c6807cbb 100644 --- a/validation-test/Reflection/reflect_Enum_SingleCasePointerPayload.swift +++ b/validation-test/Reflection/reflect_Enum_SingleCasePointerPayload.swift @@ -35,20 +35,24 @@ reflect(object: ClassWithSingleCasePointerPayloadEnum()) // CHECK-64: (class_instance size=48 alignment=8 stride=48 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=e1 offset=16 // CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (reference kind=strong refcounting=native)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e2 offset=24 // CHECK-64: (reference kind=strong refcounting=native)) // CHECK-64: (field name=e3 offset=32 // CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (reference kind=strong refcounting=native)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e4 offset=40 // CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483645 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (reference kind=strong refcounting=native))))))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1)))) // CHECK-32: Reflecting an object. // CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} @@ -59,20 +63,50 @@ reflect(object: ClassWithSingleCasePointerPayloadEnum()) // CHECK-32: (class_instance size=24 alignment=4 stride=24 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=e1 offset=8 // CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (reference kind=strong refcounting=native)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e2 offset=12 // CHECK-32: (reference kind=strong refcounting=native)) // CHECK-32: (field name=e3 offset=16 // CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (reference kind=strong refcounting=native)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e4 offset=20 // CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4094 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (reference kind=strong refcounting=native))))))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1)))) + +reflect(enum: SingleCasePointerPayloadEnum.only(Marker())) + +// CHECK-64: Reflecting an enum. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} + +// CHECK-64: Type reference: +// CHECK-64: (enum reflect_Enum_SingleCasePointerPayload.SingleCasePointerPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64: (reference kind=strong refcounting=native) + +// CHECK-64: Enum value: +// CHECK-64: (reference kind=strong refcounting=native) + +// CHECK-32: Reflecting an enum. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} + +// CHECK-32: Type reference: +// CHECK-32: (enum reflect_Enum_SingleCasePointerPayload.SingleCasePointerPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32: (reference kind=strong refcounting=native) + +// CHECK-32: Enum value: +// CHECK-32: (reference kind=strong refcounting=native) doneReflecting() diff --git a/validation-test/Reflection/reflect_Enum_TwoCaseNoPayload.swift b/validation-test/Reflection/reflect_Enum_TwoCaseNoPayload.swift index 219eeee88fda1..81cf39b15468a 100644 --- a/validation-test/Reflection/reflect_Enum_TwoCaseNoPayload.swift +++ b/validation-test/Reflection/reflect_Enum_TwoCaseNoPayload.swift @@ -40,20 +40,33 @@ reflect(object: ClassWithTwoCaseNoPayloadEnum()) // CHECK-64: (class_instance size=32 alignment=8 stride=32 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=e1 offset=16 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e2 offset=17 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)) +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1))) // CHECK-64: (field name=e3 offset=18 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)) +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1))) // CHECK-64: (field name=e4 offset=19 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e5 offset=20 // CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 -// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)))) +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=marker offset=24 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 @@ -70,20 +83,33 @@ reflect(object: ClassWithTwoCaseNoPayloadEnum()) // CHECK-32: (class_instance size=20 alignment=4 stride=20 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=e1 offset=8 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e2 offset=9 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)) +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1))) // CHECK-32: (field name=e3 offset=10 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)) +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1))) // CHECK-32: (field name=e4 offset=11 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e5 offset=12 // CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 -// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1)))) +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=marker offset=16 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 @@ -91,6 +117,138 @@ reflect(object: ClassWithTwoCaseNoPayloadEnum()) // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1))))))) +reflect(enum: TwoCaseNoPayloadEnum.preferred) + +// CHECK-64: Reflecting an enum. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64: Type reference: +// CHECK-64: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1)) + +// CHECK-64: Enum value: +// CHECK-64: (enum_value name=preferred index=0) + +// CHECK-32: Reflecting an enum. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32: Type reference: +// CHECK-32: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1)) + +// CHECK-32: Enum value: +// CHECK-32: (enum_value name=preferred index=0) + +reflect(enum: TwoCaseNoPayloadEnum.other) + +// CHECK-64: Reflecting an enum. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64: Type reference: +// CHECK-64: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1)) + +// CHECK-64: Enum value: +// CHECK-64: (enum_value name=other index=1) + +// CHECK-32: Reflecting an enum. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32: Type reference: +// CHECK-32: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1)) + +// CHECK-32: Enum value: +// CHECK-32: (enum_value name=other index=1) + +reflect(enum: Optional.some(.other)) + +// CHECK-64: Reflecting an enum. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64: Type reference: +// CHECK-64: (bound_generic_enum Swift.Optional +// CHECK-64: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum)) + +// CHECK-64: Type info: +// CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK-64: (case name=some index=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1))) +// CHECK-64: (case name=none index=1)) + +// CHECK-64: Enum value: +// CHECK-64: (enum_value name=some index=0 +// CHECK-64: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum) +// CHECK-64: ) + +// CHECK-32: Reflecting an enum. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32: Type reference: +// CHECK-32: (bound_generic_enum Swift.Optional +// CHECK-32: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum)) + +// CHECK-32: Type info: +// CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK-32: (case name=some index=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1))) +// CHECK-32: (case name=none index=1)) + +// CHECK-32: Enum value: +// CHECK-32: (enum_value name=some index=0 +// CHECK-32: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum) +// CHECK-32: ) + +reflect(enum: Optional.none) + +// CHECK-64: Reflecting an enum. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64: Type reference: +// CHECK-64: (bound_generic_enum Swift.Optional +// CHECK-64: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum)) + +// CHECK-64: Type info: +// CHECK-64: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK-64: (case name=some index=0 +// CHECK-64: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-64: (case name=preferred index=0) +// CHECK-64: (case name=other index=1))) +// CHECK-64: (case name=none index=1)) + +// CHECK-64: Enum value: +// CHECK-64: (enum_value name=none index=1) + +// CHECK-32: Reflecting an enum. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32: Type reference: +// CHECK-32: (bound_generic_enum Swift.Optional +// CHECK-32: (enum reflect_Enum_TwoCaseNoPayload.TwoCaseNoPayloadEnum)) + +// CHECK-32: Type info: +// CHECK-32: (single_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK-32: (case name=some index=0 +// CHECK-32: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=254 bitwise_takable=1 +// CHECK-32: (case name=preferred index=0) +// CHECK-32: (case name=other index=1))) +// CHECK-32: (case name=none index=1)) + +// CHECK-32: Enum value: +// CHECK-32: (enum_value name=none index=1) + doneReflecting() // CHECK-64: Done. diff --git a/validation-test/Reflection/reflect_Enum_TwoCaseOnePointerPayload.swift b/validation-test/Reflection/reflect_Enum_TwoCaseOnePointerPayload.swift new file mode 100644 index 0000000000000..16de7ce5c2cbf --- /dev/null +++ b/validation-test/Reflection/reflect_Enum_TwoCaseOnePointerPayload.swift @@ -0,0 +1,209 @@ +// RUN: %empty-directory(%t) +// RUN: %target-build-swift -g -lswiftSwiftReflectionTest %s -o %t/reflect_Enum_TwoCaseOnePointerPayload +// RUN: %target-codesign %t/reflect_Enum_TwoCaseOnePointerPayload + +// RUN: %target-run %target-swift-reflection-test %t/reflect_Enum_TwoCaseOnePointerPayload | %FileCheck %s --check-prefix=CHECK-%target-ptrsize + +// REQUIRES: objc_interop +// REQUIRES: executable_test + +import SwiftReflectionTest + +class Marker { + let value = 1 +} + +// Note: Reference/pointer types have extra inhabitants, so +// the enum can use those. As a result, this enum should +// be the same size as a pointer. +enum TwoCaseOnePointerPayloadEnum { +case valid(Marker) +case invalid +} + +class ClassWithTwoCaseOnePointerPayloadEnum { + var e1: TwoCaseOnePointerPayloadEnum? + var e2: TwoCaseOnePointerPayloadEnum = .valid(Marker()) + var e3: TwoCaseOnePointerPayloadEnum = .invalid + var e4: TwoCaseOnePointerPayloadEnum? = .valid(Marker()) + var e5: TwoCaseOnePointerPayloadEnum? = .invalid + var e6: TwoCaseOnePointerPayloadEnum?? +} + +reflect(object: ClassWithTwoCaseOnePointerPayloadEnum()) + +// CHECK-64: Reflecting an object. +// CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64: Type reference: +// CHECK-64: (class reflect_Enum_TwoCaseOnePointerPayload.ClassWithTwoCaseOnePointerPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64: (class_instance size=64 alignment=8 stride=64 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64: (field name=e1 offset=16 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483645 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64: (case name=valid index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (field name=e2 offset=24 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64: (case name=valid index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (field name=e3 offset=32 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64: (case name=valid index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (field name=e4 offset=40 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483645 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64: (case name=valid index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (field name=e5 offset=48 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483645 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64: (case name=valid index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (field name=e6 offset=56 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483644 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483645 bitwise_takable=1 +// CHECK-64: (case name=some index=0 offset=0 +// CHECK-64: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64: (case name=valid index=0 offset=0 +// CHECK-64: (reference kind=strong refcounting=native)) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1)))) + +// CHECK-32: Reflecting an object. +// CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32: Type reference: +// CHECK-32: (class reflect_Enum_TwoCaseOnePointerPayload.ClassWithTwoCaseOnePointerPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32: (class_instance size=32 alignment=4 stride=32 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32: (field name=e1 offset=8 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4094 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32: (case name=valid index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (field name=e2 offset=12 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32: (case name=valid index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (field name=e3 offset=16 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32: (case name=valid index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=invalid index=1) +// CHECK-32: (field name=e4 offset=20 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4094 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32: (case name=valid index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (field name=e5 offset=24 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4094 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32: (case name=valid index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (field name=e6 offset=28 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4093 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4094 bitwise_takable=1 +// CHECK-32: (case name=some index=0 offset=0 +// CHECK-32: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32: (case name=valid index=0 offset=0 +// CHECK-32: (reference kind=strong refcounting=native)) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1)))) + +reflect(enum: TwoCaseOnePointerPayloadEnum.valid(Marker())) + +// CHECK-64: Reflecting an enum. +// CHECK-64-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64-NEXT: Type reference: +// CHECK-64-NEXT: (enum reflect_Enum_TwoCaseOnePointerPayload.TwoCaseOnePointerPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64-NEXT: (case name=valid index=0 offset=0 +// CHECK-64-NEXT: (reference kind=strong refcounting=native)) +// CHECK-64-NEXT: (case name=invalid index=1)) + +// CHECK-64: Enum value: +// CHECK-64-NEXT: (enum_value name=valid index=0 +// CHECK-64-NEXT: (class reflect_Enum_TwoCaseOnePointerPayload.Marker) +// CHECK-64-NEXT: ) + +// CHECK-32: Reflecting an enum. +// CHECK-32-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32-NEXT: Type reference: +// CHECK-32-NEXT: (enum reflect_Enum_TwoCaseOnePointerPayload.TwoCaseOnePointerPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32-NEXT: (case name=valid index=0 offset=0 +// CHECK-32-NEXT: (reference kind=strong refcounting=native)) +// CHECK-32-NEXT: (case name=invalid index=1)) + +// CHECK-32: Enum value: +// CHECK-32-NEXT: (enum_value name=valid index=0 +// CHECK-32-NEXT: (class reflect_Enum_TwoCaseOnePointerPayload.Marker) +// CHECK-32-NEXT: ) + +reflect(enum: TwoCaseOnePointerPayloadEnum.invalid) + +// CHECK-64: Reflecting an enum. +// CHECK-64-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-64-NEXT: Type reference: +// CHECK-64-NEXT: (enum reflect_Enum_TwoCaseOnePointerPayload.TwoCaseOnePointerPayloadEnum) + +// CHECK-64: Type info: +// CHECK-64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483646 bitwise_takable=1 +// CHECK-64-NEXT: (case name=valid index=0 offset=0 +// CHECK-64-NEXT: (reference kind=strong refcounting=native)) +// CHECK-64-NEXT: (case name=invalid index=1)) + +// CHECK-64: Enum value: +// CHECK-64-NEXT: (enum_value name=invalid index=1) + +// CHECK-32: Reflecting an enum. +// CHECK-32-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-32-NEXT: Type reference: +// CHECK-32-NEXT: (enum reflect_Enum_TwoCaseOnePointerPayload.TwoCaseOnePointerPayloadEnum) + +// CHECK-32: Type info: +// CHECK-32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4095 bitwise_takable=1 +// CHECK-32-NEXT: (case name=valid index=0 offset=0 +// CHECK-32-NEXT: (reference kind=strong refcounting=native)) +// CHECK-32-NEXT: (case name=invalid index=1)) + +// CHECK-32: Enum value: +// CHECK-32-NEXT: (enum_value name=invalid index=1) + +doneReflecting() + +// CHECK-64: Done. + +// CHECK-32: Done. diff --git a/validation-test/Reflection/reflect_Enum_TwoCaseOnePayload.swift b/validation-test/Reflection/reflect_Enum_TwoCaseOneStructPayload.swift similarity index 53% rename from validation-test/Reflection/reflect_Enum_TwoCaseOnePayload.swift rename to validation-test/Reflection/reflect_Enum_TwoCaseOneStructPayload.swift index e3b83de75c057..afb3380658791 100644 --- a/validation-test/Reflection/reflect_Enum_TwoCaseOnePayload.swift +++ b/validation-test/Reflection/reflect_Enum_TwoCaseOneStructPayload.swift @@ -1,168 +1,249 @@ // RUN: %empty-directory(%t) -// RUN: %target-build-swift -g -lswiftSwiftReflectionTest %s -o %t/reflect_Enum_TwoCaseOnePayload -// RUN: %target-codesign %t/reflect_Enum_TwoCaseOnePayload +// RUN: %target-build-swift -g -lswiftSwiftReflectionTest %s -o %t/reflect_Enum_TwoCaseOneStructPayload +// RUN: %target-codesign %t/reflect_Enum_TwoCaseOneStructPayload -// RUN: %target-run %target-swift-reflection-test %t/reflect_Enum_TwoCaseOnePayload | %FileCheck %s --check-prefix=CHECK-%target-ptrsize +// RUN: %target-run %target-swift-reflection-test %t/reflect_Enum_TwoCaseOneStructPayload | %FileCheck %s --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-ALL // REQUIRES: objc_interop // REQUIRES: executable_test import SwiftReflectionTest +// Note: struct Marker has no extra inhabitants, so the enum will use a separate tag struct Marker { let value = 1 } -enum TwoCaseOnePayloadEnum { +enum TwoCaseOneStructPayloadEnum { case valid(Marker) case invalid } -class ClassWithTwoCaseOnePayloadEnum { - var e1: TwoCaseOnePayloadEnum? - var e2: TwoCaseOnePayloadEnum = .valid(Marker()) - var e3: TwoCaseOnePayloadEnum = .invalid - var e4: TwoCaseOnePayloadEnum? = .valid(Marker()) - var e5: TwoCaseOnePayloadEnum? = .invalid - var e6: TwoCaseOnePayloadEnum?? +class ClassWithTwoCaseOneStructPayloadEnum { + var e1: TwoCaseOneStructPayloadEnum? + var e2: TwoCaseOneStructPayloadEnum = .valid(Marker()) + var e3: TwoCaseOneStructPayloadEnum = .invalid + var e4: TwoCaseOneStructPayloadEnum? = .valid(Marker()) + var e5: TwoCaseOneStructPayloadEnum? = .invalid + var e6: TwoCaseOneStructPayloadEnum?? } -reflect(object: ClassWithTwoCaseOnePayloadEnum()) +reflect(object: ClassWithTwoCaseOneStructPayloadEnum()) // CHECK-64: Reflecting an object. // CHECK-64: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} // CHECK-64: Type reference: -// CHECK-64: (class reflect_Enum_TwoCaseOnePayload.ClassWithTwoCaseOnePayloadEnum) +// CHECK-64: (class reflect_Enum_TwoCaseOneStructPayload.ClassWithTwoCaseOneStructPayloadEnum) // CHECK-64: Type info: // CHECK-64: (class_instance size=107 alignment=8 stride=112 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=e1 offset=16 // CHECK-64: (single_payload_enum size=10 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e2 offset=32 // CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=invalid index=1))) // CHECK-64: (field name=e3 offset=48 // CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=invalid index=1))) // CHECK-64: (field name=e4 offset=64 // CHECK-64: (single_payload_enum size=10 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e5 offset=80 // CHECK-64: (single_payload_enum size=10 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e6 offset=96 // CHECK-64: (single_payload_enum size=11 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=10 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=invalid index=1))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1)))) // CHECK-32: Reflecting an object. // CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} // CHECK-32: Type reference: -// CHECK-32: (class reflect_Enum_TwoCaseOnePayload.ClassWithTwoCaseOnePayloadEnum) +// CHECK-32: (class reflect_Enum_TwoCaseOneStructPayload.ClassWithTwoCaseOneStructPayloadEnum) // CHECK-32: Type info: // CHECK-32: (class_instance size=55 alignment=4 stride=56 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=e1 offset=8 // CHECK-32: (single_payload_enum size=6 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e2 offset=16 // CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=invalid index=1))) // CHECK-32: (field name=e3 offset=24 // CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=invalid index=1))) // CHECK-32: (field name=e4 offset=32 // CHECK-32: (single_payload_enum size=6 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e5 offset=40 // CHECK-32: (single_payload_enum size=6 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e6 offset=48 // CHECK-32: (single_payload_enum size=7 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=6 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1))))))))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=invalid index=1))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1)))) -doneReflecting() +reflect(enum: TwoCaseOneStructPayloadEnum.valid(Marker())) + +// CHECK-ALL: Reflecting an enum. +// CHECK-ALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-ALL-NEXT: Type reference: +// CHECK-ALL-NEXT: (enum reflect_Enum_TwoCaseOneStructPayload.TwoCaseOneStructPayloadEnum) + +// CHECK-ALL: Type info: +// CHECK-64-NEXT: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64-NEXT: (case name=valid index=0 offset=0 +// CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64-NEXT: (field name=value offset=0 +// CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64-NEXT: (field name=_value offset=0 +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64-NEXT: (case name=invalid index=1)) + +// CHECK-32-NEXT: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32-NEXT: (case name=valid index=0 offset=0 +// CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32-NEXT: (field name=value offset=0 +// CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32-NEXT: (field name=_value offset=0 +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32-NEXT: (case name=invalid index=1)) + +// CHECK-ALL: Enum value: +// CHECK-ALL-NEXT: (enum_value name=valid index=0 +// CHECK-ALL-NEXT: (struct reflect_Enum_TwoCaseOneStructPayload.Marker) +// CHECK-ALL-NEXT: ) + +reflect(enum: TwoCaseOneStructPayloadEnum.invalid) -// CHECK-64: Done. +// CHECK-ALL: Reflecting an enum. +// CHECK-ALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-ALL-NEXT: Type reference: +// CHECK-ALL-NEXT: (enum reflect_Enum_TwoCaseOneStructPayload.TwoCaseOneStructPayloadEnum) + +// CHECK-ALL: Type info: +// CHECK-64-NEXT: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64-NEXT: (case name=valid index=0 offset=0 +// CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64-NEXT: (field name=value offset=0 +// CHECK-64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-64-NEXT: (field name=_value offset=0 +// CHECK-64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64-NEXT: (case name=invalid index=1)) + +// CHECK-32-NEXT: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32-NEXT: (case name=valid index=0 offset=0 +// CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32-NEXT: (field name=value offset=0 +// CHECK-32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-32-NEXT: (field name=_value offset=0 +// CHECK-32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32-NEXT: (case name=invalid index=1)) + +// CHECK-ALL: Enum value: +// CHECK-ALL-NEXT: (enum_value name=invalid index=1) + +doneReflecting() -// CHECK-32: Done. +// CHECK-ALL: Done. diff --git a/validation-test/Reflection/reflect_Enum_TwoCaseTwoPayloads.swift b/validation-test/Reflection/reflect_Enum_TwoCaseTwoPayloads.swift index dd640eb450c1b..0382910f0cc48 100644 --- a/validation-test/Reflection/reflect_Enum_TwoCaseTwoPayloads.swift +++ b/validation-test/Reflection/reflect_Enum_TwoCaseTwoPayloads.swift @@ -39,9 +39,9 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-64: (class_instance size=153 alignment=8 stride=160 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=e1 offset=16 // CHECK-64: (single_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 @@ -51,13 +51,14 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-64: (field name=invalid offset=0 +// CHECK-64: (case name=invalid index=1 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e2 offset=40 // CHECK-64: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 @@ -67,13 +68,13 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-64: (field name=invalid offset=0 +// CHECK-64: (case name=invalid index=1 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) // CHECK-64: (field name=e3 offset=64 // CHECK-64: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 @@ -83,15 +84,15 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-64: (field name=invalid offset=0 +// CHECK-64: (case name=invalid index=1 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) // CHECK-64: (field name=e4 offset=88 // CHECK-64: (single_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 @@ -101,15 +102,16 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-64: (field name=invalid offset=0 +// CHECK-64: (case name=invalid index=1 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e5 offset=112 // CHECK-64: (single_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 @@ -119,17 +121,18 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-64: (field name=invalid offset=0 +// CHECK-64: (case name=invalid index=1 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=none index=1))) // CHECK-64: (field name=e6 offset=136 // CHECK-64: (single_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=252 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (single_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-64: (field name=some offset=0 +// CHECK-64: (case name=some index=0 offset=0 // CHECK-64: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-64: (field name=valid offset=0 +// CHECK-64: (case name=valid index=0 offset=0 // CHECK-64: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=value offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 @@ -139,10 +142,12 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 // CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-64: (field name=invalid offset=0 +// CHECK-64: (case name=invalid index=1 offset=0 // CHECK-64: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-64: (field name=_value offset=0 -// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))))))))) +// CHECK-64: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-64: (case name=none index=1))) +// CHECK-64: (case name=none index=1)))) // CHECK-32: Reflecting an object. // CHECK-32: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} @@ -153,9 +158,9 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-32: (class_instance size=77 alignment=4 stride=80 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=e1 offset=8 // CHECK-32: (single_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (multi_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=8 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 @@ -165,13 +170,14 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-32: (field name=invalid offset=0 +// CHECK-32: (case name=invalid index=1 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e2 offset=20 // CHECK-32: (multi_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=8 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 @@ -181,13 +187,13 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-32: (field name=invalid offset=0 +// CHECK-32: (case name=invalid index=1 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) // CHECK-32: (field name=e3 offset=32 // CHECK-32: (multi_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=8 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 @@ -197,15 +203,15 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-32: (field name=invalid offset=0 +// CHECK-32: (case name=invalid index=1 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) // CHECK-32: (field name=e4 offset=44 // CHECK-32: (single_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (multi_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=8 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 @@ -215,15 +221,16 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-32: (field name=invalid offset=0 +// CHECK-32: (case name=invalid index=1 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e5 offset=56 // CHECK-32: (single_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (multi_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=8 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 @@ -233,17 +240,18 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-32: (field name=invalid offset=0 +// CHECK-32: (case name=invalid index=1 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=none index=1))) // CHECK-32: (field name=e6 offset=68 // CHECK-32: (single_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=252 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (single_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 -// CHECK-32: (field name=some offset=0 +// CHECK-32: (case name=some index=0 offset=0 // CHECK-32: (multi_payload_enum size=9 alignment=4 stride=12 num_extra_inhabitants=254 bitwise_takable=1 -// CHECK-32: (field name=valid offset=0 +// CHECK-32: (case name=valid index=0 offset=0 // CHECK-32: (struct size=8 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=value offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 @@ -253,10 +261,12 @@ reflect(object: ClassWithTwoCaseTwoPayloadsEnum()) // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 // CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) -// CHECK-32: (field name=invalid offset=0 +// CHECK-32: (case name=invalid index=1 offset=0 // CHECK-32: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 // CHECK-32: (field name=_value offset=0 -// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1))))))))))) +// CHECK-32: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))))) +// CHECK-32: (case name=none index=1))) +// CHECK-32: (case name=none index=1)))) doneReflecting() diff --git a/validation-test/Reflection/reflect_Enum_value.swift b/validation-test/Reflection/reflect_Enum_value.swift new file mode 100644 index 0000000000000..9bebbb72a7c39 --- /dev/null +++ b/validation-test/Reflection/reflect_Enum_value.swift @@ -0,0 +1,253 @@ +// RUN: %empty-directory(%t) +// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Enum_value +// RUN: %target-codesign %t/reflect_Enum_value + +// RUN: %target-run %target-swift-reflection-test %t/reflect_Enum_value | tee /dev/stderr | %FileCheck %s --check-prefix=CHECK --check-prefix=X%target-ptrsize --dump-input=fail + +// REQUIRES: objc_interop +// REQUIRES: executable_test + +import Foundation +import SwiftReflectionTest + +enum OneCaseNoPayload { +case only +} + +reflect(enum: OneCaseNoPayload.only) + +// CHECK: Reflecting an enum. +// CHECK-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneCaseNoPayload) + +// CHECK: Type info: +// CHECK-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK-NEXT: (case name=only index=0)) + +// CHECK: Enum value: +// CHECK-NEXT: (enum_value name=only index=0) + +reflect(enumValue: Optional.some(.only)) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneCaseNoPayload)) +// CHECK-NEXT: Value: .some(.only) + +reflect(enumValue: Optional>.some(.some(.only))) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneCaseNoPayload))) +// CHECK-NEXT: Value: .some(.some(.only)) + +reflect(enumValue: Optional>.some(.none)) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneCaseNoPayload))) +// CHECK-NEXT: Value: .some(.none) + +struct StructInt { +var a: Int +} + +enum OneStructPayload { +case payloadA(StructInt) +case otherA +case otherB +} + +reflect(enumValue: OneStructPayload.payloadA(StructInt(a: 0))) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneStructPayload) +// CHECK-NEXT: Value: .payloadA(_) + +reflect(enumValue: OneStructPayload.otherA) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneStructPayload) +// CHECK-NEXT: Value: .otherA + +@objc class ObjCClass : NSObject { +var a: Int = 0 +} + +enum OneObjCPayload { +case payloadA(ObjCClass) +case otherA +case otherB +case otherC +case otherD +case otherE +} + +reflect(enumValue: OneObjCPayload.payloadA(ObjCClass())) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneObjCPayload) +// CHECK-NEXT: Value: .payloadA(_) + +reflect(enumValue: OneObjCPayload.otherC) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneObjCPayload) +// CHECK-NEXT: Value: .otherC + +class SwiftClass { +var a: Int = 0 +} + +enum OneSwiftClassPayload { +case payloadA(SwiftClass) +case otherA +case otherB +case otherC +case otherD +case otherE +} + +reflect(enumValue: OneSwiftClassPayload.payloadA(SwiftClass())) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload) +// CHECK-NEXT: Value: .payloadA(_) + +reflect(enum: OneSwiftClassPayload.otherC) + +// CHECK: Reflecting an enum. +// CHECK-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload) + +// CHECK: Type info: +// X64-NEXT: (single_payload_enum size=8 alignment=8 stride=8 num_extra_inhabitants=2147483642 bitwise_takable=1 +// X32-NEXT: (single_payload_enum size=4 alignment=4 stride=4 num_extra_inhabitants=4091 bitwise_takable=1 +// CHECK-NEXT: (case name=payloadA index=0 offset=0 +// CHECK-NEXT: (reference kind=strong refcounting=native)) +// CHECK-NEXT: (case name=otherA index=1) +// CHECK-NEXT: (case name=otherB index=2) +// CHECK-NEXT: (case name=otherC index=3) +// CHECK-NEXT: (case name=otherD index=4) +// CHECK-NEXT: (case name=otherE index=5)) + +// CHECK: Enum value: +// CHECK-NEXT: (enum_value name=otherC index=3) + +reflect(enumValue: Optional.none) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload)) +// CHECK-NEXT: Value: .none + +reflect(enumValue: Optional>.none) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload))) +// CHECK-NEXT: Value: .none + +reflect(enumValue: Optional>.some(.none)) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload))) +// CHECK-NEXT: Value: .some(.none) + +reflect(enumValue: Optional>.some(.some(.otherA))) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload))) +// CHECK-NEXT: Value: .some(.some(.otherA)) + +reflect(enumValue: Optional>.some(.some(.otherE))) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload))) +// CHECK-NEXT: Value: .some(.some(.otherE)) + +reflect(enumValue: Optional>.some(.some(.payloadA(SwiftClass())))) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneSwiftClassPayload))) +// CHECK-NEXT: Value: .some(.some(.payloadA(_))) + +struct MixedStruct { + var a = Int(0) + var b = SwiftClass() +} + +enum OneMixedStructPayload { +case otherA +case otherB +case payloadA(MixedStruct) +} + +reflect(enumValue: OneMixedStructPayload.otherA) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneMixedStructPayload) +// CHECK-NEXT: Value: .otherA + +reflect(enumValue: OneMixedStructPayload.payloadA(MixedStruct())) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneMixedStructPayload) +// CHECK-NEXT: Value: .payloadA(_) + +reflect(enumValue: Optional.none) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (bound_generic_enum Swift.Optional +// CHECK-NEXT: (enum reflect_Enum_value.OneMixedStructPayload)) +// CHECK-NEXT: Value: .none + +enum OneNestedPayload { +case cargoA(OneMixedStructPayload) +case alternateA +case alternateB +case alternateC +} + +reflect(enumValue: OneNestedPayload.alternateB) + +// CHECK: Reflecting an enum value. +// CHECK-NEXT: Type reference: +// CHECK-NEXT: (enum reflect_Enum_value.OneNestedPayload) +// CHECK-NEXT: Value: .alternateB + +// XXX TODO: enum with tuple payload, enum with optional payload, indirect enum, enum with closure/function payload XXX + +doneReflecting() +// CHECK: Done. + diff --git a/validation-test/Reflection/reflect_Enum_values.swift b/validation-test/Reflection/reflect_Enum_values.swift new file mode 100644 index 0000000000000..0f4590fc53d74 --- /dev/null +++ b/validation-test/Reflection/reflect_Enum_values.swift @@ -0,0 +1,1658 @@ +// RUN: %empty-directory(%t) +// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Enum_values +// RUN: %target-codesign %t/reflect_Enum_values + +// RUN: %target-run %target-swift-reflection-test %t/reflect_Enum_values | tee /dev/stderr | %FileCheck %s --check-prefix=CHECK%target-ptrsize --check-prefix=CHECKALL --dump-input=fail + +// REQUIRES: objc_interop +// REQUIRES: executable_test + +import SwiftReflectionTest + +enum OneCaseNoPayload { + case only +} + +class OneCaseNoPayloadC { + var x = OneCaseNoPayload.only + var y = 42 +} +reflect(object: OneCaseNoPayloadC()) +// CHECKALL: Reflecting an object. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (class reflect_Enum_values.OneCaseNoPayloadC) + +// CHECKALL: Type info: +// CHECK64-NEXT: (class_instance size=24 alignment=8 stride=24 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=x offset=16 +// CHECK64-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (case name=only index=0))) +// CHECK64-NEXT: (field name=y offset=16 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1))))) + +// CHECK32-NEXT: (class_instance size=12 alignment=4 stride=12 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=x offset=8 +// CHECK32-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (case name=only index=0))) +// CHECK32-NEXT: (field name=y offset=8 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1))))) + +enum ManyCasesNoPayload { + case a, b, c, d +} + +class ManyCasesNoPayloadC { + var a = ManyCasesNoPayload.a + var b = ManyCasesNoPayload.b + var c = ManyCasesNoPayload.c + var d = ManyCasesNoPayload.d + var s = "beeep" +} +reflect(object: ManyCasesNoPayloadC()) + +// CHECKALL: Reflecting an object. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (class reflect_Enum_values.ManyCasesNoPayloadC) + +// CHECKALL: Type info: +// CHECK64-NEXT: (class_instance size=40 alignment=8 stride=40 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=a offset=16 +// CHECK32-NEXT: (class_instance size=24 alignment=4 stride=24 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=a offset=8 +// CHECKALL-NEXT: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1 +// CHECKALL-NEXT: (case name=a index=0) +// CHECKALL-NEXT: (case name=b index=1) +// CHECKALL-NEXT: (case name=c index=2) +// CHECKALL-NEXT: (case name=d index=3))) +// CHECK64-NEXT: (field name=b offset=17 +// CHECK32-NEXT: (field name=b offset=9 +// CHECKALL-NEXT: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1 +// CHECKALL-NEXT: (case name=a index=0) +// CHECKALL-NEXT: (case name=b index=1) +// CHECKALL-NEXT: (case name=c index=2) +// CHECKALL-NEXT: (case name=d index=3))) +// CHECK64-NEXT: (field name=c offset=18 +// CHECK32-NEXT: (field name=c offset=10 +// CHECKALL-NEXT: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1 +// CHECKALL-NEXT: (case name=a index=0) +// CHECKALL-NEXT: (case name=b index=1) +// CHECKALL-NEXT: (case name=c index=2) +// CHECKALL-NEXT: (case name=d index=3))) +// CHECK64-NEXT: (field name=d offset=19 +// CHECK32-NEXT: (field name=d offset=11 +// CHECKALL-NEXT: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1 +// CHECKALL-NEXT: (case name=a index=0) +// CHECKALL-NEXT: (case name=b index=1) +// CHECKALL-NEXT: (case name=c index=2) +// CHECKALL-NEXT: (case name=d index=3))) +// CHECK64-NEXT: (field name=s offset=24 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1))))))))) +// CHECK32-NEXT: (field name=s offset=12 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1))))))))))) + +enum VastNumberOfCasesNoPayload { + case option0 + case option1 + case option2 + case option3 + case option4 + case option5 + case option6 + case option7 + case option8 + case option9 + case option10 + case option11 + case option12 + case option13 + case option14 + case option15 + case option16 + case option17 + case option18 + case option19 + case option20 + case option21 + case option22 + case option23 + case option24 + case option25 + case option26 + case option27 + case option28 + case option29 + case option30 + case option31 + case option32 + case option33 + case option34 + case option35 + case option36 + case option37 + case option38 + case option39 + case option40 + case option41 + case option42 + case option43 + case option44 + case option45 + case option46 + case option47 + case option48 + case option49 + case option50 + case option51 + case option52 + case option53 + case option54 + case option55 + case option56 + case option57 + case option58 + case option59 + case option60 + case option61 + case option62 + case option63 + case option64 + case option65 + case option66 + case option67 + case option68 + case option69 + case option70 + case option71 + case option72 + case option73 + case option74 + case option75 + case option76 + case option77 + case option78 + case option79 + case option80 + case option81 + case option82 + case option83 + case option84 + case option85 + case option86 + case option87 + case option88 + case option89 + case option90 + case option91 + case option92 + case option93 + case option94 + case option95 + case option96 + case option97 + case option98 + case option99 + case option100 + case option101 + case option102 + case option103 + case option104 + case option105 + case option106 + case option107 + case option108 + case option109 + case option110 + case option111 + case option112 + case option113 + case option114 + case option115 + case option116 + case option117 + case option118 + case option119 + case option120 + case option121 + case option122 + case option123 + case option124 + case option125 + case option126 + case option127 + case option128 + case option129 + case option130 + case option131 + case option132 + case option133 + case option134 + case option135 + case option136 + case option137 + case option138 + case option139 + case option140 + case option141 + case option142 + case option143 + case option144 + case option145 + case option146 + case option147 + case option148 + case option149 + case option150 + case option151 + case option152 + case option153 + case option154 + case option155 + case option156 + case option157 + case option158 + case option159 + case option160 + case option161 + case option162 + case option163 + case option164 + case option165 + case option166 + case option167 + case option168 + case option169 + case option170 + case option171 + case option172 + case option173 + case option174 + case option175 + case option176 + case option177 + case option178 + case option179 + case option180 + case option181 + case option182 + case option183 + case option184 + case option185 + case option186 + case option187 + case option188 + case option189 + case option190 + case option191 + case option192 + case option193 + case option194 + case option195 + case option196 + case option197 + case option198 + case option199 + case option200 + case option201 + case option202 + case option203 + case option204 + case option205 + case option206 + case option207 + case option208 + case option209 + case option210 + case option211 + case option212 + case option213 + case option214 + case option215 + case option216 + case option217 + case option218 + case option219 + case option220 + case option221 + case option222 + case option223 + case option224 + case option225 + case option226 + case option227 + case option228 + case option229 + case option230 + case option231 + case option232 + case option233 + case option234 + case option235 + case option236 + case option237 + case option238 + case option239 + case option240 + case option241 + case option242 + case option243 + case option244 + case option245 + case option246 + case option247 + case option248 + case option249 + case option250 + case option251 + case option252 + case option253 + case option254 + case option255 + case option256 + case option257 +} + +enum ManyCasesOneIntPayload { +case payload(Int) +case otherA, otherB, otherC +} + +enum ManyCasesOneStringPayload { + case payload(String) + case otherA, otherB, otherC +} +class ManyCasesOnePayloadC { + var payload = ManyCasesOneStringPayload.payload("testString") + var a = ManyCasesOneStringPayload.otherA + var b = ManyCasesOneStringPayload.otherB + var c = ManyCasesOneStringPayload.otherC +} +reflect(object: ManyCasesOnePayloadC()) + +// CHECKALL: Reflecting an object. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (class reflect_Enum_values.ManyCasesOnePayloadC) + +// CHECKALL: Type info: +// CHECK64-NEXT: (class_instance size=80 alignment=8 stride=80 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=payload offset=16 +// CHECK64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=2147483644 bitwise_takable=1 +// CHECK64-NEXT: (case name=payload index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=otherA index=1) +// CHECK64-NEXT: (case name=otherB index=2) +// CHECK64-NEXT: (case name=otherC index=3))) +// CHECK64-NEXT: (field name=a offset=32 +// CHECK64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=2147483644 bitwise_takable=1 +// CHECK64-NEXT: (case name=payload index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=otherA index=1) +// CHECK64-NEXT: (case name=otherB index=2) +// CHECK64-NEXT: (case name=otherC index=3))) +// CHECK64-NEXT: (field name=b offset=48 +// CHECK64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=2147483644 bitwise_takable=1 +// CHECK64-NEXT: (case name=payload index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=otherA index=1) +// CHECK64-NEXT: (case name=otherB index=2) +// CHECK64-NEXT: (case name=otherC index=3))) +// CHECK64-NEXT: (field name=c offset=64 +// CHECK64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=2147483644 bitwise_takable=1 +// CHECK64-NEXT: (case name=payload index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1))))))) +// CHECK64-NEXT: (case name=otherA index=1) +// CHECK64-NEXT: (case name=otherB index=2) +// CHECK64-NEXT: (case name=otherC index=3))) + +// CHECK32-NEXT: (class_instance size=56 alignment=4 stride=56 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=payload offset=8 +// CHECK32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=250 bitwise_takable=1 +// CHECK32-NEXT: (case name=payload index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=otherA index=1) +// CHECK32-NEXT: (case name=otherB index=2) +// CHECK32-NEXT: (case name=otherC index=3))) +// CHECK32-NEXT: (field name=a offset=20 +// CHECK32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=250 bitwise_takable=1 +// CHECK32-NEXT: (case name=payload index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=otherA index=1) +// CHECK32-NEXT: (case name=otherB index=2) +// CHECK32-NEXT: (case name=otherC index=3))) +// CHECK32-NEXT: (field name=b offset=32 +// CHECK32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=250 bitwise_takable=1 +// CHECK32-NEXT: (case name=payload index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=otherA index=1) +// CHECK32-NEXT: (case name=otherB index=2) +// CHECK32-NEXT: (case name=otherC index=3))) +// CHECK32-NEXT: (field name=c offset=44 +// CHECK32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=250 bitwise_takable=1 +// CHECK32-NEXT: (case name=payload index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=otherA index=1) +// CHECK32-NEXT: (case name=otherB index=2) +// CHECK32-NEXT: (case name=otherC index=3)))) + +enum ManyCasesManyPayloads { + case a(String) + case b([Int]) + case extra + case c([String: String]) +} +class ManyCasesManyPayloadsC { + var a = ManyCasesManyPayloads.a("testString") + var b = ManyCasesManyPayloads.b([10, 20, 30]) + var c = ManyCasesManyPayloads.c(["name": "Telephone", "purpose": "Bothering"]) +} +reflect(object: ManyCasesManyPayloadsC()) + +// CHECKALL: Reflecting an object. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (class reflect_Enum_values.ManyCasesManyPayloadsC) + +// CHECKALL: Type info: +// CHECK64-NEXT: (class_instance size=81 alignment=8 stride=88 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=a offset=16 +// CHECK64-NEXT: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=252 bitwise_takable=1 +// CHECK64-NEXT: (case name=a index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=b index=1 offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_buffer offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_storage offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=rawValue offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=c index=2 offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_variant offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=object offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=rawValue offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=extra index=3))) +// CHECK64-NEXT: (field name=b offset=40 +// CHECK64-NEXT: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=252 bitwise_takable=1 +// CHECK64-NEXT: (case name=a index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=b index=1 offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_buffer offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_storage offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=rawValue offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=c index=2 offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_variant offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=object offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=rawValue offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=extra index=3))) +// CHECK64-NEXT: (field name=c offset=64 +// CHECK64-NEXT: (multi_payload_enum size=17 alignment=8 stride=24 num_extra_inhabitants=252 bitwise_takable=1 +// CHECK64-NEXT: (case name=a index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=b index=1 offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_buffer offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_storage offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=rawValue offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=c index=2 offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_variant offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=object offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=rawValue offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=extra index=3)))) + +// CHECK32-NEXT: (class_instance size=44 alignment=4 stride=44 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=a offset=8 +// CHECK32-NEXT: (multi_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=60 bitwise_takable=1 +// CHECK32-NEXT: (case name=a index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=b index=1 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_buffer offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_storage offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=rawValue offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))))) +// CHECK32-NEXT: (case name=c index=2 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_variant offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=rawValue offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))))) +// CHECK32-NEXT: (case name=extra index=3))) +// CHECK32-NEXT: (field name=b offset=20 +// CHECK32-NEXT: (multi_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=60 bitwise_takable=1 +// CHECK32-NEXT: (case name=a index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=b index=1 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_buffer offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_storage offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=rawValue offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))))) +// CHECK32-NEXT: (case name=c index=2 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_variant offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=rawValue offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))))) +// CHECK32-NEXT: (case name=extra index=3))) +// CHECK32-NEXT: (field name=c offset=32 +// CHECK32-NEXT: (multi_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=60 bitwise_takable=1 +// CHECK32-NEXT: (case name=a index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=b index=1 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_buffer offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_storage offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=rawValue offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))))) +// CHECK32-NEXT: (case name=c index=2 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=_variant offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=rawValue offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1)))))))) +// CHECK32-NEXT: (case name=extra index=3)))) + +reflect(enum: OneCaseNoPayload.only) + +// CHECKALL: Reflecting an enum. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (enum reflect_Enum_values.OneCaseNoPayload) + +// CHECKALL: Type info: +// CHECKALL-NEXT: (no_payload_enum size=0 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECKALL-NEXT: (case name=only index=0)) + +// CHECKALL: Enum value: +// CHECKALL-NEXT: (enum_value name=only index=0) + +reflect(enum: ManyCasesNoPayload.b) +// CHECKALL: Reflecting an enum. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (enum reflect_Enum_values.ManyCasesNoPayload) + +// CHECKALL: Type info: +// CHECKALL-NEXT: (no_payload_enum size=1 alignment=1 stride=1 num_extra_inhabitants=252 bitwise_takable=1 +// CHECKALL-NEXT: (case name=a index=0) +// CHECKALL-NEXT: (case name=b index=1) +// CHECKALL-NEXT: (case name=c index=2) +// CHECKALL-NEXT: (case name=d index=3)) + +// CHECKALL: Enum value: +// CHECKALL-NEXT: (enum_value name=b index=1) + +reflect(enum: VastNumberOfCasesNoPayload.option12) +// CHECKALL: Reflecting an enum. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (enum reflect_Enum_values.VastNumberOfCasesNoPayload) + +// CHECKALL: Type info: +// CHECKALL-NEXT: (no_payload_enum size=2 alignment=2 stride=2 num_extra_inhabitants=65278 bitwise_takable=1 +// CHECKALL-NEXT: (case name=option0 index=0) +// CHECKALL-NEXT: (case name=option1 index=1) +// CHECKALL-NEXT: (case name=option2 index=2) +// CHECKALL-NEXT: (case name=option3 index=3) +// CHECKALL-NEXT: (case name=option4 index=4) +// CHECKALL-NEXT: (case name=option5 index=5) +// CHECKALL-NEXT: (case name=option6 index=6) +// CHECKALL-NEXT: (case name=option7 index=7) +// CHECKALL-NEXT: (case name=option8 index=8) +// CHECKALL-NEXT: (case name=option9 index=9) +// CHECKALL-NEXT: (case name=option10 index=10) +// CHECKALL-NEXT: (case name=option11 index=11) +// CHECKALL-NEXT: (case name=option12 index=12) +// CHECKALL-NEXT: (case name=option13 index=13) +// CHECKALL-NEXT: (case name=option14 index=14) +// CHECKALL-NEXT: (case name=option15 index=15) +// CHECKALL-NEXT: (case name=option16 index=16) +// CHECKALL-NEXT: (case name=option17 index=17) +// CHECKALL-NEXT: (case name=option18 index=18) +// CHECKALL-NEXT: (case name=option19 index=19) +// CHECKALL-NEXT: (case name=option20 index=20) +// CHECKALL-NEXT: (case name=option21 index=21) +// CHECKALL-NEXT: (case name=option22 index=22) +// CHECKALL-NEXT: (case name=option23 index=23) +// CHECKALL-NEXT: (case name=option24 index=24) +// CHECKALL-NEXT: (case name=option25 index=25) +// CHECKALL-NEXT: (case name=option26 index=26) +// CHECKALL-NEXT: (case name=option27 index=27) +// CHECKALL-NEXT: (case name=option28 index=28) +// CHECKALL-NEXT: (case name=option29 index=29) +// CHECKALL-NEXT: (case name=option30 index=30) +// CHECKALL-NEXT: (case name=option31 index=31) +// CHECKALL-NEXT: (case name=option32 index=32) +// CHECKALL-NEXT: (case name=option33 index=33) +// CHECKALL-NEXT: (case name=option34 index=34) +// CHECKALL-NEXT: (case name=option35 index=35) +// CHECKALL-NEXT: (case name=option36 index=36) +// CHECKALL-NEXT: (case name=option37 index=37) +// CHECKALL-NEXT: (case name=option38 index=38) +// CHECKALL-NEXT: (case name=option39 index=39) +// CHECKALL-NEXT: (case name=option40 index=40) +// CHECKALL-NEXT: (case name=option41 index=41) +// CHECKALL-NEXT: (case name=option42 index=42) +// CHECKALL-NEXT: (case name=option43 index=43) +// CHECKALL-NEXT: (case name=option44 index=44) +// CHECKALL-NEXT: (case name=option45 index=45) +// CHECKALL-NEXT: (case name=option46 index=46) +// CHECKALL-NEXT: (case name=option47 index=47) +// CHECKALL-NEXT: (case name=option48 index=48) +// CHECKALL-NEXT: (case name=option49 index=49) +// CHECKALL-NEXT: (case name=option50 index=50) +// CHECKALL-NEXT: (case name=option51 index=51) +// CHECKALL-NEXT: (case name=option52 index=52) +// CHECKALL-NEXT: (case name=option53 index=53) +// CHECKALL-NEXT: (case name=option54 index=54) +// CHECKALL-NEXT: (case name=option55 index=55) +// CHECKALL-NEXT: (case name=option56 index=56) +// CHECKALL-NEXT: (case name=option57 index=57) +// CHECKALL-NEXT: (case name=option58 index=58) +// CHECKALL-NEXT: (case name=option59 index=59) +// CHECKALL-NEXT: (case name=option60 index=60) +// CHECKALL-NEXT: (case name=option61 index=61) +// CHECKALL-NEXT: (case name=option62 index=62) +// CHECKALL-NEXT: (case name=option63 index=63) +// CHECKALL-NEXT: (case name=option64 index=64) +// CHECKALL-NEXT: (case name=option65 index=65) +// CHECKALL-NEXT: (case name=option66 index=66) +// CHECKALL-NEXT: (case name=option67 index=67) +// CHECKALL-NEXT: (case name=option68 index=68) +// CHECKALL-NEXT: (case name=option69 index=69) +// CHECKALL-NEXT: (case name=option70 index=70) +// CHECKALL-NEXT: (case name=option71 index=71) +// CHECKALL-NEXT: (case name=option72 index=72) +// CHECKALL-NEXT: (case name=option73 index=73) +// CHECKALL-NEXT: (case name=option74 index=74) +// CHECKALL-NEXT: (case name=option75 index=75) +// CHECKALL-NEXT: (case name=option76 index=76) +// CHECKALL-NEXT: (case name=option77 index=77) +// CHECKALL-NEXT: (case name=option78 index=78) +// CHECKALL-NEXT: (case name=option79 index=79) +// CHECKALL-NEXT: (case name=option80 index=80) +// CHECKALL-NEXT: (case name=option81 index=81) +// CHECKALL-NEXT: (case name=option82 index=82) +// CHECKALL-NEXT: (case name=option83 index=83) +// CHECKALL-NEXT: (case name=option84 index=84) +// CHECKALL-NEXT: (case name=option85 index=85) +// CHECKALL-NEXT: (case name=option86 index=86) +// CHECKALL-NEXT: (case name=option87 index=87) +// CHECKALL-NEXT: (case name=option88 index=88) +// CHECKALL-NEXT: (case name=option89 index=89) +// CHECKALL-NEXT: (case name=option90 index=90) +// CHECKALL-NEXT: (case name=option91 index=91) +// CHECKALL-NEXT: (case name=option92 index=92) +// CHECKALL-NEXT: (case name=option93 index=93) +// CHECKALL-NEXT: (case name=option94 index=94) +// CHECKALL-NEXT: (case name=option95 index=95) +// CHECKALL-NEXT: (case name=option96 index=96) +// CHECKALL-NEXT: (case name=option97 index=97) +// CHECKALL-NEXT: (case name=option98 index=98) +// CHECKALL-NEXT: (case name=option99 index=99) +// CHECKALL-NEXT: (case name=option100 index=100) +// CHECKALL-NEXT: (case name=option101 index=101) +// CHECKALL-NEXT: (case name=option102 index=102) +// CHECKALL-NEXT: (case name=option103 index=103) +// CHECKALL-NEXT: (case name=option104 index=104) +// CHECKALL-NEXT: (case name=option105 index=105) +// CHECKALL-NEXT: (case name=option106 index=106) +// CHECKALL-NEXT: (case name=option107 index=107) +// CHECKALL-NEXT: (case name=option108 index=108) +// CHECKALL-NEXT: (case name=option109 index=109) +// CHECKALL-NEXT: (case name=option110 index=110) +// CHECKALL-NEXT: (case name=option111 index=111) +// CHECKALL-NEXT: (case name=option112 index=112) +// CHECKALL-NEXT: (case name=option113 index=113) +// CHECKALL-NEXT: (case name=option114 index=114) +// CHECKALL-NEXT: (case name=option115 index=115) +// CHECKALL-NEXT: (case name=option116 index=116) +// CHECKALL-NEXT: (case name=option117 index=117) +// CHECKALL-NEXT: (case name=option118 index=118) +// CHECKALL-NEXT: (case name=option119 index=119) +// CHECKALL-NEXT: (case name=option120 index=120) +// CHECKALL-NEXT: (case name=option121 index=121) +// CHECKALL-NEXT: (case name=option122 index=122) +// CHECKALL-NEXT: (case name=option123 index=123) +// CHECKALL-NEXT: (case name=option124 index=124) +// CHECKALL-NEXT: (case name=option125 index=125) +// CHECKALL-NEXT: (case name=option126 index=126) +// CHECKALL-NEXT: (case name=option127 index=127) +// CHECKALL-NEXT: (case name=option128 index=128) +// CHECKALL-NEXT: (case name=option129 index=129) +// CHECKALL-NEXT: (case name=option130 index=130) +// CHECKALL-NEXT: (case name=option131 index=131) +// CHECKALL-NEXT: (case name=option132 index=132) +// CHECKALL-NEXT: (case name=option133 index=133) +// CHECKALL-NEXT: (case name=option134 index=134) +// CHECKALL-NEXT: (case name=option135 index=135) +// CHECKALL-NEXT: (case name=option136 index=136) +// CHECKALL-NEXT: (case name=option137 index=137) +// CHECKALL-NEXT: (case name=option138 index=138) +// CHECKALL-NEXT: (case name=option139 index=139) +// CHECKALL-NEXT: (case name=option140 index=140) +// CHECKALL-NEXT: (case name=option141 index=141) +// CHECKALL-NEXT: (case name=option142 index=142) +// CHECKALL-NEXT: (case name=option143 index=143) +// CHECKALL-NEXT: (case name=option144 index=144) +// CHECKALL-NEXT: (case name=option145 index=145) +// CHECKALL-NEXT: (case name=option146 index=146) +// CHECKALL-NEXT: (case name=option147 index=147) +// CHECKALL-NEXT: (case name=option148 index=148) +// CHECKALL-NEXT: (case name=option149 index=149) +// CHECKALL-NEXT: (case name=option150 index=150) +// CHECKALL-NEXT: (case name=option151 index=151) +// CHECKALL-NEXT: (case name=option152 index=152) +// CHECKALL-NEXT: (case name=option153 index=153) +// CHECKALL-NEXT: (case name=option154 index=154) +// CHECKALL-NEXT: (case name=option155 index=155) +// CHECKALL-NEXT: (case name=option156 index=156) +// CHECKALL-NEXT: (case name=option157 index=157) +// CHECKALL-NEXT: (case name=option158 index=158) +// CHECKALL-NEXT: (case name=option159 index=159) +// CHECKALL-NEXT: (case name=option160 index=160) +// CHECKALL-NEXT: (case name=option161 index=161) +// CHECKALL-NEXT: (case name=option162 index=162) +// CHECKALL-NEXT: (case name=option163 index=163) +// CHECKALL-NEXT: (case name=option164 index=164) +// CHECKALL-NEXT: (case name=option165 index=165) +// CHECKALL-NEXT: (case name=option166 index=166) +// CHECKALL-NEXT: (case name=option167 index=167) +// CHECKALL-NEXT: (case name=option168 index=168) +// CHECKALL-NEXT: (case name=option169 index=169) +// CHECKALL-NEXT: (case name=option170 index=170) +// CHECKALL-NEXT: (case name=option171 index=171) +// CHECKALL-NEXT: (case name=option172 index=172) +// CHECKALL-NEXT: (case name=option173 index=173) +// CHECKALL-NEXT: (case name=option174 index=174) +// CHECKALL-NEXT: (case name=option175 index=175) +// CHECKALL-NEXT: (case name=option176 index=176) +// CHECKALL-NEXT: (case name=option177 index=177) +// CHECKALL-NEXT: (case name=option178 index=178) +// CHECKALL-NEXT: (case name=option179 index=179) +// CHECKALL-NEXT: (case name=option180 index=180) +// CHECKALL-NEXT: (case name=option181 index=181) +// CHECKALL-NEXT: (case name=option182 index=182) +// CHECKALL-NEXT: (case name=option183 index=183) +// CHECKALL-NEXT: (case name=option184 index=184) +// CHECKALL-NEXT: (case name=option185 index=185) +// CHECKALL-NEXT: (case name=option186 index=186) +// CHECKALL-NEXT: (case name=option187 index=187) +// CHECKALL-NEXT: (case name=option188 index=188) +// CHECKALL-NEXT: (case name=option189 index=189) +// CHECKALL-NEXT: (case name=option190 index=190) +// CHECKALL-NEXT: (case name=option191 index=191) +// CHECKALL-NEXT: (case name=option192 index=192) +// CHECKALL-NEXT: (case name=option193 index=193) +// CHECKALL-NEXT: (case name=option194 index=194) +// CHECKALL-NEXT: (case name=option195 index=195) +// CHECKALL-NEXT: (case name=option196 index=196) +// CHECKALL-NEXT: (case name=option197 index=197) +// CHECKALL-NEXT: (case name=option198 index=198) +// CHECKALL-NEXT: (case name=option199 index=199) +// CHECKALL-NEXT: (case name=option200 index=200) +// CHECKALL-NEXT: (case name=option201 index=201) +// CHECKALL-NEXT: (case name=option202 index=202) +// CHECKALL-NEXT: (case name=option203 index=203) +// CHECKALL-NEXT: (case name=option204 index=204) +// CHECKALL-NEXT: (case name=option205 index=205) +// CHECKALL-NEXT: (case name=option206 index=206) +// CHECKALL-NEXT: (case name=option207 index=207) +// CHECKALL-NEXT: (case name=option208 index=208) +// CHECKALL-NEXT: (case name=option209 index=209) +// CHECKALL-NEXT: (case name=option210 index=210) +// CHECKALL-NEXT: (case name=option211 index=211) +// CHECKALL-NEXT: (case name=option212 index=212) +// CHECKALL-NEXT: (case name=option213 index=213) +// CHECKALL-NEXT: (case name=option214 index=214) +// CHECKALL-NEXT: (case name=option215 index=215) +// CHECKALL-NEXT: (case name=option216 index=216) +// CHECKALL-NEXT: (case name=option217 index=217) +// CHECKALL-NEXT: (case name=option218 index=218) +// CHECKALL-NEXT: (case name=option219 index=219) +// CHECKALL-NEXT: (case name=option220 index=220) +// CHECKALL-NEXT: (case name=option221 index=221) +// CHECKALL-NEXT: (case name=option222 index=222) +// CHECKALL-NEXT: (case name=option223 index=223) +// CHECKALL-NEXT: (case name=option224 index=224) +// CHECKALL-NEXT: (case name=option225 index=225) +// CHECKALL-NEXT: (case name=option226 index=226) +// CHECKALL-NEXT: (case name=option227 index=227) +// CHECKALL-NEXT: (case name=option228 index=228) +// CHECKALL-NEXT: (case name=option229 index=229) +// CHECKALL-NEXT: (case name=option230 index=230) +// CHECKALL-NEXT: (case name=option231 index=231) +// CHECKALL-NEXT: (case name=option232 index=232) +// CHECKALL-NEXT: (case name=option233 index=233) +// CHECKALL-NEXT: (case name=option234 index=234) +// CHECKALL-NEXT: (case name=option235 index=235) +// CHECKALL-NEXT: (case name=option236 index=236) +// CHECKALL-NEXT: (case name=option237 index=237) +// CHECKALL-NEXT: (case name=option238 index=238) +// CHECKALL-NEXT: (case name=option239 index=239) +// CHECKALL-NEXT: (case name=option240 index=240) +// CHECKALL-NEXT: (case name=option241 index=241) +// CHECKALL-NEXT: (case name=option242 index=242) +// CHECKALL-NEXT: (case name=option243 index=243) +// CHECKALL-NEXT: (case name=option244 index=244) +// CHECKALL-NEXT: (case name=option245 index=245) +// CHECKALL-NEXT: (case name=option246 index=246) +// CHECKALL-NEXT: (case name=option247 index=247) +// CHECKALL-NEXT: (case name=option248 index=248) +// CHECKALL-NEXT: (case name=option249 index=249) +// CHECKALL-NEXT: (case name=option250 index=250) +// CHECKALL-NEXT: (case name=option251 index=251) +// CHECKALL-NEXT: (case name=option252 index=252) +// CHECKALL-NEXT: (case name=option253 index=253) +// CHECKALL-NEXT: (case name=option254 index=254) +// CHECKALL-NEXT: (case name=option255 index=255) +// CHECKALL-NEXT: (case name=option256 index=256) +// CHECKALL-NEXT: (case name=option257 index=257)) + +// CHECKALL: Enum value: +// CHECKALL-NEXT: (enum_value name=option12 index=12) + +reflect(enum: VastNumberOfCasesNoPayload.option256) + +// CHECKALL: Reflecting an enum. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (enum reflect_Enum_values.VastNumberOfCasesNoPayload) + +// CHECKALL: Type info: +// CHECKALL-NEXT: (no_payload_enum size=2 alignment=2 stride=2 num_extra_inhabitants=65278 bitwise_takable=1 +// CHECKALL-NEXT: (case name=option0 index=0) +// CHECKALL-NEXT: (case name=option1 index=1) +// CHECKALL-NEXT: (case name=option2 index=2) +// CHECKALL-NEXT: (case name=option3 index=3) +// CHECKALL-NEXT: (case name=option4 index=4) +// CHECKALL-NEXT: (case name=option5 index=5) +// CHECKALL-NEXT: (case name=option6 index=6) +// CHECKALL-NEXT: (case name=option7 index=7) +// CHECKALL-NEXT: (case name=option8 index=8) +// CHECKALL-NEXT: (case name=option9 index=9) +// CHECKALL-NEXT: (case name=option10 index=10) +// CHECKALL-NEXT: (case name=option11 index=11) +// CHECKALL-NEXT: (case name=option12 index=12) +// CHECKALL-NEXT: (case name=option13 index=13) +// CHECKALL-NEXT: (case name=option14 index=14) +// CHECKALL-NEXT: (case name=option15 index=15) +// CHECKALL-NEXT: (case name=option16 index=16) +// CHECKALL-NEXT: (case name=option17 index=17) +// CHECKALL-NEXT: (case name=option18 index=18) +// CHECKALL-NEXT: (case name=option19 index=19) +// CHECKALL-NEXT: (case name=option20 index=20) +// CHECKALL-NEXT: (case name=option21 index=21) +// CHECKALL-NEXT: (case name=option22 index=22) +// CHECKALL-NEXT: (case name=option23 index=23) +// CHECKALL-NEXT: (case name=option24 index=24) +// CHECKALL-NEXT: (case name=option25 index=25) +// CHECKALL-NEXT: (case name=option26 index=26) +// CHECKALL-NEXT: (case name=option27 index=27) +// CHECKALL-NEXT: (case name=option28 index=28) +// CHECKALL-NEXT: (case name=option29 index=29) +// CHECKALL-NEXT: (case name=option30 index=30) +// CHECKALL-NEXT: (case name=option31 index=31) +// CHECKALL-NEXT: (case name=option32 index=32) +// CHECKALL-NEXT: (case name=option33 index=33) +// CHECKALL-NEXT: (case name=option34 index=34) +// CHECKALL-NEXT: (case name=option35 index=35) +// CHECKALL-NEXT: (case name=option36 index=36) +// CHECKALL-NEXT: (case name=option37 index=37) +// CHECKALL-NEXT: (case name=option38 index=38) +// CHECKALL-NEXT: (case name=option39 index=39) +// CHECKALL-NEXT: (case name=option40 index=40) +// CHECKALL-NEXT: (case name=option41 index=41) +// CHECKALL-NEXT: (case name=option42 index=42) +// CHECKALL-NEXT: (case name=option43 index=43) +// CHECKALL-NEXT: (case name=option44 index=44) +// CHECKALL-NEXT: (case name=option45 index=45) +// CHECKALL-NEXT: (case name=option46 index=46) +// CHECKALL-NEXT: (case name=option47 index=47) +// CHECKALL-NEXT: (case name=option48 index=48) +// CHECKALL-NEXT: (case name=option49 index=49) +// CHECKALL-NEXT: (case name=option50 index=50) +// CHECKALL-NEXT: (case name=option51 index=51) +// CHECKALL-NEXT: (case name=option52 index=52) +// CHECKALL-NEXT: (case name=option53 index=53) +// CHECKALL-NEXT: (case name=option54 index=54) +// CHECKALL-NEXT: (case name=option55 index=55) +// CHECKALL-NEXT: (case name=option56 index=56) +// CHECKALL-NEXT: (case name=option57 index=57) +// CHECKALL-NEXT: (case name=option58 index=58) +// CHECKALL-NEXT: (case name=option59 index=59) +// CHECKALL-NEXT: (case name=option60 index=60) +// CHECKALL-NEXT: (case name=option61 index=61) +// CHECKALL-NEXT: (case name=option62 index=62) +// CHECKALL-NEXT: (case name=option63 index=63) +// CHECKALL-NEXT: (case name=option64 index=64) +// CHECKALL-NEXT: (case name=option65 index=65) +// CHECKALL-NEXT: (case name=option66 index=66) +// CHECKALL-NEXT: (case name=option67 index=67) +// CHECKALL-NEXT: (case name=option68 index=68) +// CHECKALL-NEXT: (case name=option69 index=69) +// CHECKALL-NEXT: (case name=option70 index=70) +// CHECKALL-NEXT: (case name=option71 index=71) +// CHECKALL-NEXT: (case name=option72 index=72) +// CHECKALL-NEXT: (case name=option73 index=73) +// CHECKALL-NEXT: (case name=option74 index=74) +// CHECKALL-NEXT: (case name=option75 index=75) +// CHECKALL-NEXT: (case name=option76 index=76) +// CHECKALL-NEXT: (case name=option77 index=77) +// CHECKALL-NEXT: (case name=option78 index=78) +// CHECKALL-NEXT: (case name=option79 index=79) +// CHECKALL-NEXT: (case name=option80 index=80) +// CHECKALL-NEXT: (case name=option81 index=81) +// CHECKALL-NEXT: (case name=option82 index=82) +// CHECKALL-NEXT: (case name=option83 index=83) +// CHECKALL-NEXT: (case name=option84 index=84) +// CHECKALL-NEXT: (case name=option85 index=85) +// CHECKALL-NEXT: (case name=option86 index=86) +// CHECKALL-NEXT: (case name=option87 index=87) +// CHECKALL-NEXT: (case name=option88 index=88) +// CHECKALL-NEXT: (case name=option89 index=89) +// CHECKALL-NEXT: (case name=option90 index=90) +// CHECKALL-NEXT: (case name=option91 index=91) +// CHECKALL-NEXT: (case name=option92 index=92) +// CHECKALL-NEXT: (case name=option93 index=93) +// CHECKALL-NEXT: (case name=option94 index=94) +// CHECKALL-NEXT: (case name=option95 index=95) +// CHECKALL-NEXT: (case name=option96 index=96) +// CHECKALL-NEXT: (case name=option97 index=97) +// CHECKALL-NEXT: (case name=option98 index=98) +// CHECKALL-NEXT: (case name=option99 index=99) +// CHECKALL-NEXT: (case name=option100 index=100) +// CHECKALL-NEXT: (case name=option101 index=101) +// CHECKALL-NEXT: (case name=option102 index=102) +// CHECKALL-NEXT: (case name=option103 index=103) +// CHECKALL-NEXT: (case name=option104 index=104) +// CHECKALL-NEXT: (case name=option105 index=105) +// CHECKALL-NEXT: (case name=option106 index=106) +// CHECKALL-NEXT: (case name=option107 index=107) +// CHECKALL-NEXT: (case name=option108 index=108) +// CHECKALL-NEXT: (case name=option109 index=109) +// CHECKALL-NEXT: (case name=option110 index=110) +// CHECKALL-NEXT: (case name=option111 index=111) +// CHECKALL-NEXT: (case name=option112 index=112) +// CHECKALL-NEXT: (case name=option113 index=113) +// CHECKALL-NEXT: (case name=option114 index=114) +// CHECKALL-NEXT: (case name=option115 index=115) +// CHECKALL-NEXT: (case name=option116 index=116) +// CHECKALL-NEXT: (case name=option117 index=117) +// CHECKALL-NEXT: (case name=option118 index=118) +// CHECKALL-NEXT: (case name=option119 index=119) +// CHECKALL-NEXT: (case name=option120 index=120) +// CHECKALL-NEXT: (case name=option121 index=121) +// CHECKALL-NEXT: (case name=option122 index=122) +// CHECKALL-NEXT: (case name=option123 index=123) +// CHECKALL-NEXT: (case name=option124 index=124) +// CHECKALL-NEXT: (case name=option125 index=125) +// CHECKALL-NEXT: (case name=option126 index=126) +// CHECKALL-NEXT: (case name=option127 index=127) +// CHECKALL-NEXT: (case name=option128 index=128) +// CHECKALL-NEXT: (case name=option129 index=129) +// CHECKALL-NEXT: (case name=option130 index=130) +// CHECKALL-NEXT: (case name=option131 index=131) +// CHECKALL-NEXT: (case name=option132 index=132) +// CHECKALL-NEXT: (case name=option133 index=133) +// CHECKALL-NEXT: (case name=option134 index=134) +// CHECKALL-NEXT: (case name=option135 index=135) +// CHECKALL-NEXT: (case name=option136 index=136) +// CHECKALL-NEXT: (case name=option137 index=137) +// CHECKALL-NEXT: (case name=option138 index=138) +// CHECKALL-NEXT: (case name=option139 index=139) +// CHECKALL-NEXT: (case name=option140 index=140) +// CHECKALL-NEXT: (case name=option141 index=141) +// CHECKALL-NEXT: (case name=option142 index=142) +// CHECKALL-NEXT: (case name=option143 index=143) +// CHECKALL-NEXT: (case name=option144 index=144) +// CHECKALL-NEXT: (case name=option145 index=145) +// CHECKALL-NEXT: (case name=option146 index=146) +// CHECKALL-NEXT: (case name=option147 index=147) +// CHECKALL-NEXT: (case name=option148 index=148) +// CHECKALL-NEXT: (case name=option149 index=149) +// CHECKALL-NEXT: (case name=option150 index=150) +// CHECKALL-NEXT: (case name=option151 index=151) +// CHECKALL-NEXT: (case name=option152 index=152) +// CHECKALL-NEXT: (case name=option153 index=153) +// CHECKALL-NEXT: (case name=option154 index=154) +// CHECKALL-NEXT: (case name=option155 index=155) +// CHECKALL-NEXT: (case name=option156 index=156) +// CHECKALL-NEXT: (case name=option157 index=157) +// CHECKALL-NEXT: (case name=option158 index=158) +// CHECKALL-NEXT: (case name=option159 index=159) +// CHECKALL-NEXT: (case name=option160 index=160) +// CHECKALL-NEXT: (case name=option161 index=161) +// CHECKALL-NEXT: (case name=option162 index=162) +// CHECKALL-NEXT: (case name=option163 index=163) +// CHECKALL-NEXT: (case name=option164 index=164) +// CHECKALL-NEXT: (case name=option165 index=165) +// CHECKALL-NEXT: (case name=option166 index=166) +// CHECKALL-NEXT: (case name=option167 index=167) +// CHECKALL-NEXT: (case name=option168 index=168) +// CHECKALL-NEXT: (case name=option169 index=169) +// CHECKALL-NEXT: (case name=option170 index=170) +// CHECKALL-NEXT: (case name=option171 index=171) +// CHECKALL-NEXT: (case name=option172 index=172) +// CHECKALL-NEXT: (case name=option173 index=173) +// CHECKALL-NEXT: (case name=option174 index=174) +// CHECKALL-NEXT: (case name=option175 index=175) +// CHECKALL-NEXT: (case name=option176 index=176) +// CHECKALL-NEXT: (case name=option177 index=177) +// CHECKALL-NEXT: (case name=option178 index=178) +// CHECKALL-NEXT: (case name=option179 index=179) +// CHECKALL-NEXT: (case name=option180 index=180) +// CHECKALL-NEXT: (case name=option181 index=181) +// CHECKALL-NEXT: (case name=option182 index=182) +// CHECKALL-NEXT: (case name=option183 index=183) +// CHECKALL-NEXT: (case name=option184 index=184) +// CHECKALL-NEXT: (case name=option185 index=185) +// CHECKALL-NEXT: (case name=option186 index=186) +// CHECKALL-NEXT: (case name=option187 index=187) +// CHECKALL-NEXT: (case name=option188 index=188) +// CHECKALL-NEXT: (case name=option189 index=189) +// CHECKALL-NEXT: (case name=option190 index=190) +// CHECKALL-NEXT: (case name=option191 index=191) +// CHECKALL-NEXT: (case name=option192 index=192) +// CHECKALL-NEXT: (case name=option193 index=193) +// CHECKALL-NEXT: (case name=option194 index=194) +// CHECKALL-NEXT: (case name=option195 index=195) +// CHECKALL-NEXT: (case name=option196 index=196) +// CHECKALL-NEXT: (case name=option197 index=197) +// CHECKALL-NEXT: (case name=option198 index=198) +// CHECKALL-NEXT: (case name=option199 index=199) +// CHECKALL-NEXT: (case name=option200 index=200) +// CHECKALL-NEXT: (case name=option201 index=201) +// CHECKALL-NEXT: (case name=option202 index=202) +// CHECKALL-NEXT: (case name=option203 index=203) +// CHECKALL-NEXT: (case name=option204 index=204) +// CHECKALL-NEXT: (case name=option205 index=205) +// CHECKALL-NEXT: (case name=option206 index=206) +// CHECKALL-NEXT: (case name=option207 index=207) +// CHECKALL-NEXT: (case name=option208 index=208) +// CHECKALL-NEXT: (case name=option209 index=209) +// CHECKALL-NEXT: (case name=option210 index=210) +// CHECKALL-NEXT: (case name=option211 index=211) +// CHECKALL-NEXT: (case name=option212 index=212) +// CHECKALL-NEXT: (case name=option213 index=213) +// CHECKALL-NEXT: (case name=option214 index=214) +// CHECKALL-NEXT: (case name=option215 index=215) +// CHECKALL-NEXT: (case name=option216 index=216) +// CHECKALL-NEXT: (case name=option217 index=217) +// CHECKALL-NEXT: (case name=option218 index=218) +// CHECKALL-NEXT: (case name=option219 index=219) +// CHECKALL-NEXT: (case name=option220 index=220) +// CHECKALL-NEXT: (case name=option221 index=221) +// CHECKALL-NEXT: (case name=option222 index=222) +// CHECKALL-NEXT: (case name=option223 index=223) +// CHECKALL-NEXT: (case name=option224 index=224) +// CHECKALL-NEXT: (case name=option225 index=225) +// CHECKALL-NEXT: (case name=option226 index=226) +// CHECKALL-NEXT: (case name=option227 index=227) +// CHECKALL-NEXT: (case name=option228 index=228) +// CHECKALL-NEXT: (case name=option229 index=229) +// CHECKALL-NEXT: (case name=option230 index=230) +// CHECKALL-NEXT: (case name=option231 index=231) +// CHECKALL-NEXT: (case name=option232 index=232) +// CHECKALL-NEXT: (case name=option233 index=233) +// CHECKALL-NEXT: (case name=option234 index=234) +// CHECKALL-NEXT: (case name=option235 index=235) +// CHECKALL-NEXT: (case name=option236 index=236) +// CHECKALL-NEXT: (case name=option237 index=237) +// CHECKALL-NEXT: (case name=option238 index=238) +// CHECKALL-NEXT: (case name=option239 index=239) +// CHECKALL-NEXT: (case name=option240 index=240) +// CHECKALL-NEXT: (case name=option241 index=241) +// CHECKALL-NEXT: (case name=option242 index=242) +// CHECKALL-NEXT: (case name=option243 index=243) +// CHECKALL-NEXT: (case name=option244 index=244) +// CHECKALL-NEXT: (case name=option245 index=245) +// CHECKALL-NEXT: (case name=option246 index=246) +// CHECKALL-NEXT: (case name=option247 index=247) +// CHECKALL-NEXT: (case name=option248 index=248) +// CHECKALL-NEXT: (case name=option249 index=249) +// CHECKALL-NEXT: (case name=option250 index=250) +// CHECKALL-NEXT: (case name=option251 index=251) +// CHECKALL-NEXT: (case name=option252 index=252) +// CHECKALL-NEXT: (case name=option253 index=253) +// CHECKALL-NEXT: (case name=option254 index=254) +// CHECKALL-NEXT: (case name=option255 index=255) +// CHECKALL-NEXT: (case name=option256 index=256) +// CHECKALL-NEXT: (case name=option257 index=257)) + +// CHECKALL: Enum value: +// CHECKALL-NEXT: (enum_value name=option256 index=256) + +reflect(enum: ManyCasesOneIntPayload.payload(77)) + +// CHECKALL: Reflecting an enum. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (enum reflect_Enum_values.ManyCasesOneIntPayload) + +// CHECKALL: Type info: +// CHECK64-NEXT: (single_payload_enum size=9 alignment=8 stride=16 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (case name=payload index=0 offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (case name=otherA index=1) +// CHECK64-NEXT: (case name=otherB index=2) +// CHECK64-NEXT: (case name=otherC index=3)) + +// CHECK32-NEXT: (single_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (case name=payload index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=otherA index=1) +// CHECK32-NEXT: (case name=otherB index=2) +// CHECK32-NEXT: (case name=otherC index=3)) + +// CHECKALL: Enum value: +// CHECKALL-NEXT: (enum_value name=payload index=0 +// CHECKALL-NEXT: (struct Swift.Int) +// CHECKALL-NEXT: ) + +reflect(enum: ManyCasesOneStringPayload.payload("hello, world")) + +// CHECKALL: Reflecting an enum. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (enum reflect_Enum_values.ManyCasesOneStringPayload) + +// CHECKALL: Type info: +// CHECK64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=2147483644 bitwise_takable=1 +// CHECK64-NEXT: (case name=payload index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=otherA index=1) +// CHECK64-NEXT: (case name=otherB index=2) +// CHECK64-NEXT: (case name=otherC index=3)) + +// CHECK32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=250 bitwise_takable=1 +// CHECK32-NEXT: (case name=payload index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=otherA index=1) +// CHECK32-NEXT: (case name=otherB index=2) +// CHECK32-NEXT: (case name=otherC index=3)) + +// CHECKALL: Enum value: +// CHECK64-NEXT: (enum_value name=payload index=0 +// CHECK64-NEXT: (struct Swift.String) +// CHECK64-NEXT: ) + +// XXX Note: 32-bit String contains a multi_payload_enum which projectEnumValue cannot yet handle. +// CHECK32-NEXT: swift_reflection_projectEnumValue failed. + +reflect(enum: ManyCasesOneStringPayload.otherB) + +// CHECKALL: Reflecting an enum. +// CHECKALL-NEXT: Instance pointer in child address space: 0x{{[0-9a-fA-F]+}} +// CHECKALL-NEXT: Type reference: +// CHECKALL-NEXT: (enum reflect_Enum_values.ManyCasesOneStringPayload) + +// CHECKALL: Type info: +// CHECK64-NEXT: (single_payload_enum size=16 alignment=8 stride=16 num_extra_inhabitants=2147483644 bitwise_takable=1 +// CHECK64-NEXT: (case name=payload index=0 offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_guts offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_object offset=0 +// CHECK64-NEXT: (struct size=16 alignment=8 stride=16 num_extra_inhabitants=2147483647 bitwise_takable=1 +// CHECK64-NEXT: (field name=_countAndFlagsBits offset=0 +// CHECK64-NEXT: (struct size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK64-NEXT: (field name=_value offset=0 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK64-NEXT: (field name=_object offset=8 +// CHECK64-NEXT: (builtin size=8 alignment=8 stride=8 num_extra_inhabitants=2147483647 bitwise_takable=1)))))))) +// CHECK64-NEXT: (case name=otherA index=1) +// CHECK64-NEXT: (case name=otherB index=2) +// CHECK64-NEXT: (case name=otherC index=3)) + +// CHECK32-NEXT: (single_payload_enum size=12 alignment=4 stride=12 num_extra_inhabitants=250 bitwise_takable=1 +// CHECK32-NEXT: (case name=payload index=0 offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_guts offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_object offset=0 +// CHECK32-NEXT: (struct size=12 alignment=4 stride=12 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (field name=_count offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_variant offset=4 +// CHECK32-NEXT: (multi_payload_enum size=5 alignment=4 stride=8 num_extra_inhabitants=253 bitwise_takable=1 +// CHECK32-NEXT: (case name=immortal index=0 offset=0 +// CHECK32-NEXT: (struct size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=4 alignment=4 stride=4 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (case name=native index=1 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))) +// CHECK32-NEXT: (case name=bridged index=2 offset=0 +// CHECK32-NEXT: (class_existential size=4 alignment=4 stride=4 num_extra_inhabitants=4096 bitwise_takable=1 +// CHECK32-NEXT: (field name=object offset=0 +// CHECK32-NEXT: (reference kind=strong refcounting=unknown)))))) +// CHECK32-NEXT: (field name=_discriminator offset=9 +// CHECK32-NEXT: (struct size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=1 alignment=1 stride=1 num_extra_inhabitants=0 bitwise_takable=1)))) +// CHECK32-NEXT: (field name=_flags offset=10 +// CHECK32-NEXT: (struct size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1 +// CHECK32-NEXT: (field name=_value offset=0 +// CHECK32-NEXT: (builtin size=2 alignment=2 stride=2 num_extra_inhabitants=0 bitwise_takable=1)))))))))) +// CHECK32-NEXT: (case name=otherA index=1) +// CHECK32-NEXT: (case name=otherB index=2) +// CHECK32-NEXT: (case name=otherC index=3)) + + +// CHECKALL: Enum value: +// CHECK64-NEXT: (enum_value name=otherB index=2) + +// XXX Note: 32-bit String contains a multi_payload_enum which projectEnumValue cannot yet handle. +// CHECK32-NEXT: swift_reflection_projectEnumValue failed. + +//reflect(enum: ManyCasesManyPayloads.a("hi, world")) + +doneReflecting() + +// CHECKALL: Done. +