Skip to content

Commit

Permalink
Merge pull request #72354 from tbkka/tbkka-progress-for-bridge-object…
Browse files Browse the repository at this point in the history
…-test

Add some progress info to make failures here easier to understand
  • Loading branch information
tbkka authored Aug 1, 2024
2 parents 926bd6c + fe82cde commit 713aafe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/Interpreter/builtin_bridge_object.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func nonPointerBits(_ x: Builtin.BridgeObject) -> UInt {

// Try without any bits set.
if true {
print("No bits set") // CHECK: No bits set
let x = C()
let bo = Builtin.castToBridgeObject(x, 0._builtinWordValue)
let bo2 = bo
Expand Down Expand Up @@ -90,6 +91,7 @@ if true {

// Try with all spare bits set.
if true {
print("All spare bits set") // CHECK: All spare bits set
let x = C()
let bo = Builtin.castToBridgeObject(x, NATIVE_SPARE_BITS._builtinWordValue)

Expand Down Expand Up @@ -128,6 +130,7 @@ func nonNativeBridgeObject(_ o: AnyObject) -> Builtin.BridgeObject {
// Try with a (probably) tagged pointer. No bits may be masked into a
// non-native object.
if true {
print("Tagged pointer") // CHECK: Tagged pointer
let x = NSNumber(value: 22)
let bo = nonNativeBridgeObject(x)
let bo2 = bo
Expand Down Expand Up @@ -159,6 +162,7 @@ var unTaggedString: NSString {

// Try with an un-tagged pointer.
if true {
print("Untagged pointer") // CHECK: Untagged pointer
let x = unTaggedString
let bo = nonNativeBridgeObject(x)
let bo2 = bo
Expand Down Expand Up @@ -195,6 +199,8 @@ func hitOptionalSpecifically(_ x: Builtin.BridgeObject?) {
}

if true {
print("BridgeObject") // CHECK: BridgeObject

// CHECK-NEXT: true
print(MemoryLayout<Optional<Builtin.BridgeObject>>.size
== MemoryLayout<Builtin.BridgeObject>.size)
Expand Down

0 comments on commit 713aafe

Please sign in to comment.