Skip to content

Commit 2633c9d

Browse files
committed
Fix old_runtime_crash_without_fixed_layout.swift to pass when optimizations are on
@_optimize(none) does not prevent LLVM from optimizing the function, and the LLVM optimizer was able to inline blackHole() and elide the metadata access altogether.
1 parent 34f8670 commit 2633c9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validation-test/Runtime/old_runtime_crash_without_fixed_layout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class ClassWithResilientField {
2929
@_optimize(none) func blackHole<T>(_: T) {}
3030

3131
@_optimize(none) func forceMetadata() {
32-
blackHole(ClassWithResilientField.self)
32+
blackHole(ClassWithResilientField())
3333
}
3434

3535
if #available(macOS 10.14.4, iOS 12.2, tvOS 12.2, watchOS 5.2, *) {

0 commit comments

Comments
 (0)