Skip to content

Commit 7295960

Browse files
committed
Add debug output
1 parent 7a406de commit 7295960

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

stdlib/public/runtime/BytecodeLayouts.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,11 +983,13 @@ static void handleRefCountsInitWithCopy(const Metadata *metadata,
983983
uintptr_t _addrOffset = addrOffset;
984984
auto tag = reader.readBytes<uint64_t>();
985985
auto offset = (tag & ~(0xFFULL << 56));
986+
tag >>= 56;
987+
fprintf(stderr, "===== TAG: %llu, OFFSET: %llu, addrOffset: %lu\n", tag, offset, _addrOffset);
986988
if (SWIFT_UNLIKELY(offset)) {
987989
memcpy(dest + _addrOffset, src + _addrOffset, offset);
988990
}
989991
addrOffset = _addrOffset + offset;
990-
tag >>= 56;
992+
991993
if (SWIFT_UNLIKELY(tag == 0)) {
992994
return;
993995
}

test/Interpreter/layout_string_witnesses_dynamic.swift

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -781,40 +781,40 @@ func testGenericSinglePayloadEnumManyXI() {
781781

782782
testGenericSinglePayloadEnumManyXI()
783783

784-
// struct RefPlusEnumResolve {
785-
// let x: SimpleClass
786-
// let y: ResilientSinglePayloadEnumComplex
787-
// }
784+
struct RefPlusEnumResolve {
785+
let x: SimpleClass
786+
let y: ResilientSinglePayloadEnumComplex
787+
}
788788

789-
// func testRefPlusEnumResolve() {
790-
// let ptr = allocateInternalGenericPtr(of: RefPlusEnumResolve.self)
789+
func testRefPlusEnumResolve() {
790+
let ptr = allocateInternalGenericPtr(of: RefPlusEnumResolve.self)
791791

792-
// do {
793-
// let x = RefPlusEnumResolve(x: SimpleClass(x: 23), y: .nonEmpty(.nonEmpty1(SimpleClass(x: 23))))
794-
// testGenericInit(ptr, to: x)
795-
// }
792+
do {
793+
let x = RefPlusEnumResolve(x: SimpleClass(x: 23), y: .nonEmpty(.nonEmpty1(SimpleClass(x: 23))))
794+
testGenericInit(ptr, to: x)
795+
}
796796

797-
// do {
798-
// let y = RefPlusEnumResolve(x: SimpleClass(x: 23), y: .nonEmpty(.nonEmpty1(SimpleClass(x: 23))))
799-
// // DISABLED-CHECK: Before deinit
800-
// print("Before deinit")
797+
do {
798+
let y = RefPlusEnumResolve(x: SimpleClass(x: 23), y: .nonEmpty(.nonEmpty1(SimpleClass(x: 23))))
799+
// CHECK: Before deinit
800+
print("Before deinit")
801801

802-
// // DISABLED-CHECK-NEXT: SimpleClass deinitialized!
803-
// // DISABLED-CHECK-NEXT: SimpleClass deinitialized!
804-
// testGenericAssign(ptr, from: y)
805-
// }
802+
// CHECK-NEXT: SimpleClass deinitialized!
803+
// CHECK-NEXT: SimpleClass deinitialized!
804+
testGenericAssign(ptr, from: y)
805+
}
806806

807-
// // DISABLED-CHECK-NEXT: Before deinit
808-
// print("Before deinit")
807+
// CHECK-NEXT: Before deinit
808+
print("Before deinit")
809809

810-
// // DISABLED-CHECK-NEXT: SimpleClass deinitialized!
811-
// // DISABLED-CHECK-NEXT: SimpleClass deinitialized!
812-
// testGenericDestroy(ptr, of: RefPlusEnumResolve.self)
810+
// CHECK-NEXT: SimpleClass deinitialized!
811+
// CHECK-NEXT: SimpleClass deinitialized!
812+
testGenericDestroy(ptr, of: RefPlusEnumResolve.self)
813813

814-
// ptr.deallocate()
815-
// }
814+
ptr.deallocate()
815+
}
816816

817-
// testRefPlusEnumResolve()
817+
testRefPlusEnumResolve()
818818

819819
func testResilientSingletonEnumTag() {
820820
let x = switch getResilientSingletonEnumNonEmpty(SimpleClass(x: 23)) {

0 commit comments

Comments
 (0)