OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [gcov/] [gcov-4.C] - Blame information for rev 301

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
/* Check that execution counts and branch probabilities for various C
2
   constructs are reported correctly by gcov. */
3
 
4
#include 
5
 
6
/* { dg-options "-fprofile-arcs -ftest-coverage -fno-exceptions" } */
7
/* { dg-do run { target native } } */
8
 
9
class foo {
10
public:
11
  foo() { printf("foo()\n"); };
12
  ~foo() { printf("~foo()\n"); };
13
  void method(void) { printf("method()\n"); };
14
};
15
 
16
int func(int i, int j) __attribute__((noinline));
17
 
18
int func(int i, int j){
19
  if (j) {
20
    printf("unreachable\n");
21
    return 3;
22
  }
23
 
24
  foo f;
25
 
26
  if (i == 1) {
27
    f.method();
28
    f.method();
29
  } else {
30
    f.method();
31
    printf("unreachable\n");
32
    return 2;        /* count(#####) */
33
  }
34
  f.method();
35
  return 0;
36
}
37
 
38
int main() {
39
  return func(1, 0);
40
}
41
/* { dg-final { run-gcov gcov-4.C } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.