Skip to content

Commit

Permalink
Fix Jacobian/constexprTest test
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailMihov committed Mar 19, 2024
1 parent 6ee2e26 commit aea7767
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions test/Jacobian/constexprTest.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 -std=c++14 -oconstexprTest.out
// RUN: ./constexprTest.out | FileCheck -check-prefix=CHECK-EXEC %s
// CHECK-NOT: {{.*error|warning|note:.*}}
// XFAIL: target={{i586.*}}

#include "clad/Differentiator/Differentiator.h"

Expand All @@ -25,16 +24,16 @@ constexpr void fn_mul(double i, double j, double *res) {
//CHECK-NEXT: res[1] = j * j;
//CHECK-NEXT: res[2] = i * j;
//CHECK-NEXT: {
//CHECK-NEXT: jacobianMatrix[4UL] += 1 * j;
//CHECK-NEXT: jacobianMatrix[5UL] += i * 1;
//CHECK-NEXT: jacobianMatrix[{{4U|4UL}}] += 1 * j;
//CHECK-NEXT: jacobianMatrix[{{5U|5UL}}] += i * 1;
//CHECK-NEXT: }
//CHECK-NEXT: {
//CHECK-NEXT: jacobianMatrix[3UL] += 1 * j;
//CHECK-NEXT: jacobianMatrix[3UL] += j * 1;
//CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += 1 * j;
//CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += j * 1;
//CHECK-NEXT: }
//CHECK-NEXT: {
//CHECK-NEXT: jacobianMatrix[0UL] += 1 * i;
//CHECK-NEXT: jacobianMatrix[0UL] += i * 1;
//CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += 1 * i;
//CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += i * 1;
//CHECK-NEXT: }
//CHECK-NEXT:}

Expand All @@ -49,23 +48,23 @@ constexpr void f_1(double x, double y, double z, double output[]) {
//CHECK-NEXT: output[1] = x * y * x + y * x * x;
//CHECK-NEXT: output[2] = z * x * 10 - y * z;
//CHECK-NEXT: {
//CHECK-NEXT: jacobianMatrix[8UL] += 1 * 10 * x;
//CHECK-NEXT: jacobianMatrix[6UL] += z * 1 * 10;
//CHECK-NEXT: jacobianMatrix[7UL] += -1 * z;
//CHECK-NEXT: jacobianMatrix[8UL] += y * -1;
//CHECK-NEXT: jacobianMatrix[{{8U|8UL}}] += 1 * 10 * x;
//CHECK-NEXT: jacobianMatrix[{{6U|6UL}}] += z * 1 * 10;
//CHECK-NEXT: jacobianMatrix[{{7U|7UL}}] += -1 * z;
//CHECK-NEXT: jacobianMatrix[{{8U|8UL}}] += y * -1;
//CHECK-NEXT: }
//CHECK-NEXT: {
//CHECK-NEXT: jacobianMatrix[3UL] += 1 * x * y;
//CHECK-NEXT: jacobianMatrix[4UL] += x * 1 * x;
//CHECK-NEXT: jacobianMatrix[3UL] += x * y * 1;
//CHECK-NEXT: jacobianMatrix[4UL] += 1 * x * x;
//CHECK-NEXT: jacobianMatrix[3UL] += y * 1 * x;
//CHECK-NEXT: jacobianMatrix[3UL] += y * x * 1;
//CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += 1 * x * y;
//CHECK-NEXT: jacobianMatrix[{{4U|4UL}}] += x * 1 * x;
//CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += x * y * 1;
//CHECK-NEXT: jacobianMatrix[{{4U|4UL}}] += 1 * x * x;
//CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += y * 1 * x;
//CHECK-NEXT: jacobianMatrix[{{3U|3UL}}] += y * x * 1;
//CHECK-NEXT: }
//CHECK-NEXT: {
//CHECK-NEXT: jacobianMatrix[0UL] += 1 * x * x;
//CHECK-NEXT: jacobianMatrix[0UL] += x * 1 * x;
//CHECK-NEXT: jacobianMatrix[0UL] += x * x * 1;
//CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += 1 * x * x;
//CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += x * 1 * x;
//CHECK-NEXT: jacobianMatrix[{{0U|0UL}}] += x * x * 1;
//CHECK-NEXT: }
//CHECK-NEXT:}

Expand All @@ -76,4 +75,4 @@ int main() {

TEST_JACOBIAN(fn_mul, 2, 6, 3, 1, result, jacobianou); // CHECK-EXEC: {6.00, 0.00, 0.00, 2.00, 1.00, 3.00}
TEST_JACOBIAN(f_1, 3, 9, 4, 5, 6, result1, jacobianou1); // CHECK-EXEC: {48.00, 0.00, 0.00, 80.00, 32.00, 0.00, 60.00, -6.00, 35.00}
}
}

0 comments on commit aea7767

Please sign in to comment.