Add test to demonstrate out-param semantics violation.

GLSL ES2 documentation on out parameters: "Evaluation of an out
parameter results in an l-value that is used to copy out a value when
the function returns."

The inliner does not do any alias checking when inlining an `out` param.
That is, passing the same variable to two separate `out` parameters
would not generate two distinct lvalues in the inlined code; it reuses
the same variable for each out-params in the inlined code.

(Amusingly, our CFG can fully optimize away this test code so it just
returns "red".)

Change-Id: Ib781d2cfdac54f01b6abe159af0c84ff24ff6976
Bug: skia:11326
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370256
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/gn/sksl_tests.gni b/gn/sksl_tests.gni
index f738bfb..83b1914 100644
--- a/gn/sksl_tests.gni
+++ b/gn/sksl_tests.gni
@@ -472,6 +472,7 @@
   "/sksl/inliner/InlineWithUnmodifiedArgument.sksl",
   "/sksl/inliner/InlineWithUnnecessaryBlocks.sksl",
   "/sksl/inliner/InlinerAvoidsVariableNameOverlap.sksl",
+  "/sksl/inliner/InlinerHonorsGLSLOutParamSemantics.sksl",
   "/sksl/inliner/InlinerManglesNames.sksl",
   "/sksl/inliner/InlinerWrapsEarlyReturnsWithForLoop.sksl",
   "/sksl/inliner/InlinerWrapsSwitchWithReturnInsideWithForLoop.sksl",
diff --git a/resources/sksl/inliner/InlinerHonorsGLSLOutParamSemantics.sksl b/resources/sksl/inliner/InlinerHonorsGLSLOutParamSemantics.sksl
new file mode 100644
index 0000000..6f191e5
--- /dev/null
+++ b/resources/sksl/inliner/InlinerHonorsGLSLOutParamSemantics.sksl
@@ -0,0 +1,12 @@
+uniform half4 colorGreen, colorRed;
+
+bool out_params_are_distinct(out half x, out half y) {
+    x = 1;
+    y = 2;
+    return x == 1 && y == 2;
+}
+
+half4 main() {
+    half x = 0;
+    return out_params_are_distinct(x, x) ? colorGreen : colorRed;
+}
diff --git a/tests/sksl/inliner/InlinerHonorsGLSLOutParamSemantics.glsl b/tests/sksl/inliner/InlinerHonorsGLSLOutParamSemantics.glsl
new file mode 100644
index 0000000..172af3b
--- /dev/null
+++ b/tests/sksl/inliner/InlinerHonorsGLSLOutParamSemantics.glsl
@@ -0,0 +1,8 @@
+
+out vec4 sk_FragColor;
+uniform vec4 colorGreen;
+uniform vec4 colorRed;
+vec4 main() {
+    return colorRed;
+
+}