Merge pull request #2892 from greg-lunarg/mb
[platform/upstream/glslang.git] / Test / hlsl.forLoop.frag
1 void f0() {
2     for (;;) ;
3 }
4
5 void f1(float4 input) {
6     for (++input; ; ) ;
7 }
8
9 void f2(float4 input) {
10     [unroll] for (; any(input != input); ) {}
11 }
12
13 float f3(float4 input) {
14     for (; any(input != input); ) { return -input; }
15 }
16
17 float f4(float4 input) {
18     for (--input; any(input != input); input += 2) { return -input; }
19 }
20
21 void f5(float4 input) {
22     for (;;) if (input.x > 2.0) break;
23 }
24
25 void f6(float4 input) {
26     for (;;) if (input.x > 2.0) continue;
27 }
28
29 void f99() {
30     for (int first = 0, second = 1; ;) first + second;
31 }
32
33 void f100(float ii) {
34     for (--ii, --ii, --ii;;) ii;
35 }
36
37 float4 PixelShaderFunction(float4 input) : COLOR0
38 {
39     f0();
40     f1(input);
41     f2(input);
42     f3(input);
43     f4(input);
44     f5(input);
45     f6(input);
46
47     float ii;
48     for (int ii = -1; ii < 3; ++ii) if (ii == 2) continue;
49     --ii;
50
51     f99();
52
53     for ( int i = 0, count = int(ii); i < count; i++ );
54     for (float first = 0, second[2], third; first < second[0]; ++second[1]) first + second[1] + third;
55
56     f100(ii);
57
58     return input;
59 }