-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathenum.swift
70 lines (54 loc) · 2.35 KB
/
enum.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// REQUIRES: VENDOR=apple
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -O
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -O
// With -enable-testing:
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing -O
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing -O
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -typecheck -parse-as-library -module-name test %s -emit-tbd -emit-tbd-path %t/typecheck.tbd -tbd-install_name test
// RUN: %target-swift-frontend -emit-ir -parse-as-library -module-name test %s -emit-tbd -emit-tbd-path %t/emit-ir.tbd -tbd-install_name test
// RUN: %llvm-readtapi --compare %t/typecheck.tbd %t/emit-ir.tbd
public protocol P {}
public class C {
}
public enum SinglePayload: P {
case A
case B(C)
case D
}
public enum MultiPayload {
case A
case B(C)
case D(C)
public func method() {}
}
public enum AutomaticEquatableHashable {
case a, b
}
public enum Synthesized: Equatable, Hashable {
case a(AutomaticEquatableHashable), b
}
public enum ConditionalSynthesized<T> {
case a(T), b
}
#if swift(>=4)
extension ConditionalSynthesized: Equatable where T: Equatable {}
extension ConditionalSynthesized: Hashable where T: Hashable {}
#endif
public enum ZeroCases {}
public enum OneCase {
case a
}
public enum OneCasePayload {
case a(C)
}
public enum PublicEnumDefaultArgument {
case first(_: Int = 123)
}
internal enum InternalEnumDefaultArgument {
case first(_: Int = 123)
}