Rong Xu | 9837ef5 | 2016-02-04 18:39:09 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroparams2.c %s | FileCheck %s |
Alex Lorenz | 34ac9b5 | 2014-08-19 17:32:30 +0000 | [diff] [blame] | 2 | |
Justin Bogner | bf42cfd | 2015-02-18 21:24:51 +0000 | [diff] [blame] | 3 | #define MACRO(REFS, CALLS) (4 * (CALLS) < (REFS)) |
Alex Lorenz | 34ac9b5 | 2014-08-19 17:32:30 +0000 | [diff] [blame] | 4 | |
| 5 | struct S { |
| 6 | int i, j; |
| 7 | }; |
| 8 | |
Justin Bogner | bf42cfd | 2015-02-18 21:24:51 +0000 | [diff] [blame] | 9 | // CHECK: File 0, [[@LINE+1]]:12 -> [[@LINE+10]]:2 = #0 |
| 10 | int main() { |
| 11 | struct S arr[32] = { 0 }; |
| 12 | int n = 0; |
| 13 | // CHECK-NEXT: Expansion,File 0, [[@LINE+2]]:7 -> [[@LINE+2]]:12 = #0 |
| 14 | // CHECK-NEXT: File 0, [[@LINE+1]]:34 -> [[@LINE+3]]:4 = #1 |
| 15 | if (MACRO(arr[n].j, arr[n].i)) { |
| 16 | n = 1; |
Alex Lorenz | 34ac9b5 | 2014-08-19 17:32:30 +0000 | [diff] [blame] | 17 | } |
| 18 | return n; |
Justin Bogner | bf42cfd | 2015-02-18 21:24:51 +0000 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | // CHECK: File 1, 3:29 -> 3:51 = #0 |