mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 03:07:25 +00:00
23 lines
420 B
Rust
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));
|
|
}
|