about summary refs log tree commit diff
path: root/tests/ui/autodiff/flag_nott.rs
blob: faa9949fe81678bf069ecd94fda3b0980c3b726d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ compile-flags: -Zautodiff=Enable,NoTT
//@ needs-enzyme
//@ check-pass

#![feature(autodiff)]

use std::autodiff::autodiff_reverse;

// Test that NoTT flag is accepted and doesn't cause compilation errors
#[autodiff_reverse(d_square, Duplicated, Active)]
fn square(x: &f64) -> f64 {
    x * x
}

fn main() {
    let x = 2.0;
    let mut dx = 0.0;
    let result = d_square(&x, &mut dx, 1.0);
}