Files
swift-mirror/test/Interop/Cxx/foreign-reference/move-only-irgen.swift
Finagolfin 15e1c73969 [android][test] Enable several C++ Interop and other tests
Also, fix lit.cfg for running the test suite natively in Android and mark one
SILOptimizer executable_test as such.
2024-07-20 17:56:51 +05:30

24 lines
774 B
Swift

// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-experimental-cxx-interop -validate-tbd-against-ir=none -disable-llvm-verify -Xcc -fignore-exceptions -disable-availability-checking | %FileCheck %s
import MoveOnly
// CHECK-LABEL: define {{.*}}swiftcc void @"$s4main4testyyF"
// CHECK: [[X:%.*]] = alloca ptr
// CHECK: [[TMP:%.*]] = alloca ptr
// CHECK: [[CREATED:%.*]] = call ptr @{{_ZN8MoveOnly6createEv|"\?create\@MoveOnly\@\@SAPEAU1\@XZ"}}()
// CHECK: store ptr [[CREATED]], ptr [[X]]
// CHECK: store ptr [[CREATED]], ptr [[TMP]]
// CHECK: [[TMP_LOAD:%.*]] = load ptr, ptr [[TMP]]
// CHECK: call i32 @{{_ZNK8MoveOnly4testEv|"\?test\@MoveOnly\@\@QEBAHXZ"}}(ptr [[TMP_LOAD]])
// CHECK: ret void
public func test() {
var x = MoveOnly.create()
_ = x.test()
}