Skip to content

Commit 1e79e03

Browse files
author
Mingsheng Hong
authored
Added a test case for the const-folding crash due to (#18412)
MultipleValueInstructionResult, which got fixed in #18272. Confirmed this test crashes without that fix.
1 parent 2ce426d commit 1e79e03

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/TensorFlow/crashers.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,14 @@ func SR8316_main() {
350350
let float: Float = 0.1 // expected-warning {{immutable value 'float' was never used}}
351351
_ = SR8316_helper()
352352
}
353+
354+
func readDataset() -> (images: Tensor<Float>, labels: Tensor<Int32>)? {
355+
print("Reading the data.")
356+
return (Tensor<Float>(1.0), Tensor<Int32>(1))
357+
}
358+
359+
public func constFoldingBug() {
360+
guard let _ = readDataset() else {
361+
return
362+
}
363+
}

0 commit comments

Comments
 (0)