rust/tests/ui/autodiff/macro_hygiene.rs
2025-08-14 18:33:43 +00:00

23 lines
420 B
Rust

//@ 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));
}