File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
test/Interop/Cxx/foreign-reference Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-emit-silgen %s -I %S/Inputs -enable-experimental-cxx-interop | %FileCheck %s
2
+ //
3
+ // XFAIL: OS=linux-android, OS=linux-androideabi
4
+
5
+ import POD
6
+ import ReferenceCounted
7
+
8
+ // CHECK-LABEL: sil [ossa] @$s4main11testTrivialyyF : $@convention(thin) () -> ()
9
+ // CHECK-NOT: retain
10
+ // CHECK-NOT: release
11
+ // CHECK-NOT: copy_value
12
+ // CHECK-NOT: destroy_value
13
+ // CHECK-NOT: begin_borrow
14
+ // CHECK-NOT: end_borrow
15
+ // CHECK: return
16
+ // CHECK-LABEL: end sil function '$s4main11testTrivialyyF'
17
+ public func testTrivial( ) {
18
+ let x = Empty . create ( )
19
+ let t = ( x, x, x)
20
+ }
21
+
22
+ // CHECK-LABEL: sil [ossa] @$s4main14testNonTrivialyyF : $@convention(thin) () -> ()
23
+ // CHECK: copy_value %{{[0-9]+}} : $LocalCount
24
+ // CHECK: copy_value %{{[0-9]+}} : $LocalCount
25
+ // CHECK: copy_value %{{[0-9]+}} : $LocalCount
26
+ // CHECK: return
27
+ // CHECK-LABEL: end sil function '$s4main14testNonTrivialyyF'
28
+ public func testNonTrivial( ) {
29
+ let x = LocalCount . create ( )
30
+ let t = ( x, x, x)
31
+ }
You can’t perform that action at this time.
0 commit comments