Skip to content

Commit 1d423e4

Browse files
authored
Merge pull request #30776 from dan-zheng/autodiff-crasher
[AutoDiff] Disable failing test with `-O`.
2 parents 172d57f + c6f2d7a commit 1d423e4

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: not %target-build-swift -O %s
2+
3+
// SR-12493: SIL verification error regarding substituted function types and
4+
// `differentiable_function_extract` instruction. Occurs only with `-O`.
5+
6+
import _Differentiation
7+
8+
func exampleVJP_1(_ x0: Float) -> (Float, (Float) -> (Float)) {
9+
(
10+
x0 * x0,
11+
{ (2 * x0 * $0) }
12+
)
13+
}
14+
15+
func bar() {
16+
let f = differentiableFunction(from: exampleVJP_1)
17+
let pb = pullback(at: 10, in: f)
18+
_ = pb(1)
19+
}

test/AutoDiff/stdlib/differential_operators.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// RUN: %target-run %t/differential_operators
55
// REQUIRES: executable_test
66

7+
// FIXME(SR-12493): Disable test for `-O` due to SIL verification error.
8+
// REQUIRES: swift_test_mode_optimize_none
9+
710
import _Differentiation
811

912
import StdlibUnittest

0 commit comments

Comments
 (0)