mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add an convert to the new `target-swiftxx-frontend` substitution in lit to control the C++ interop enabling in Swift. This allows for a single site which will enable control of both an overridden standard (for testing multiple C++ standards) and simplify writing tests.
12 lines
491 B
Swift
12 lines
491 B
Swift
// RUN: %target-swiftxx-frontend -emit-ir -primary-file %s -I %S/Inputs/custom-modules -o - | %FileCheck %s
|
|
|
|
import CXXInterop
|
|
|
|
// CHECK-LABEL: define hidden swiftcc i8 @"$s4main19testEmptyEnumImport5values4Int8VSo04OpencD0V_tF"(i8 %0)
|
|
// CHECK: %1 = call swiftcc i8 @"$sSo13OpenEmptyEnumV8rawValues4Int8Vvg"(i8 %0)
|
|
// CHECK: ret i8 %1
|
|
func testEmptyEnumImport(value: OpenEmptyEnum) -> Int8 {
|
|
// Should still compile even though the enum is uninhabited in c++.
|
|
return value.rawValue
|
|
}
|