Skip to content

Commit f3c7cca

Browse files
committed
Workaround for test/AutoDiff/array.swift.
`-Xfrontend -enable-ownership-stripping-after-serialization` for swiftCore causes test/AutoDiff/array.swift to crash (regarding calls to `Array.recursivelyAllKeyPaths`). SR-11336 seems related and is reproducible from master. Disabling flag for swiftCore (and all other standard library modules) until SR-11336 is resolved. Temporarily disable affected test SILOptimizer/pound_assert.swift. TF-799 tracks re-enabling the test.
1 parent 6d51923 commit f3c7cca

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cmake/modules/SwiftSource.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,13 @@ function(_compile_swift_files
236236
if(NOT "${SWIFTFILE_MODULE_NAME}" STREQUAL "TensorFlow" AND
237237
NOT "${SWIFTFILE_MODULE_NAME}" STREQUAL "DifferentiationUnittest")
238238
list(APPEND swift_flags "-enable-library-evolution")
239-
list(APPEND swift_flags "-Xfrontend" "-enable-ownership-stripping-after-serialization")
240239
endif()
240+
# FIXME(SR-11336): `-enable-ownership-stripping-after-serialization` for
241+
# swiftCore causes test/AutoDiff/array.swift to crash, related to
242+
# Array and key paths.
243+
# Disabling the flag for swiftCore requires disabling the flag for all
244+
# other standard library modules.
245+
# list(APPEND swift_flags "-Xfrontend" "-enable-ownership-stripping-after-serialization")
241246
endif()
242247

243248
if(SWIFT_STDLIB_USE_NONATOMIC_RC)

test/SILOptimizer/pound_assert.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-swift-frontend -enable-experimental-static-assert -emit-sil %s -verify
2-
// RUN: %target-swift-frontend -enable-experimental-static-assert -enable-ownership-stripping-after-serialization -emit-sil %s -verify
2+
// SWIFT_ENABLE_TENSORFLOW
3+
// TODO(TF-799): Re-enable RUN line after SR-11336 is fixed.
4+
// UN: %target-swift-frontend -enable-experimental-static-assert -enable-ownership-stripping-after-serialization -emit-sil %s -verify
35

46
// REQUIRES: optimized_stdlib
57
// REQUIRES: asserts

0 commit comments

Comments
 (0)