Debian Codegraph @

clang/test/Misc/time-passes.c

raw
1 // Check -ftime-report/-ftime-report= output
2 // RUN: %clang_cc1 -emit-obj -O1 \
3 // RUN: -ftime-report %s -o /dev/null 2>&1 | \
4 // RUN: FileCheck %s --check-prefixes=TIME,NPM
5 // RUN: %clang_cc1 -emit-obj -O1 \
6 // RUN: -ftime-report %s -o /dev/null \
7 // RUN: -mllvm -info-output-file=%t
8 // RUN: cat %t | FileCheck %s --check-prefixes=TIME,NPM
9 // RUN: %clang_cc1 -emit-obj -O1 \
10 // RUN: -ftime-report=per-pass %s -o /dev/null 2>&1 | \
11 // RUN: FileCheck %s --check-prefixes=TIME,NPM
12 // RUN: %clang_cc1 -emit-obj -O1 \
13 // RUN: -ftime-report=per-pass-run %s -o /dev/null 2>&1 | \
14 // RUN: FileCheck %s --check-prefixes=TIME,NPM-PER-INVOKE
15 // RUN: %clang_cc1 -emit-obj -O1 \
16 // RUN: -ftime-report-json %s -o /dev/null 2>&1 | \
17 // RUN: FileCheck %s --check-prefixes=JSON
18 // RUN: %clang_cc1 -emit-obj -O1 \
19 // RUN: -ftime-report-json %s -o /dev/null \
20 // RUN: -mllvm -info-output-file=%t
21 // RUN: cat %t | FileCheck %s --check-prefixes=JSON
22 // Check that -stats-file-timers only outputs pass time info in the stats file
23 // and not stderr.
24 // RUN: %clang_cc1 -emit-obj -O1 \
25 // RUN: %s -o /dev/null \
26 // RUN: -stats-file=%t -stats-file-timers 2>&1 | count 0
27 // RUN: FileCheck %s -input-file=%t -check-prefixes=JSON
28
29 // TIME: Pass execution timing report
30 // TIME: Total Execution Time:
31 // TIME: Name
32 // NPM-PER-INVOKE-DAG: InstCombinePass #
33 // NPM-PER-INVOKE-DAG: InstCombinePass #
34 // NPM-PER-INVOKE-DAG: InstCombinePass #
35 // NPM-NOT: InstCombinePass #
36 // NPM: InstCombinePass{{$}}
37 // NPM-NOT: InstCombinePass #
38 // TIME: Total{{$}}
39 // JSON:{
40 // JSON: "time.pass.InstCombinePass.wall": {{.*}},
41 // JSON: "time.pass.InstCombinePass.user": {{.*}},
42 // JSON: "time.pass.InstCombinePass.sys": {{.*}},
43 // JSON:}
44
45 int foo(int x, int y) { return x + y; }