Skip to content

Commit

Permalink
Fix Jacobian/TemplateFunctors
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailMihov committed Mar 19, 2024
1 parent aea7767 commit a040eab
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions test/Jacobian/TemplateFunctors.C
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// RUN: %cladclang -Xclang -plugin-arg-clad -Xclang -enable-tbr %s -I%S/../../include -oTemplateFunctors.out
// RUN: ./TemplateFunctors.out | FileCheck -check-prefix=CHECK-EXEC %s
// CHECK-NOT: {{.*error|warning|note:.*}}
// XFAIL: target={{i586.*}}

#include "clad/Differentiator/Differentiator.h"

Expand All @@ -21,12 +20,12 @@ template <typename T> struct Experiment {
// CHECK-NEXT: output[0] = this->x * this->y * i * j;
// CHECK-NEXT: output[1] = 2 * this->x * this->y * i * j;
// CHECK-NEXT: {
// CHECK-NEXT: jacobianMatrix[2UL] += 2 * this->x * this->y * 1 * j;
// CHECK-NEXT: jacobianMatrix[3UL] += 2 * this->x * this->y * i * 1;
// CHECK-NEXT: jacobianMatrix[{{2U|2UL}}] += 2 * this->x * this->y * 1 * j;
// CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += 2 * this->x * this->y * i * 1;
// CHECK-NEXT: }
// CHECK-NEXT: {
// CHECK-NEXT: jacobianMatrix[0UL] += this->x * this->y * 1 * j;
// CHECK-NEXT: jacobianMatrix[1UL] += this->x * this->y * i * 1;
// CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += this->x * this->y * 1 * j;
// CHECK-NEXT: jacobianMatrix[{{1U|1UL}}] += this->x * this->y * i * 1;
// CHECK-NEXT: }
// CHECK-NEXT: }

Expand All @@ -44,14 +43,14 @@ template <> struct Experiment<long double> {
// CHECK-NEXT: output[0] = this->x * this->y * i * i * j;
// CHECK-NEXT: output[1] = 2 * this->x * this->y * i * i * j;
// CHECK-NEXT: {
// CHECK-NEXT: jacobianMatrix[2UL] += 2 * this->x * this->y * 1 * j * i;
// CHECK-NEXT: jacobianMatrix[2UL] += 2 * this->x * this->y * i * 1 * j;
// CHECK-NEXT: jacobianMatrix[3UL] += 2 * this->x * this->y * i * i * 1;
// CHECK-NEXT: jacobianMatrix[{{2U|2UL}}] += 2 * this->x * this->y * 1 * j * i;
// CHECK-NEXT: jacobianMatrix[{{2U|2UL}}] += 2 * this->x * this->y * i * 1 * j;
// CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += 2 * this->x * this->y * i * i * 1;
// CHECK-NEXT: }
// CHECK-NEXT: {
// CHECK-NEXT: jacobianMatrix[0UL] += this->x * this->y * 1 * j * i;
// CHECK-NEXT: jacobianMatrix[0UL] += this->x * this->y * i * 1 * j;
// CHECK-NEXT: jacobianMatrix[1UL] += this->x * this->y * i * i * 1;
// CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += this->x * this->y * 1 * j * i;
// CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += this->x * this->y * i * 1 * j;
// CHECK-NEXT: jacobianMatrix[{{0U|1UL}}] += this->x * this->y * i * i * 1;
// CHECK-NEXT: }
// CHECK-NEXT: }

Expand Down Expand Up @@ -100,4 +99,4 @@ int main() {

TEST_DOUBLE(E, 7, 9); // CHECK-EXEC: {225.00, 175.00, 450.00, 350.00} {225.00, 175.00, 450.00, 350.00}
TEST_LONG_DOUBLE(E_ld, 7, 9); // CHECK-EXEC: {3150.00, 1225.00, 6300.00, 2450.00} {3150.00, 1225.00, 6300.00, 2450.00}
}
}

0 comments on commit a040eab

Please sign in to comment.