Commit b7597ae5 by Martin Liska Committed by Martin Liska

Add tests for __gcov_dump and __gcov_reset

	* g++.dg/gcov/gcov-dump-1.C: New test.
	* g++.dg/gcov/gcov-dump-2.C: New test.

From-SVN: r239308
parent e0c8eebf
2016-08-09 Martin Liska <mliska@suse.cz>
* g++.dg/gcov/gcov-dump-1.C: New test.
* g++.dg/gcov/gcov-dump-2.C: New test.
2016-08-09 Martin Liska <mliska@suse.cz>
* gcc.dg/tree-prof/val-prof-9.c: New test.
2016-08-09 Martin Liska <mliska@suse.cz>
......
/* { dg-options "-fprofile-generate -ftest-coverage -lgcov" } */
/* { dg-do run { target native } } */
int value;
extern "C" { void __gcov_dump(void); }
int main(int argc, char **argv)
{
value = 123; /* count(1) */
for (unsigned i = 0; i < 100; i++)
value += argc; /* count(100) */
__gcov_dump();
for (unsigned i = 0; i < 1000; i++) /* count(#####) */
value += argc;
return 0; /* count(#####) */
}
/* { dg-final { run-gcov gcov-dump-1.C } } */
/* { dg-options "-fprofile-generate -ftest-coverage -lgcov" } */
/* { dg-do run { target native } } */
int value;
extern "C"
{
void __gcov_dump(void);
void __gcov_reset(void);
}
int main(int argc, char **argv)
{
value = 123; /* count(1) */
for (unsigned i = 0; i < 100; i++)
value += argc; /* count(100) */
__gcov_dump();
for (unsigned i = 0; i < 1000; i++) /* count(#####) */
value += argc;
__gcov_reset ();
for (unsigned i = 0; i < 10000; i++) /* count(10001) */
value += argc;
return 0; /* count(1) */
}
/* { dg-final { run-gcov gcov-dump-2.C } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment