From 1b871ba44c9d2a02fb162d97b695eb362926a567 Mon Sep 17 00:00:00 2001 From: Yuchen Wu Date: Sat, 7 Dec 2013 01:28:11 +0000 Subject: [PATCH] llvm-cov: Added test.h header to tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196632 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tools/llvm-cov/Inputs/test.cpp | 5 +- test/tools/llvm-cov/Inputs/test.cpp.orig_gcov | 149 +++++++++--------- test/tools/llvm-cov/Inputs/test.gcda | Bin 904 -> 904 bytes test/tools/llvm-cov/Inputs/test.gcno | Bin 3552 -> 3552 bytes test/tools/llvm-cov/Inputs/test.h | 3 + test/tools/llvm-cov/Inputs/test.h.orig_gcov | 8 + test/tools/llvm-cov/llvm-cov.test | 1 + 7 files changed, 86 insertions(+), 80 deletions(-) create mode 100644 test/tools/llvm-cov/Inputs/test.h create mode 100644 test/tools/llvm-cov/Inputs/test.h.orig_gcov diff --git a/test/tools/llvm-cov/Inputs/test.cpp b/test/tools/llvm-cov/Inputs/test.cpp index 07bc3f294c5..e580e5ae0c1 100644 --- a/test/tools/llvm-cov/Inputs/test.cpp +++ b/test/tools/llvm-cov/Inputs/test.cpp @@ -1,3 +1,4 @@ +#include "test.h" #include bool on = false; @@ -6,10 +7,6 @@ double grid[10][10] = {0}; const char * hello = "world"; const char * world = "hello"; -struct A { - virtual void B(); -}; - void A::B() {} void useless() {} diff --git a/test/tools/llvm-cov/Inputs/test.cpp.orig_gcov b/test/tools/llvm-cov/Inputs/test.cpp.orig_gcov index a3dacc269ea..871e3ba6445 100644 --- a/test/tools/llvm-cov/Inputs/test.cpp.orig_gcov +++ b/test/tools/llvm-cov/Inputs/test.cpp.orig_gcov @@ -3,80 +3,77 @@ -: 0:Data:test.gcda -: 0:Runs:2 -: 0:Programs:1 - -: 1:#include - -: 2: - -: 3:bool on = false; - -: 4:int len = 42; - -: 5:double grid[10][10] = {0}; - -: 6:const char * hello = "world"; - -: 7:const char * world = "hello"; - -: 8: - 4: 9:struct A { - -: 10: virtual void B(); - -: 11:}; - -: 12: -8589934592: 13:void A::B() {} - -: 14: - #####: 15:void useless() {} - -: 16: - -: 17:double more_useless() { - #####: 18: return 0; - -: 19:} - -: 20: - -: 21:int foo() { - 2: 22: on = true; - 2: 23: return 3; - -: 24:} - -: 25: - -: 26:int bar() { - #####: 27: len--; - #####: 28: return foo() + 45; - -: 29:} - -: 30: - 8: 31:void assign(int ii, int jj) { - 8: 32: grid[ii][jj] = (ii+1) * (jj+1); - 8: 33:} - -: 34: - -: 35:void initialize_grid() { - 12: 36: for (int ii = 0; ii < 2; ii++) - 24: 37: for (int jj = 0; jj < 2; jj++) - 12: 38: assign(ii, jj); - 2: 39:} + -: 1:#include "test.h" + -: 2:#include + -: 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: - -: 41:int main() { - 2: 42: initialize_grid(); - -: 43: - 2: 44: int a = 2; - 2: 45: on = rand() % 2; - 2: 46: if (on) { - 2: 47: foo(); - 2: 48: ++a; - 2: 49: } else { - #####: 50: bar(); - #####: 51: a += rand(); - -: 52: } - -: 53: - 44: 54: for (int ii = 0; ii < 10; ++ii) { - 20: 55: switch (rand() % 5) { - -: 56: case 0: - 4: 57: a += rand(); - 4: 58: break; - -: 59: case 1: - -: 60: case 2: - 2: 61: a += rand() / rand(); - 2: 62: break; - -: 63: case 3: - 6: 64: a -= rand(); - 6: 65: break; - -: 66: default: - 8: 67: a = -1; - 8: 68: } - 20: 69: } - -: 70: - 2: 71: A thing; -17179869188: 72: for (uint64_t ii = 0; ii < 4294967296; ++ii) -8589934592: 73: thing.B(); - -: 74: - 2: 75: return a + 8 + grid[2][3] + len; - -: 76: return more_useless(); - -: 77:} + 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:} diff --git a/test/tools/llvm-cov/Inputs/test.gcda b/test/tools/llvm-cov/Inputs/test.gcda index 9c21d19b1fe8e020604da6d2d985f886954a08dd..613e3a85c02678566e12df9cf0487adea393c222 100644 GIT binary patch delta 90 zcmV-g0Hyzk2Z#rd7z7^37buY&Gz7=7Yod`GFa%@_|MZdp wFa*1BG^Ud@0W<`6`aBksYypr2zBT&{k^<-imc!vFlk5UC1jF=voRcI2WZAnS)Bpeg delta 90 zcmV-g0Hyzk2Z#rd7zD`LYy^=UGz8(?zO<24Gz15>1#gjzJOrhiy)2Q;Fa)TMXbqA9 wFa)L;f>x6>0W<_mfgoIyYypr2lm+pxk^<-iBaZGClk5UC1e9|d#*-uiWC4yLXaE2J diff --git a/test/tools/llvm-cov/Inputs/test.gcno b/test/tools/llvm-cov/Inputs/test.gcno index ad748799ee8c90ea9d0dc1a7e54fd8c66bf0484a..24f1c82476b2cc2cbab056e962a919771042cdd7 100644 GIT binary patch delta 663 zcmaDL{Xlwx1dH4WagB*G3XEKn1DV1nFJP5n_rpLC@}KCg?T0?GK#ZI z(w9CnxrR}Lkq;&@Ie}3?lZ%0Yff^AQM<6fGQ;?ZWQKV1u}LQm@Jz-g;{}7 z2J9vt78y<%ps*|u%S|?95oam?Wg|A(hed}`VRI#mGb5wo9RI~UJB)89NG_vR*M=1tzf zCdKT?C_Fil-FNZ?7M9KH*e@~issm*;fmjQOwI}y-YEN$Al$d;hQ-)O^C}IG%*BETC zG2C90$p<-wCwFj3Fq%y+161V(7SZ5=h=c%X2OhqO``9Ko@UW;(JN!@s z6p!&yeuj?DhOT8mHi)mM501qQAd`U+8uJ3YD5AjFm~6nyqI&pC%^ZXgMx+=qxsgQ} E0F&6C@c;k- delta 648 zcmZWnL1+^}6wOcn>}EE*y0U9Cn5A7QN;I)F%}GHpq+-Qd^kSh1B^5=XnqYz;ct|~Y zv1I+Z36g_~2T@8zyeJ4F9y|n3A|C3^g9yDB@z17d4;}dP-+%wj=P@(u+4XE&;g=sv z7zH6XbTK(cT@ip2t!D7o&kt{+uOaLm(4>+s)gguETT!EXkb`~OtqVz`lo%|q7!7ee zd;GqTl>*iMi(0Msxg1y{^Uk`F!K#Fr$nvcUC+Bxqh*7-PxM3SiQY_!T~)& zWLX(Rt6oYlc&_eWqRvnVqp>?113Aic$Z?R0n8BIl@G{L{0mjzuVg)EL_s|nzP*13B zyeSkMq79kny=>&+Fh#Z`?{y1fD#? zRU%OakE-T*Y9p?_GQWXyl*t0eF^+M1DD(73rl3e4WnN4&SJD=!YavY;xj1)(t8LIz z%clpH631C}g7qG~v(%%sqTiOHiL_5W_M*~CR9G+-d!FX*Dch$eXFc+hbg9dVGpv}7 z6+P}O+5OwtOe;7WvpKuZ&e|hzj&GS-Ho9Xge~0xGFU-#t%a!73YJ(4Q@E<^G-GqZ~ Qr;+`