mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
848fad00 introduced support for printing foreign reference types. It changes both the compiler and the runtime, and having the runtime change applied is required for the test to pass. Let's not try to run it with an old runtime.
This change also splits up a test for printing of value types from a test for printing of foreign reference types, since we don't have any runtime restrictions for value types.
rdar://153205860
38 lines
894 B
Swift
38 lines
894 B
Swift
// RUN: %target-run-simple-swift(-cxx-interoperability-mode=default -I %S/Inputs) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
|
|
import SimpleStructs
|
|
|
|
func printCxxStructPrivateFields() {
|
|
let s = HasPrivateFieldsOnly(1, 2)
|
|
print(s)
|
|
}
|
|
|
|
func printCxxStructPublicFields() {
|
|
let s = HasPublicFieldsOnly(1, 2)
|
|
print(s)
|
|
}
|
|
|
|
func printCxxStructPrivatePublicProtectedFields() {
|
|
let s = HasPrivatePublicProtectedFields(1, 2, 3, 4, 5, 6)
|
|
print(s)
|
|
}
|
|
|
|
func printCxxStructNested() {
|
|
let s = Outer()
|
|
print(s)
|
|
}
|
|
|
|
printCxxStructPrivateFields()
|
|
// CHECK: HasPrivateFieldsOnly()
|
|
|
|
printCxxStructPublicFields()
|
|
// CHECK: HasPublicFieldsOnly(publ1: 1, publ2: 2)
|
|
|
|
printCxxStructPrivatePublicProtectedFields()
|
|
// CHECK: HasPrivatePublicProtectedFields(publ1: 2, publ2: 6)
|
|
|
|
printCxxStructNested()
|
|
// CHECK: Outer(publStruct: {{.*}}.HasPrivatePublicProtectedFields(publ1: 8, publ2: 12))
|