forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforeach.swift
39 lines (35 loc) · 1.73 KB
/
foreach.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
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
class C {}
// CHECK-LABEL: sil hidden @_TF7foreach13tupleElementsFGSaTCS_1CS0___T_
func tupleElements(_ xx: [(C, C)]) {
// CHECK: [[PAYLOAD:%.*]] = unchecked_enum_data {{%.*}} : $Optional<(C, C)>, #Optional.some!enumelt.1
// CHECK: [[A:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 0
// CHECK: [[B:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 1
// CHECK: destroy_value [[B]]
// CHECK: destroy_value [[A]]
for (a, b) in xx {}
// CHECK: [[PAYLOAD:%.*]] = unchecked_enum_data {{%.*}} : $Optional<(C, C)>, #Optional.some!enumelt.1
// CHECK: [[A:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 0
// CHECK: [[B:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 1
// CHECK: destroy_value [[B]]
// CHECK: destroy_value [[A]]
for (a, _) in xx {}
// CHECK: [[PAYLOAD:%.*]] = unchecked_enum_data {{%.*}} : $Optional<(C, C)>, #Optional.some!enumelt.1
// CHECK: [[A:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 0
// CHECK: [[B:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 1
// CHECK: destroy_value [[A]]
// CHECK: destroy_value [[B]]
for (_, b) in xx {}
// CHECK: [[PAYLOAD:%.*]] = unchecked_enum_data {{%.*}} : $Optional<(C, C)>, #Optional.some!enumelt.1
// CHECK: [[A:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 0
// CHECK: [[B:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 1
// CHECK: destroy_value [[B]]
// CHECK: destroy_value [[A]]
for (_, _) in xx {}
// CHECK: [[PAYLOAD:%.*]] = unchecked_enum_data {{%.*}} : $Optional<(C, C)>, #Optional.some!enumelt.1
// CHECK: [[A:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 0
// CHECK: [[B:%.*]] = tuple_extract [[PAYLOAD]] : $(C, C), 1
// CHECK: destroy_value [[B]]
// CHECK: destroy_value [[A]]
for _ in xx {}
}