Justin Bogner | 95e0a70 | 2014-03-26 22:03:06 +0000 | [diff] [blame] | 1 | // Make sure that compiler-added functions (whose line number is zero) don't |
| 2 | // crash llvm-cov. |
| 3 | |
| 4 | // We need shell for cd |
| 5 | // REQUIRES: shell |
Justin Bogner | 95e0a70 | 2014-03-26 22:03:06 +0000 | [diff] [blame] | 6 | |
| 7 | // RUN: rm -rf %t |
| 8 | // RUN: mkdir %t |
| 9 | // RUN: cd %t |
| 10 | // RUN: cp %s %p/Inputs/copy_block_helper.gc* . |
| 11 | |
Justin Bogner | 5a07bb8 | 2015-03-24 23:34:36 +0000 | [diff] [blame] | 12 | // RUN: llvm-cov gcov copy_block_helper.m | FileCheck %s --check-prefix=STDOUT |
Justin Bogner | 95e0a70 | 2014-03-26 22:03:06 +0000 | [diff] [blame] | 13 | // STDOUT: File 'copy_block_helper.m' |
| 14 | // STDOUT: Lines executed:100.00% of 5 |
| 15 | // STDOUT: copy_block_helper.m:creating 'copy_block_helper.m.gcov' |
| 16 | |
| 17 | // RUN: FileCheck %s --check-prefix=GCOV < %t/copy_block_helper.m.gcov |
| 18 | // GCOV: -: 0:Runs:1 |
| 19 | // GCOV: -: 0:Programs:1 |
| 20 | |
| 21 | id test_helper(id (^foo)(void)) { return foo(); } // GCOV: 1: [[@LINE]]:id |
| 22 | void test(id x) { // GCOV: -: [[@LINE]]:void test |
| 23 | test_helper(^{ // GCOV: 2: [[@LINE]]: test_helper |
| 24 | return x; // GCOV: 1: [[@LINE]]: return |
| 25 | }); // GCOV: -: [[@LINE]]: |
| 26 | } // GCOV: 1: [[@LINE]]:} |
| 27 | |
| 28 | // GCOV: 1: [[@LINE+1]]:int main |
| 29 | int main(int argc, const char *argv[]) { test(0); } |
Justin Bogner | dddfc29 | 2014-03-26 22:51:39 +0000 | [diff] [blame] | 30 | |
| 31 | // llvm-cov doesn't work on big endian yet |
Hubert Tong | 55662a8 | 2018-01-09 20:09:23 +0000 | [diff] [blame] | 32 | // XFAIL: powerpc-, powerpc64-, s390x, mips-, mips64-, sparc |