diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-04 11:08:44 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-04 11:08:44 +0100 |
commit | 7b32513f3138bd95d4163f30e87fc444ab3897da (patch) | |
tree | d2b38838d65112a1d05db19cc1e74f8d8f5696d1 /chromium/third_party/glslang/src/Test/dce.frag | |
parent | 8d510183ca27142801b56bb50d63cbb2a92d4337 (diff) | |
parent | 2b94bfe47ccb6c08047959d1c26e392919550e86 (diff) | |
download | qtwebengine-chromium-7b32513f3138bd95d4163f30e87fc444ab3897da.tar.gz |
Merge remote-tracking branch 'origin/upstream-master' into 71-based
Change-Id: Id64d87edf3764b7b2a539f34018a458c8fcce302
Diffstat (limited to 'chromium/third_party/glslang/src/Test/dce.frag')
-rw-r--r-- | chromium/third_party/glslang/src/Test/dce.frag | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/chromium/third_party/glslang/src/Test/dce.frag b/chromium/third_party/glslang/src/Test/dce.frag new file mode 100644 index 00000000000..df62fc57172 --- /dev/null +++ b/chromium/third_party/glslang/src/Test/dce.frag @@ -0,0 +1,56 @@ +#version 400 + +const bool flag = false; + +int c = 0; + +void bar() +{ + if (flag) + ++c; // should still show up in AST + else + ++c; + + flag ? ++c : ++c; // both should still show up in AST + + switch (c) { + case 1: + ++c; + break; + ++c; // should still show up in AST + case 2: + break; + ++c; // should still show up in AST + default: + break; + } + + for (int i = 0; i < 0; ++i) + ++c; // should still show up in AST + + for (int i = 0; i < 10; ++i) { + if (c < 3) { + break; + ++c; // should still show up in AST + } else { + continue; + ++c; // should still show up in AST + } + } + + return; + + ++c; // should still show up in AST +} + +int foo() // not called, but should still show up in AST +{ + if (c > 4) { + return 4; + ++c; // should still show up in AST + } + + return 5; + + ++c; // should still show up in AST +} |