1#version 130
2
3uniform vec4 bigColor;
4varying vec4 BaseColor;
5uniform float d;
6
7float h = 0.0;
8
9float foo(vec4 bar)
10{
11    return bar.x + bar.y;
12}
13
14void bar()
15{
16}
17
18float unreachableReturn()
19{
20    if (d < 4.2)
21        return 1.2;
22    else
23        return 4.5;
24    // might be another return inserted here by builders, has to be correct type
25}
26
27float missingReturn()
28{
29    if (d < 4.5) {
30        h = d;
31        return 3.9;
32    }
33}
34
35void main()
36{
37    vec4 color = vec4(foo(BaseColor));
38
39    bar();
40    float f = unreachableReturn();
41    float g = missingReturn();
42
43    gl_FragColor = color * f * h;
44}
45