(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
tree-prof/
time-profiler-2.c
       1  /* { dg-options "-O2 -fdump-ipa-profile" } */
       2  
       3  #include <unistd.h>
       4  
       5  __attribute__ ((noinline))
       6  int foo()
       7  {
       8    return 1;
       9  }
      10  
      11  __attribute__ ((noinline))
      12  int bar()
      13  {
      14    return 1;
      15  }
      16  
      17  __attribute__ ((noinline))
      18  int baz()
      19  {
      20    return 1;
      21  }
      22  
      23  __attribute__ ((noinline))
      24  int baz1()
      25  {
      26    return 1;
      27  }
      28  
      29  int main ()
      30  {
      31    int f = fork();
      32    int r = 0;
      33  
      34    foo ();
      35  
      36    if (f < 0)
      37      return 1; /* Fork failed.  */
      38  
      39    if(f == 0) /* Child process.  */
      40      r = bar() - foo();
      41    else /* Parent process.  */
      42      r = foo() - foo();
      43  
      44    return r;
      45  }
      46  /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 0" 2 "profile"} } */
      47  /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 1" 1 "profile"} } */
      48  /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 2" 1 "profile"} } */
      49  /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 3" 1 "profile"} } */