showExpansions.cpp 823 B

1234567891011121314151617181920212223242526
  1. // RUN: llvm-cov show %S/Inputs/showExpansions.covmapping -instr-profile %S/Inputs/showExpansions.profdata -dump -show-expansions -filename-equivalence %s 2>&1 | FileCheck %s
  2. #define DO_SOMETHING_ELSE() \
  3. do { \
  4. } while (0)
  5. #define ANOTHER_THING() \
  6. do { \
  7. if (0) { \
  8. } \
  9. } while (0)
  10. #define DO_SOMETHING(x) \
  11. do { \
  12. if (x) \
  13. DO_SOMETHING_ELSE(); \
  14. else \
  15. ANOTHER_THING(); \
  16. } while (0)
  17. // CHECK-DAG: Expansion at line [[@LINE-4]], 7 -> 24
  18. // CHECK-DAG: Expansion at line [[@LINE-3]], 7 -> 20
  19. int main(int argc, const char *argv[]) {
  20. for (int i = 0; i < 100; ++i)
  21. DO_SOMETHING(i); // CHECK-DAG: Expansion at line [[@LINE]], 5 -> 17
  22. return 0;
  23. }