dce.frag 1.0 KB

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