xref: /aosp_15_r20/external/skia/DATA/skia_resources/sksl/shared/ScopedSymbol.sksl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1uniform half4 colorGreen, colorRed;
2int glob;
3
4bool block_variable_hides_local_variable() {
5    bool var = true;
6    {
7        bool var = false;
8    }
9    return var;
10}
11
12bool block_variable_hides_global_variable() {
13    {
14        int glob = 1;
15    }
16    return glob == 2;
17}
18
19struct S {
20    int i;
21};
22
23bool local_variable_hides_struct() {
24    bool S = true;
25    return S;
26}
27
28bool local_struct_variable_hides_struct_type() {
29    S S = S(1);
30    return S.i == 1;
31}
32
33bool local_variable_hides_global_variable() {
34    int glob = 1;
35    return glob == 1;
36}
37
38half4 main(float2 coords) {
39    glob = 2;
40    return (block_variable_hides_local_variable() &&
41            block_variable_hides_global_variable() &&
42            local_variable_hides_struct() &&
43            local_struct_variable_hides_struct_type() &&
44            local_variable_hides_global_variable()) ? colorGreen : colorRed;
45}
46