mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Immortal C++ foreign reference types get TrivialTypeLowering instead of ReferenceTypeLowering, since they do not have retain/release lifetime operations. This was tripping up an assertion in SILVerifier.
rdar://147251759 / resolves https://github.com/swiftlang/swift/issues/80065
(cherry picked from commit 2e3df1c0f3)
21 lines
469 B
Swift
21 lines
469 B
Swift
// RUN: %target-run-simple-swift(-I %S/Inputs -cxx-interoperability-mode=default -Xfrontend -disable-availability-checking) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
|
|
import POD
|
|
|
|
extension Empty {
|
|
public static func == (lhs: Empty, rhs: Empty) -> Bool {
|
|
Unmanaged.passUnretained(lhs).toOpaque() == Unmanaged.passUnretained(rhs).toOpaque()
|
|
}
|
|
}
|
|
|
|
let x = Empty.create()
|
|
let y = Empty.create()
|
|
|
|
print(x == y)
|
|
// CHECK: false
|
|
|
|
print(x == x)
|
|
// CHECK: true
|