Remove reduntant dumps and make tp_first_run dump more compact.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / time-profiler-2.c
blob497b585388e28a4e5c9eb4cacdcd276470fa1338
1 /* { dg-options "-O2 -fdump-ipa-profile" } */
3 #include <unistd.h>
5 __attribute__ ((noinline))
6 int foo()
8 return 1;
11 __attribute__ ((noinline))
12 int bar()
14 return 1;
17 __attribute__ ((noinline))
18 int baz()
20 return 1;
23 __attribute__ ((noinline))
24 int baz1()
26 return 1;
29 int main ()
31 int f = fork();
32 int r = 0;
34 foo ();
36 if (f < 0)
37 return 1; /* Fork failed. */
39 if(f == 0) /* Child process. */
40 r = bar() - foo();
41 else /* Parent process. */
42 r = foo() - foo();
44 return r;
46 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 1" 2 "profile"} } */
47 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 2" 1 "profile"} } */
48 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 3" 1 "profile"} } */
49 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Read tp_first_run: 4" 1 "profile"} } */