about summary refs log tree commit diff
path: root/tests/ui/autodiff/macro_hygiene.rs
blob: dec58254b9953209f478d347d2c9b329680fe4ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//@ compile-flags: -Zautodiff=Enable -C opt-level=3  -Clto=fat
//@ no-prefer-dynamic
//@ needs-enzyme
//@ check-pass

// In the past, we just checked for correct macro hygiene information.

#![feature(autodiff)]

macro_rules! demo {
    () => {
        #[std::autodiff::autodiff_reverse(fd, Active, Active)]
        fn f(x: f64) -> f64 {
            x * x
        }
    };
}
demo!();

fn main() {
    dbg!(f(2.0f64));
}