Reland "Add SkSL for-loop control flow test to dm."

This reverts commit 578f1acbe8a47178efb21df49561c365226f9d95.

Reason for revert: updated test to pass on Mac Intel 5100/6000

Original change's description:
> Revert "Add SkSL for-loop control flow test to dm."
>
> This reverts commit a0c266283a8ef230ad0436dbf885d2b616e7302b.
>
> Reason for revert: failing on Mac Intel
>
> Original change's description:
> > Add SkSL for-loop control flow test to dm.
> >
> > While loops and do-while loops remain untested in dm, as they are not
> > supported in ES2 (and therefore not available in Runtime Effects).
> >
> > Change-Id: I2f1bfccccd571cc4ced096bc18ebbb9ecc9f9b4a
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359556
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: I45335d16a695644eaeb8a535298c0efcc616c1ce
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359840
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I2dc6e870393708a12286658001b723f25a6aec4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359856
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/resources/sksl/shared/ForLoopControlFlow.sksl b/resources/sksl/shared/ForLoopControlFlow.sksl
index 858a00f..fbe0109 100644
--- a/resources/sksl/shared/ForLoopControlFlow.sksl
+++ b/resources/sksl/shared/ForLoopControlFlow.sksl
@@ -5,7 +5,7 @@
 
     // Verify that break is allowed in a for loop.
     for (half r = -5; r < 5; r += 1) {
-        x.r = abs(r);
+        x.r = saturate(r);
         if (x.r == 0) break;
     }
 
diff --git a/tests/SkSLTest.cpp b/tests/SkSLTest.cpp
index dd1212c..c25bdff 100644
--- a/tests/SkSLTest.cpp
+++ b/tests/SkSLTest.cpp
@@ -106,9 +106,14 @@
 SKSL_TEST(SkSLVectorScalarFolding,     "folding/VectorScalarFolding.sksl")
 SKSL_TEST(SkSLVectorVectorFolding,     "folding/VectorVectorFolding.sksl")
 
+SKSL_TEST(SkSLForLoopControlFlow,      "shared/ForLoopControlFlow.sksl")
+
 /*
 TODO(skia:11209): enable these tests when Runtime Effects have support for ES3
 
 SKSL_TEST(SkSLIntFoldingES3,           "folding/IntFoldingES3.sksl")
 SKSL_TEST(SkSLMatrixFoldingES3,        "folding/MatrixFoldingES3.sksl")
+
+SKSL_TEST(SkSLDoWhileControlFlow,      "shared/DoWhileControlFlow.sksl")
+SKSL_TEST(SkSLWhileLoopControlFlow,    "shared/WhileLoopControlFlow.sksl")
 */
diff --git a/tests/sksl/shared/ForLoopControlFlow.asm.frag b/tests/sksl/shared/ForLoopControlFlow.asm.frag
index bc59e24..e06c2d6 100644
--- a/tests/sksl/shared/ForLoopControlFlow.asm.frag
+++ b/tests/sksl/shared/ForLoopControlFlow.asm.frag
@@ -28,8 +28,8 @@
 OpDecorate %21 RelaxedPrecision
 OpDecorate %30 RelaxedPrecision
 OpDecorate %34 RelaxedPrecision
-OpDecorate %38 RelaxedPrecision
-OpDecorate %44 RelaxedPrecision
+OpDecorate %40 RelaxedPrecision
+OpDecorate %45 RelaxedPrecision
 OpDecorate %46 RelaxedPrecision
 OpDecorate %53 RelaxedPrecision
 OpDecorate %55 RelaxedPrecision
@@ -53,10 +53,10 @@
 %_ptr_Function_float = OpTypePointer Function %float
 %float_n5 = OpConstant %float -5
 %float_5 = OpConstant %float 5
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
 %float_0 = OpConstant %float 0
 %float_1 = OpConstant %float 1
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
 %int_2 = OpConstant %int 2
 %int_1 = OpConstant %int 1
 %_entrypoint = OpFunction %void None %14
@@ -83,21 +83,21 @@
 OpBranchConditional %32 %27 %29
 %27 = OpLabel
 %34 = OpLoad %float %r
-%33 = OpExtInst %float %1 FAbs %34
-%35 = OpAccessChain %_ptr_Function_float %x %int_0
-OpStore %35 %33
-%38 = OpLoad %v4float %x
-%39 = OpCompositeExtract %float %38 0
-%41 = OpFOrdEqual %bool %39 %float_0
-OpSelectionMerge %43 None
-OpBranchConditional %41 %42 %43
-%42 = OpLabel
-OpBranch %29
+%33 = OpExtInst %float %1 FClamp %34 %float_0 %float_1
+%37 = OpAccessChain %_ptr_Function_float %x %int_0
+OpStore %37 %33
+%40 = OpLoad %v4float %x
+%41 = OpCompositeExtract %float %40 0
+%42 = OpFOrdEqual %bool %41 %float_0
+OpSelectionMerge %44 None
+OpBranchConditional %42 %43 %44
 %43 = OpLabel
+OpBranch %29
+%44 = OpLabel
 OpBranch %28
 %28 = OpLabel
-%44 = OpLoad %float %r
-%46 = OpFAdd %float %44 %float_1
+%45 = OpLoad %float %r
+%46 = OpFAdd %float %45 %float_1
 OpStore %r %46
 OpBranch %25
 %29 = OpLabel
diff --git a/tests/sksl/shared/ForLoopControlFlow.glsl b/tests/sksl/shared/ForLoopControlFlow.glsl
index 39fb7d6..901c06e 100644
--- a/tests/sksl/shared/ForLoopControlFlow.glsl
+++ b/tests/sksl/shared/ForLoopControlFlow.glsl
@@ -4,7 +4,7 @@
 vec4 main() {
     vec4 x = colorWhite;
     for (float r = -5.0;r < 5.0; r += 1.0) {
-        x.x = abs(r);
+        x.x = clamp(r, 0.0, 1.0);
         if (x.x == 0.0) break;
     }
     for (float b = 5.0;b >= 0.0; b -= 1.0) {
diff --git a/tests/sksl/shared/ForLoopControlFlow.metal b/tests/sksl/shared/ForLoopControlFlow.metal
index 73bb38b..a2e5acd7 100644
--- a/tests/sksl/shared/ForLoopControlFlow.metal
+++ b/tests/sksl/shared/ForLoopControlFlow.metal
@@ -15,7 +15,7 @@
     (void)_out;
     float4 x = _uniforms.colorWhite;
     for (float r = -5.0;r < 5.0; r += 1.0) {
-        x.x = abs(r);
+        x.x = saturate(r);
         if (x.x == 0.0) break;
     }
     for (float b = 5.0;b >= 0.0; b -= 1.0) {