-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathreflect_Enum_values4.swift
51 lines (36 loc) · 1.38 KB
/
reflect_Enum_values4.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Enum_values4
// RUN: %target-codesign %t/reflect_Enum_values4
// RUN: %target-run %target-swift-reflection-test %t/reflect_Enum_values4 | tee /dev/stderr | %FileCheck %s --check-prefix=CHECK%target-ptrsize --check-prefix=CHECKALL --dump-input=fail %add_num_extra_inhabitants
// REQUIRES: objc_interop
// REQUIRES: executable_test
// REQUIRES: reflection_test_support
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: asan
import SwiftReflectionTest
enum NonPayloadEnum {
case one
case two
}
enum SmallMultipayloadEnum {
case empty
case a(NonPayloadEnum)
case b(NonPayloadEnum)
}
reflect(enumValue: SmallMultipayloadEnum.b(.two))
// CHECKALL: Reflecting an enum value.
// CHECKALL-NEXT: Type reference:
// CHECKALL-NEXT: (enum reflect_Enum_values4.SmallMultipayloadEnum)
// CHECKALL-NEXT: Value: .b(.two)
reflect(enumValue: SmallMultipayloadEnum.empty)
// CHECKALL: Reflecting an enum value.
// CHECKALL-NEXT: Type reference:
// CHECKALL-NEXT: (enum reflect_Enum_values4.SmallMultipayloadEnum)
// CHECKALL-NEXT: Value: .empty
reflect(enumValue: SmallMultipayloadEnum.a(.one))
// CHECKALL: Reflecting an enum value.
// CHECKALL-NEXT: Type reference:
// CHECKALL-NEXT: (enum reflect_Enum_values4.SmallMultipayloadEnum)
// CHECKALL-NEXT: Value: .a(.one)
doneReflecting()
// CHECKALL: Done.