diff --git a/test/Gradient/FunctionCalls.C b/test/Gradient/FunctionCalls.C index 3bfd3da8d..e5d7b2833 100644 --- a/test/Gradient/FunctionCalls.C +++ b/test/Gradient/FunctionCalls.C @@ -728,6 +728,36 @@ double fn13(double* x, const double* w) { // CHECK-NEXT: } // CHECK-NEXT: } +void emptyFn(double &x, double y) {} + +// CHECK: void emptyFn_pullback(double &x, double y, clad::array_ref _d_x, clad::array_ref _d_y) { +// CHECK-NEXT: } + +double fn14(double x, double y) { + emptyFn(x, y); + return x + y; +} + +// CHECK: void fn14_grad(double x, double y, clad::array_ref _d_x, clad::array_ref _d_y) { +// CHECK-NEXT: double _t0; +// CHECK-NEXT: _t0 = x; +// CHECK-NEXT: emptyFn(x, y); +// CHECK-NEXT: goto _label0; +// CHECK-NEXT: _label0: +// CHECK-NEXT: { +// CHECK-NEXT: * _d_x += 1; +// CHECK-NEXT: * _d_y += 1; +// CHECK-NEXT: } +// CHECK-NEXT: { +// CHECK-NEXT: x = _t0; +// CHECK-NEXT: double _grad1 = 0.; +// CHECK-NEXT: emptyFn_pullback(_t0, y, &* _d_x, &_grad1); +// CHECK-NEXT: double _r0 = * _d_x; +// CHECK-NEXT: double _r1 = _grad1; +// CHECK-NEXT: * _d_y += _r1; +// CHECK-NEXT: } +// CHECK-NEXT: } + template void reset(T* arr, int n) { for (int i=0; i