Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions enzyme/test/Fortran/ReverseMode/square_with_bindings.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@
! handle the indirection involved in the enzyme_autodiff binding

program app
use enzyme, only: enzyme_autodiff
use enzyme, only: enzyme_dup, enzyme_autodiff
implicit none
real :: x, dx

! Test without an activity descriptor
x = 3
print *, square(x)

dx = 0
call enzyme_autodiff(square, x, dx)
print *, dx

! Test with an activity descriptor
x = 4
print *, square(x)
dx = 0
call enzyme_autodiff(square, enzyme_dup, x, dx)
print *, dx

contains
Expand All @@ -32,3 +38,5 @@ end program app

! CHECK: 9
! CHECK-NEXT: 6
! CHECK-NEXT: 16
! CHECK-NEXT: 8
Loading