1111//===----------------------------------------------------------------------===//
1212
1313// RUN: %target-run-simple-swift
14+ // RUN: %target-run-simple-swift(-Xfrontend -disable-reflection-names -DNO_FIELD_NAMES)
1415// REQUIRES: executable_test
1516// REQUIRES: reflection
1617
@@ -150,6 +151,14 @@ func checkFields<T>(
150151 count += 1
151152
152153 let fieldName = String ( cString: charPtr)
154+ if fieldName == " " {
155+ #if NO_FIELD_NAMES
156+ expectTrue ( fields. values. contains { $0 == offset && $1 == type } )
157+ #else
158+ expectTrue ( false , " Empty field name " )
159+ #endif
160+ return true
161+ }
153162 guard let ( checkOffset, checkType) = fields [ fieldName] else {
154163 expectTrue ( false , " Unexpected field ' \( fieldName) ' " )
155164 return true
@@ -176,6 +185,14 @@ func checkFieldsWithKeyPath<T>(
176185 count += 1
177186
178187 let fieldName = String ( cString: charPtr)
188+ if fieldName == " " {
189+ #if NO_FIELD_NAMES
190+ expectTrue ( fields. values. contains { $0 == keyPath } )
191+ #else
192+ expectTrue ( false , " Empty field name " )
193+ #endif
194+ return true
195+ }
179196 guard let checkKeyPath = fields [ fieldName] else {
180197 expectTrue ( false , " Unexpected field ' \( fieldName) ' " )
181198 return true
@@ -450,8 +467,13 @@ if #available(SwiftStdlib 5.2, *) {
450467 charPtr, _, type, _ in
451468
452469 let fieldName = String ( cString: charPtr)
470+ #if NO_FIELD_NAMES
471+ return type == ( Double, Double) . self
472+ && fieldName == " "
473+ #else
453474 return type == ( Double, Double) . self
454475 && fieldName == " point "
476+ #endif
455477 } )
456478
457479 expectTrue ( _forEachField ( of: EmptyNSObject . self, options: . classType) {
0 commit comments