mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
30d5ef51e4
Similar to gcov, llvm-cov will now print out the block count at the end of each block. Multiple blocks can end on the same line. One computational difference is by using -a, llvm-cov will no longer simply add the block counts together to form a line count. Instead, it will take the maximum of the block counts on that line. This has a similar effect to what gcov does, but generates more correct counts in certain scenarios. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196856 91177308-0d34-0410-b5e6-96231b3b80d8
80 lines
2.3 KiB
Plaintext
80 lines
2.3 KiB
Plaintext
-: 0:Source:test.cpp
|
|
-: 0:Graph:test.gcno
|
|
-: 0:Data:test.gcda
|
|
-: 0:Runs:2
|
|
-: 0:Programs:1
|
|
-: 1:#include "test.h"
|
|
-: 2:#include <cstdlib>
|
|
-: 3:
|
|
-: 4:bool on = false;
|
|
-: 5:int len = 42;
|
|
-: 6:double grid[10][10] = {0};
|
|
-: 7:const char * hello = "world";
|
|
-: 8:const char * world = "hello";
|
|
-: 9:
|
|
8589934592: 10:void A::B() {}
|
|
-: 11:
|
|
#####: 12:void useless() {}
|
|
-: 13:
|
|
-: 14:double more_useless() {
|
|
#####: 15: return 0;
|
|
-: 16:}
|
|
-: 17:
|
|
-: 18:int foo() {
|
|
2: 19: on = true;
|
|
2: 20: return 3;
|
|
-: 21:}
|
|
-: 22:
|
|
-: 23:int bar() {
|
|
#####: 24: len--;
|
|
#####: 25: return foo() + 45;
|
|
-: 26:}
|
|
-: 27:
|
|
8: 28:void assign(int ii, int jj) {
|
|
8: 29: grid[ii][jj] = (ii+1) * (jj+1);
|
|
8: 30:}
|
|
-: 31:
|
|
-: 32:void initialize_grid() {
|
|
12: 33: for (int ii = 0; ii < 2; ii++)
|
|
24: 34: for (int jj = 0; jj < 2; jj++)
|
|
12: 35: assign(ii, jj);
|
|
2: 36:}
|
|
-: 37:
|
|
-: 38:int main() {
|
|
2: 39: initialize_grid();
|
|
-: 40:
|
|
2: 41: int a = 2;
|
|
2: 42: on = rand() % 2;
|
|
2: 43: if (on) {
|
|
2: 44: foo();
|
|
2: 45: ++a;
|
|
2: 46: } else {
|
|
#####: 47: bar();
|
|
#####: 48: a += rand();
|
|
-: 49: }
|
|
-: 50:
|
|
44: 51: for (int ii = 0; ii < 10; ++ii) {
|
|
20: 52: switch (rand() % 5) {
|
|
-: 53: case 0:
|
|
4: 54: a += rand();
|
|
4: 55: break;
|
|
-: 56: case 1:
|
|
-: 57: case 2:
|
|
2: 58: a += rand() / rand();
|
|
2: 59: break;
|
|
-: 60: case 3:
|
|
6: 61: a -= rand();
|
|
6: 62: break;
|
|
-: 63: default:
|
|
8: 64: a = -1;
|
|
8: 65: }
|
|
20: 66: }
|
|
-: 67:
|
|
2: 68: A thing;
|
|
17179869188: 69: for (uint64_t ii = 0; ii < 4294967296; ++ii)
|
|
8589934592: 70: thing.B();
|
|
-: 71:
|
|
2: 72: return a + 8 + grid[2][3] + len;
|
|
-: 73: return more_useless();
|
|
-: 74:}
|