Files
swift-mirror/validation-test/SILOptimizer/gh68328.swift
Nate Chandler 5325a4d5f8 [MoveOnlyAddressChecker] Fix empty struct repr.
An empty struct without a deinit gets a single bit which is used to
track the struct's liveness.  Previously, an empty struct with a deinit
also only got a single bit.  Consequently, when discarding the struct
(i.e. dropping the deinit), there was no bit left to represent the
struct.  This resulted in a failure to track liveness for the value.

rdar://126863003
2024-04-22 08:42:14 -07:00

20 lines
438 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -o %t/bin
// RUN: %target-codesign %t/bin
// RUN: %target-run %t/bin 2> %t/out.txt || true
// RUN: %FileCheck %s < %t/out.txt
// REQUIRES: executable_test
struct Example: ~Copyable {
private var failureString: String { "Goodbye." }
deinit { fatalError("FATAL ERROR: \(failureString)") }
}
func doit() {
let e = Example()
// CHECK: FATAL ERROR: Goodbye.
}
doit()