about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarcelo Domínguez <dmmarcelo27@gmail.com>2025-08-03 11:12:34 +0000
committerMarcelo Domínguez <dmmarcelo27@gmail.com>2025-09-17 12:11:27 +0000
commit0bf85d35ec9ed9cbffd274def09027c5fe9a8f3c (patch)
tree8afd3d0323b6b1cff6282d3f2158c3700876a647 /tests
parent8dbd1b014ac43cc9c950e3b7e112b62d0963ec17 (diff)
downloadrust-0bf85d35ec9ed9cbffd274def09027c5fe9a8f3c.tar.gz
rust-0bf85d35ec9ed9cbffd274def09027c5fe9a8f3c.zip
Support ZST args
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/autodiff/zst.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/autodiff/zst.rs b/tests/ui/autodiff/zst.rs
new file mode 100644
index 00000000000..7b9b5f5f20b
--- /dev/null
+++ b/tests/ui/autodiff/zst.rs
@@ -0,0 +1,17 @@
+//@ compile-flags: -Zautodiff=Enable -C opt-level=3 -Clto=fat
+//@ no-prefer-dynamic
+//@ needs-enzyme
+//@ build-pass
+
+// Check that differentiating functions with ZST args does not break
+
+#![feature(autodiff)]
+
+#[core::autodiff::autodiff_forward(fd_inner, Const, Dual)]
+fn f(_zst: (), _x: &mut f64) {}
+
+fn fd(x: &mut f64, xd: &mut f64) {
+    fd_inner((), x, xd);
+}
+
+fn main() {}