Files
swift-mirror/test/ClangImporter/enum-cxx.swift
Saleem Abdulrasool 357face86e test: introduce new target-swiftxx-frontend for C++ interop
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.
2021-01-12 11:45:36 -08:00

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
}