Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Jan 10, 2024
1 parent e62c8aa commit 6de0fb0
Show file tree
Hide file tree
Showing 33 changed files with 1,675 additions and 1,059 deletions.
440 changes: 275 additions & 165 deletions test/Arrays/ArrayInputsReverseMode.C

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/Arrays/Arrays.C
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ double const_dot_product(double x, double y, double z) {
//CHECK-NEXT: double consts[3] = {1, 2, 3};
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: _d_vars[0] += 1 * consts[0];
//CHECK-NEXT: _d_consts[0] += vars[0] * 1;
Expand Down
7 changes: 7 additions & 0 deletions test/ErrorEstimation/Assignments.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ float func(float x, float y) {
//CHECK-NEXT: y = x;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: * _d_y += 1;
//CHECK-NEXT: {
//CHECK-NEXT: y = _t1;
Expand Down Expand Up @@ -63,6 +64,7 @@ float func2(float x, int y) {
//CHECK-NEXT: _EERepl_x1 = x;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: * _d_x += 1;
//CHECK-NEXT: {
//CHECK-NEXT: x = _t0;
Expand Down Expand Up @@ -90,6 +92,7 @@ float func3(int x, int y) {
//CHECK-NEXT: x = y;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: * _d_y += 1;
//CHECK-NEXT: {
//CHECK-NEXT: x = _t0;
Expand Down Expand Up @@ -121,6 +124,7 @@ float func4(float x, float y) {
//CHECK-NEXT: _EERepl_x1 = x;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: * _d_x += 1;
//CHECK-NEXT: {
//CHECK-NEXT: x = _t0;
Expand Down Expand Up @@ -156,6 +160,7 @@ float func5(float x, float y) {
//CHECK-NEXT: _EERepl_x1 = x;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: * _d_x += 1;
//CHECK-NEXT: {
//CHECK-NEXT: x = _t0;
Expand All @@ -177,6 +182,7 @@ float func6(float x) { return x; }
//CHECK: void func6_grad(float x, clad::array_ref<float> _d_x, double &_final_error) {
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: * _d_x += 1;
//CHECK-NEXT: double _delta_x = 0;
//CHECK-NEXT: _delta_x += std::abs(* _d_x * x * {{.+}});
Expand All @@ -190,6 +196,7 @@ float func7(float x, float y) { return (x * y); }
//CHECK-NEXT: _ret_value0 = (x * y);
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += 1 * y;
//CHECK-NEXT: * _d_y += x * 1;
Expand Down
11 changes: 11 additions & 0 deletions test/ErrorEstimation/BasicOps.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ float func(float x, float y) {
//CHECK-NEXT: _EERepl_z0 = z;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: _d_z += 1;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_y += _d_z * x;
Expand Down Expand Up @@ -92,6 +93,7 @@ float func2(float x, float y) {
//CHECK-NEXT: _EERepl_z0 = z;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: _d_z += 1;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_y += _d_z / x;
Expand Down Expand Up @@ -153,6 +155,7 @@ float func3(float x, float y) {
//CHECK-NEXT: _EERepl_y1 = y;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: _d_t += 1;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += _d_t * _t1 * z;
Expand Down Expand Up @@ -191,6 +194,7 @@ float func4(float x, float y) { return std::pow(x, y); }
//CHECK-NEXT: _ret_value0 = std::pow(x, y);
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: float _grad0 = 0.F;
//CHECK-NEXT: float _grad1 = 0.F;
Expand Down Expand Up @@ -225,6 +229,7 @@ float func5(float x, float y) {
//CHECK-NEXT: _ret_value0 = y * y;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_y += 1 * y;
//CHECK-NEXT: * _d_y += y * 1;
Expand Down Expand Up @@ -252,6 +257,7 @@ double helper(double x, double y) { return x * y; }
//CHECK-NEXT: _ret_value0 = x * y;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += _d_y0 * y;
//CHECK-NEXT: * _d_y += x * _d_y0;
Expand All @@ -278,6 +284,7 @@ float func6(float x, float y) {
//CHECK-NEXT: _ret_value0 = z * z;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: _d_z += 1 * z;
//CHECK-NEXT: _d_z += z * 1;
Expand Down Expand Up @@ -310,6 +317,7 @@ float func7(float x) {
//CHECK-NEXT: int z = x;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: _d_z += 1;
//CHECK-NEXT: _d_z += 1;
Expand All @@ -328,6 +336,7 @@ double helper2(float& x) { return x * x; }
//CHECK-NEXT: _ret_value0 = x * x;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += _d_y * x;
//CHECK-NEXT: * _d_x += x * _d_y;
Expand Down Expand Up @@ -356,6 +365,7 @@ float func8(float x, float y) {
//CHECK-NEXT: _EERepl_z1 = z;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: _d_z += 1;
//CHECK-NEXT: {
//CHECK-NEXT: z = _t0;
Expand Down Expand Up @@ -405,6 +415,7 @@ float func9(float x, float y) {
//CHECK-NEXT: _EERepl_z1 = z;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: _d_z += 1;
//CHECK-NEXT: {
//CHECK-NEXT: z = _t3;
Expand Down
13 changes: 11 additions & 2 deletions test/ErrorEstimation/ConditonalStatements.C
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ float func(float x, float y) {
//CHECK-NEXT: float _t1;
//CHECK-NEXT: float _EERepl_temp1;
//CHECK-NEXT: float _t2;
//CHECK-NEXT: float _t3;
//CHECK-NEXT: double _ret_value0 = 0;
//CHECK-NEXT: _cond0 = x > y;
//CHECK-NEXT: if (_cond0) {
Expand All @@ -43,10 +44,12 @@ float func(float x, float y) {
//CHECK-NEXT: _EERepl_temp1 = temp;
//CHECK-NEXT: _t2 = x;
//CHECK-NEXT: x = y;
//CHECK-NEXT: _t3 = temp;
//CHECK-NEXT: }
//CHECK-NEXT: _ret_value0 = x + y;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += 1;
//CHECK-NEXT: * _d_y += 1;
Expand All @@ -62,6 +65,7 @@ float func(float x, float y) {
//CHECK-NEXT: * _d_y;
//CHECK-NEXT: }
//CHECK-NEXT: } else {
//CHECK-NEXT: float temp = _t3;
//CHECK-NEXT: {
//CHECK-NEXT: x = _t2;
//CHECK-NEXT: float _r_d2 = * _d_x;
Expand Down Expand Up @@ -110,18 +114,21 @@ float func2(float x) {
//CHECK-NEXT: _ret_value0 = x * x;
//CHECK-NEXT: goto _label1;
//CHECK-NEXT: }
//CHECK-NEXT: if (_cond0)
//CHECK-NEXT: if (_cond0) {
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += 1;
//CHECK-NEXT: * _d_x += 1;
//CHECK-NEXT: }
//CHECK-NEXT: else
//CHECK-NEXT: } else {
//CHECK-NEXT: _label1:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += 1 * x;
//CHECK-NEXT: * _d_x += x * 1;
//CHECK-NEXT: }
//CHECK-NEXT: }
//CHECK-NEXT: {
//CHECK-NEXT: * _d_x += _d_z * x;
//CHECK-NEXT: * _d_x += x * _d_z;
Expand All @@ -141,6 +148,7 @@ float func3(float x, float y) { return x > 30 ? x * y : x + y; }
//CHECK-NEXT: _ret_value0 = _cond0 ? x * y : x + y;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: if (_cond0) {
//CHECK-NEXT: * _d_x += 1 * y;
//CHECK-NEXT: * _d_y += x * 1;
Expand Down Expand Up @@ -180,6 +188,7 @@ float func4(float x, float y) {
//CHECK-NEXT: _ret_value0 = y / x;
//CHECK-NEXT: goto _label0;
//CHECK-NEXT: _label0:
//CHECK-NEXT: ;
//CHECK-NEXT: {
//CHECK-NEXT: * _d_y += 1 / x;
//CHECK-NEXT: float _r0 = 1 * -y / (x * x);
Expand Down
Loading

0 comments on commit 6de0fb0

Please sign in to comment.