File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
test/Interop/Cxx/class/move-only Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-emit-irgen -I %S/Inputs -enable-experimental-cxx-interop %s -validate-tbd-against-ir=none -Xcc -fignore-exceptions | %FileCheck %s
2
+
3
+ import MoveOnlyCxxValueType
4
+
5
+ func testGetX( ) -> CInt {
6
+ let derived = NonCopyableHolderDerivedDerived ( 42 )
7
+ return derived. x. x
8
+ }
9
+
10
+ let _ = testGetX ( )
11
+
12
+ func testSetX( _ x: CInt ) {
13
+ var derived = NonCopyableHolderDerivedDerived ( 42 )
14
+ derived. x. x = 2
15
+ }
16
+
17
+ testSetX ( 2 )
18
+
19
+ // CHECK: define {{.*}}linkonce_odr{{.*}} ptr @{{.*}}__synthesizedBaseCall___synthesizedBaseGetterAccessor{{.*}}
20
+
21
+ // CHECK: define {{.*}}linkonce_odr{{.*}} ptr @{{.*}}__synthesizedBaseCall___synthesizedBaseSetterAccessor{{.*}}
22
+
23
+ // CHECK: define {{.*}}linkonce_odr{{.*}} ptr @{{.*}}__synthesizedBaseGetterAccessor{{.*}}
24
+ // CHECK: %[[VPTR:.*]] = getelementptr inbounds %struct.NonCopyableHolder
25
+ // CHECK: ret ptr %[[VPTR]]
26
+
27
+ // CHECK: define {{.*}}linkonce_odr{{.*}} ptr @{{.*}}__synthesizedBaseSetterAccessor{{.*}}
28
+ // CHECK: %[[VPTRS:.*]] = getelementptr inbounds %struct.NonCopyableHolder
29
+ // CHECK: ret ptr %[[VPTRS]]
You can’t perform that action at this time.
0 commit comments