about summary refs log tree commit diff
path: root/tests/ui/autodiff/zst.rs
blob: 7b9b5f5f20bdc0991bc99356c96f5505372de2b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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() {}