From a072044299c8378635e74902cabfd8e97583aec4 Mon Sep 17 00:00:00 2001 From: Mihail Mihov Date: Tue, 19 Mar 2024 19:07:02 +0200 Subject: [PATCH] Fix Gradient/Switch test on i586 --- test/Gradient/Switch.C | 83 +++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/test/Gradient/Switch.C b/test/Gradient/Switch.C index 9c6e1b083..28897573d 100644 --- a/test/Gradient/Switch.C +++ b/test/Gradient/Switch.C @@ -1,7 +1,6 @@ // RUN: %cladclang %s -I%S/../../include -oSwitch.out 2>&1 -lstdc++ -lm | FileCheck %s // RUN: ./Switch.out | FileCheck -check-prefix=CHECK-EXEC %s //CHECK-NOT: {{.*error|warning|note:.*}} -// XFAIL: target={{i586.*}} #include "clad/Differentiator/Differentiator.h" #include "../TestUtils.h" @@ -24,7 +23,7 @@ double fn1(double i, double j) { // CHECK-NEXT: int _d_count = 0; // CHECK-NEXT: int _cond0; // CHECK-NEXT: double _t0; -// CHECK-NEXT: clad::tape _t1 = {}; +// CHECK-NEXT: clad::tape _t1 = {}; // CHECK-NEXT: double _t2; // CHECK-NEXT: double _t3; // CHECK-NEXT: double _t4; @@ -39,7 +38,7 @@ double fn1(double i, double j) { // CHECK-NEXT: _t0 = res; // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t1, 1UL); +// CHECK-NEXT: clad::push(_t1, {{1U|1UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } // CHECK-NEXT: { @@ -59,7 +58,7 @@ double fn1(double i, double j) { // CHECK-NEXT: res += i * i * j * j; // CHECK-NEXT: _t4 = res; // CHECK-NEXT: } -// CHECK-NEXT: clad::push(_t1, 2UL); +// CHECK-NEXT: clad::push(_t1, {{2U|2UL}}); // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: goto _label0; @@ -67,7 +66,7 @@ double fn1(double i, double j) { // CHECK-NEXT: _d_res += 1; // CHECK-NEXT: { // CHECK-NEXT: switch (clad::pop(_t1)) { -// CHECK-NEXT: case 2UL: +// CHECK-NEXT: case {{2U|2UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -103,7 +102,7 @@ double fn1(double i, double j) { // CHECK-NEXT: if (1 == _cond0) // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: case 1UL: +// CHECK-NEXT: case {{1U|1UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -140,7 +139,7 @@ double fn2(double i, double j) { // CHECK-NEXT: double _t0; // CHECK-NEXT: double _t1; // CHECK-NEXT: double _t2; -// CHECK-NEXT: clad::tape _t3 = {}; +// CHECK-NEXT: clad::tape _t3 = {}; // CHECK-NEXT: double _t4; // CHECK-NEXT: double _t5; // CHECK-NEXT: double _t6; @@ -159,7 +158,7 @@ double fn2(double i, double j) { // CHECK-NEXT: _t2 = res; // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t3, 1UL); +// CHECK-NEXT: clad::push(_t3, {{1U|1UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } // CHECK-NEXT: { @@ -173,7 +172,7 @@ double fn2(double i, double j) { // CHECK-NEXT: _t5 = res; // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t3, 2UL); +// CHECK-NEXT: clad::push(_t3, {{2U|2UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } // CHECK-NEXT: { @@ -181,7 +180,7 @@ double fn2(double i, double j) { // CHECK-NEXT: res += i + j; // CHECK-NEXT: _t6 = res; // CHECK-NEXT: } -// CHECK-NEXT: clad::push(_t3, 3UL); +// CHECK-NEXT: clad::push(_t3, {{3U|3UL}}); // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: goto _label0; @@ -189,7 +188,7 @@ double fn2(double i, double j) { // CHECK-NEXT: _d_res += 1; // CHECK-NEXT: { // CHECK-NEXT: switch (clad::pop(_t3)) { -// CHECK-NEXT: case 3UL: +// CHECK-NEXT: case {{3U|3UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -201,7 +200,7 @@ double fn2(double i, double j) { // CHECK-NEXT: if (_cond0 != 0 && _cond0 != 1 && _cond0 != 2) // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: case 2UL: +// CHECK-NEXT: case {{2U|2UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -222,7 +221,7 @@ double fn2(double i, double j) { // CHECK-NEXT: if (1 == _cond0) // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: case 1UL: +// CHECK-NEXT: case {{1U|1UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -269,11 +268,11 @@ double fn3(double i, double j) { // CHECK: void fn3_grad(double i, double j, clad::array_ref _d_i, clad::array_ref _d_j) { // CHECK-NEXT: double _d_res = 0; // CHECK-NEXT: int _d_counter = 0; -// CHECK-NEXT: unsigned long _t0; +// CHECK-NEXT: unsigned {{int|long}} _t0; // CHECK-NEXT: clad::tape _cond0 = {}; // CHECK-NEXT: clad::tape _t1 = {}; // CHECK-NEXT: clad::tape _t2 = {}; -// CHECK-NEXT: clad::tape _t3 = {}; +// CHECK-NEXT: clad::tape _t3 = {}; // CHECK-NEXT: clad::tape _t4 = {}; // CHECK-NEXT: clad::tape _t5 = {}; // CHECK-NEXT: double res = 0; @@ -297,7 +296,7 @@ double fn3(double i, double j) { // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t3, 1UL); +// CHECK-NEXT: clad::push(_t3, {{1U|1UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } // CHECK-NEXT: { @@ -310,7 +309,7 @@ double fn3(double i, double j) { // CHECK-NEXT: res += i + j; // CHECK-NEXT: clad::push(_t5, res); // CHECK-NEXT: } -// CHECK-NEXT: clad::push(_t3, 2UL); +// CHECK-NEXT: clad::push(_t3, {{2U|2UL}}); // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -322,7 +321,7 @@ double fn3(double i, double j) { // CHECK-NEXT: { // CHECK-NEXT: { // CHECK-NEXT: switch (clad::pop(_t3)) { -// CHECK-NEXT: case 2UL: +// CHECK-NEXT: case {{2U|2UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -344,7 +343,7 @@ double fn3(double i, double j) { // CHECK-NEXT: if (2 == clad::back(_cond0)) // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: case 1UL: +// CHECK-NEXT: case {{1U|1UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -395,10 +394,10 @@ double fn4(double i, double j) { // CHECK: void fn4_grad(double i, double j, clad::array_ref _d_i, clad::array_ref _d_j) { // CHECK-NEXT: double _d_res = 0; // CHECK-NEXT: double _t0; -// CHECK-NEXT: clad::tape _t1 = {}; +// CHECK-NEXT: clad::tape _t1 = {}; // CHECK-NEXT: int _d_counter = 0; // CHECK-NEXT: int counter = 0; -// CHECK-NEXT: unsigned long _t2; +// CHECK-NEXT: unsigned {{int|long}} _t2; // CHECK-NEXT: clad::tape _t3 = {}; // CHECK-NEXT: double res = 0; // CHECK-NEXT: { @@ -409,7 +408,7 @@ double fn4(double i, double j) { // CHECK-NEXT: _t0 = res; // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t1, 1UL); +// CHECK-NEXT: clad::push(_t1, {{1U|1UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } // CHECK-NEXT: { @@ -424,10 +423,10 @@ double fn4(double i, double j) { // CHECK-NEXT: res += i * j; // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t1, 2UL); +// CHECK-NEXT: clad::push(_t1, {{2U|2UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: clad::push(_t1, 3UL); +// CHECK-NEXT: clad::push(_t1, {{3U|3UL}}); // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: goto _label0; @@ -435,9 +434,9 @@ double fn4(double i, double j) { // CHECK-NEXT: _d_res += 1; // CHECK-NEXT: { // CHECK-NEXT: switch (clad::pop(_t1)) { -// CHECK-NEXT: case 3UL: +// CHECK-NEXT: case {{3U|3UL}}: // CHECK-NEXT: ; -// CHECK-NEXT: case 2UL: +// CHECK-NEXT: case {{2U|2UL}}: // CHECK-NEXT: ; // CHECK-NEXT: while (_t2) // CHECK-NEXT: { @@ -455,7 +454,7 @@ double fn4(double i, double j) { // CHECK-NEXT: if (1 == 1) // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: case 1UL: +// CHECK-NEXT: case {{1U|1UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -487,7 +486,7 @@ double fn5(double i, double j) { // CHECK-NEXT: int count = 0; // CHECK-NEXT: int _cond0; // CHECK-NEXT: double _t0; -// CHECK-NEXT: clad::tape _t1 = {}; +// CHECK-NEXT: clad::tape _t1 = {}; // CHECK-NEXT: double res = 0; // CHECK-NEXT: { // CHECK-NEXT: count = 1; @@ -496,7 +495,7 @@ double fn5(double i, double j) { // CHECK-NEXT: case 1: // CHECK-NEXT: res += i * j; // CHECK-NEXT: _t0 = res; -// CHECK-NEXT: clad::push(_t1, 1UL); +// CHECK-NEXT: clad::push(_t1, {{1U|1UL}}); // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: goto _label0; @@ -504,7 +503,7 @@ double fn5(double i, double j) { // CHECK-NEXT: _d_res += 1; // CHECK-NEXT: { // CHECK-NEXT: switch (clad::pop(_t1)) { -// CHECK-NEXT: case 1UL: +// CHECK-NEXT: case {{1U|1UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: res = _t0; @@ -534,7 +533,7 @@ double fn6(double u, double v) { // CHECK-NEXT: int _t0; // CHECK-NEXT: int _cond0; // CHECK-NEXT: double _t1; -// CHECK-NEXT: clad::tape _t2 = {}; +// CHECK-NEXT: clad::tape _t2 = {}; // CHECK-NEXT: int res = 0; // CHECK-NEXT: double temp = 0; // CHECK-NEXT: { @@ -547,7 +546,7 @@ double fn6(double u, double v) { // CHECK-NEXT: temp = 1; // CHECK-NEXT: _t1 = temp; // CHECK-NEXT: } -// CHECK-NEXT: clad::push(_t2, 1UL); +// CHECK-NEXT: clad::push(_t2, {{1U|1UL}}); // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: goto _label0; @@ -555,7 +554,7 @@ double fn6(double u, double v) { // CHECK-NEXT: _d_res += 1; // CHECK-NEXT: { // CHECK-NEXT: switch (clad::pop(_t2)) { -// CHECK-NEXT: case 1UL: +// CHECK-NEXT: case {{1U|1UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -597,12 +596,12 @@ double fn7(double u, double v) { // CHECK: void fn7_grad(double u, double v, clad::array_ref _d_u, clad::array_ref _d_v) { // CHECK-NEXT: double _d_res = 0; -// CHECK-NEXT: unsigned long _t0; +// CHECK-NEXT: unsigned {{int|long}} _t0; // CHECK-NEXT: int _d_i = 0; // CHECK-NEXT: int i = 0; // CHECK-NEXT: clad::tape _cond0 = {}; // CHECK-NEXT: clad::tape _t1 = {}; -// CHECK-NEXT: clad::tape _t2 = {}; +// CHECK-NEXT: clad::tape _t2 = {}; // CHECK-NEXT: clad::tape _t3 = {}; // CHECK-NEXT: double res = 0; // CHECK-NEXT: _t0 = 0; @@ -622,7 +621,7 @@ double fn7(double u, double v) { // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t2, 1UL); +// CHECK-NEXT: clad::push(_t2, {{1U|1UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } // CHECK-NEXT: { @@ -634,10 +633,10 @@ double fn7(double u, double v) { // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: { -// CHECK-NEXT: clad::push(_t2, 2UL); +// CHECK-NEXT: clad::push(_t2, {{2U|2UL}}); // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: clad::push(_t2, 3UL); +// CHECK-NEXT: clad::push(_t2, {{3U|3UL}}); // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -648,9 +647,9 @@ double fn7(double u, double v) { // CHECK-NEXT: --i; // CHECK-NEXT: { // CHECK-NEXT: switch (clad::pop(_t2)) { -// CHECK-NEXT: case 3UL: +// CHECK-NEXT: case {{3U|3UL}}: // CHECK-NEXT: ; -// CHECK-NEXT: case 2UL: +// CHECK-NEXT: case {{2U|2UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -665,7 +664,7 @@ double fn7(double u, double v) { // CHECK-NEXT: if (3 == clad::back(_cond0)) // CHECK-NEXT: break; // CHECK-NEXT: } -// CHECK-NEXT: case 1UL: +// CHECK-NEXT: case {{1U|1UL}}: // CHECK-NEXT: ; // CHECK-NEXT: { // CHECK-NEXT: { @@ -714,4 +713,4 @@ int main() { TEST_GRADIENT(fn6, 2, 3, 5, &result[0], &result[1]); // CHECK-EXEC: {5.00, 3.00} TEST_GRADIENT(fn7, 2, 3, 5, &result[0], &result[1]); // CHECK-EXEC: {3.00, 2.00} -} \ No newline at end of file +}