~mmach/netext73/glslang

« back to all changes in this revision

Viewing changes to Test/dce.frag

  • Committer: mmach
  • Date: 2020-02-05 18:22:02 UTC
  • Revision ID: netbit73@gmail.com-20200205182202-x6mj2xsqo1ngs0kq
8.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#version 400
 
2
 
 
3
const bool flag = false;
 
4
 
 
5
int c = 0;
 
6
 
 
7
void bar()
 
8
{
 
9
    if (flag)
 
10
        ++c;  // should still show up in AST
 
11
    else
 
12
        ++c;
 
13
 
 
14
    flag ? ++c : ++c;  // both should still show up in AST
 
15
 
 
16
    switch (c) {
 
17
    case 1:
 
18
        ++c;
 
19
        break;
 
20
        ++c;  // should still show up in AST
 
21
    case 2:
 
22
        break;
 
23
        ++c;  // should still show up in AST
 
24
    default:
 
25
        break;
 
26
    }
 
27
 
 
28
    for (int i = 0; i < 0; ++i)
 
29
        ++c;  // should still show up in AST
 
30
 
 
31
    for (int i = 0; i < 10; ++i) {
 
32
        if (c < 3) {
 
33
            break; 
 
34
            ++c;    // should still show up in AST
 
35
        } else {
 
36
            continue;
 
37
            ++c;    // should still show up in AST
 
38
        }
 
39
    }
 
40
 
 
41
    return;
 
42
 
 
43
    ++c;      // should still show up in AST
 
44
}
 
45
 
 
46
int foo()     // not called, but should still show up in AST
 
47
{
 
48
    if (c > 4) {
 
49
        return 4;
 
50
        ++c;   // should still show up in AST
 
51
    }
 
52
 
 
53
    return 5;
 
54
 
 
55
    ++c;       // should still show up in AST
 
56
}