xref: /aosp_15_r20/external/skia/resources/sksl/shared/Ossfuzz37677.sksl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1uniform half4 colorGreen;
2
3void original_fuzzer_output() {
4    float y[8],z;
5    z,y[3 .1L[y[7]=y[3],4]]+=0;
6}
7
8half4 main(float2 coords) {
9    int x[1], y=0, z=0;
10
11    // This line triggers two optimizations:
12    // 1 - No-op arithmetic simplification removes the `+= 0` and changes the ref-kind of `x` from
13    //     "write" to "read". Crucially, the ref-kind of `y` must remain "write."
14    // 2 - Comma-operator simplification detects that the leftmost `0, ` has no side effect and
15    //     eliminates it. This is done by returning a clone of the right-side expression. The act of
16    //     cloning the right-side expression can lead to an assertion if `y` has the wrong ref-kind.
17    0, x[y=z] += 0;
18
19    return colorGreen;
20}
21