Justin Bogner | 92bb302 | 2014-09-15 22:23:29 +0000 | [diff] [blame] | 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 |
Justin Bogner | 3d7260e | 2014-09-11 23:20:48 +0000 | [diff] [blame] | 2 | |
| 3 | #define DO_SOMETHING_ELSE() \ |
| 4 | do { \ |
| 5 | } while (0) |
| 6 | #define ANOTHER_THING() \ |
| 7 | do { \ |
| 8 | if (0) { \ |
| 9 | } \ |
| 10 | } while (0) |
| 11 | |
| 12 | #define DO_SOMETHING(x) \ |
| 13 | do { \ |
| 14 | if (x) \ |
| 15 | DO_SOMETHING_ELSE(); \ |
| 16 | else \ |
| 17 | ANOTHER_THING(); \ |
| 18 | } while (0) |
Justin Bogner | a829fde | 2014-09-19 19:04:08 +0000 | [diff] [blame] | 19 | // CHECK-DAG: Expansion at line [[@LINE-4]], 7 -> 24 |
| 20 | // CHECK-DAG: Expansion at line [[@LINE-3]], 7 -> 20 |
Justin Bogner | 3d7260e | 2014-09-11 23:20:48 +0000 | [diff] [blame] | 21 | |
| 22 | int main(int argc, const char *argv[]) { |
| 23 | for (int i = 0; i < 100; ++i) |
Justin Bogner | a829fde | 2014-09-19 19:04:08 +0000 | [diff] [blame] | 24 | DO_SOMETHING(i); // CHECK-DAG: Expansion at line [[@LINE]], 5 -> 17 |
Justin Bogner | 3d7260e | 2014-09-11 23:20:48 +0000 | [diff] [blame] | 25 | return 0; |
| 26 | } |
Vedant Kumar | 7101d73 | 2016-07-26 22:50:58 +0000 | [diff] [blame] | 27 | // RUN: llvm-cov export %S/Inputs/showExpansions.covmapping -instr-profile %S/Inputs/showExpansions.profdata 2>&1 | FileCheck %S/Inputs/showExpansions.json |