Skip to content

Commit ef0b82d

Browse files
Merge pull request #74211 from nate-chandler/rdar129010265
[Test] Add regression test.
2 parents c8b5344 + 2436353 commit ef0b82d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
2+
// RUN: %target-swift-emit-sil %s -verify
3+
4+
protocol Summable_2: ~Copyable {
5+
static var zero: Self { get }
6+
}
7+
8+
struct NCInt_2: ~Copyable, Summable_2 {
9+
var rawValue: Int
10+
11+
static var zero: Self {
12+
.init(rawValue: 0)
13+
}
14+
}
15+
16+
// CHECK-LABEL: sil {{.*}} [ossa] @$s13rdar1290102657NCInt_2VAA10Summable_2A2aDP4zeroxvrZTW : {{.*}} {
17+
// CHECK: [[METATYPE:%[^,]+]] = metatype $@thin NCInt_2.Type
18+
// CHECK: [[IMPL:%[^,]+]] = function_ref @$s13rdar1290102657NCInt_2V4zeroACvrZ
19+
// CHECK: ([[ZERO:%[^,]+]], [[TOKEN:%[^,]+]]) = begin_apply [[IMPL]]([[METATYPE]])
20+
// CHECK: [[ALLOC:%[^,]+]] = alloc_stack $NCInt_2
21+
// CHECK: [[MARK:%[^,]+]] = mark_unresolved_non_copyable_value [consumable_and_assignable] [[ALLOC]]
22+
// CHECK: [[ADDR:%[^,]+]] = store_borrow [[ZERO]] to [[MARK]]
23+
// CHECK: yield [[ADDR:%[^,]+]]
24+
// CHECK: resume [[RESUME:bb[0-9]+]]
25+
// CHECK: unwind [[UNWIND:bb[0-9]+]]
26+
// CHECK: [[RESUME]]:
27+
// CHECK: end_borrow [[ADDR]]
28+
// CHECK: dealloc_stack [[ALLOC]]
29+
// CHECK: end_apply [[TOKEN]] as $()
30+
// CHECK: [[UNWIND]]:
31+
// CHECK: end_borrow [[ADDR]]
32+
// CHECK: dealloc_stack [[ALLOC]]
33+
// CHECK: abort_apply [[TOKEN]]
34+
// CHECK-LABEL: } // end sil function '$s13rdar1290102657NCInt_2VAA10Summable_2A2aDP4zeroxvrZTW'

0 commit comments

Comments
 (0)