xref: /llvm-project/clang/test/Misc/time-passes.c (revision 98574aa1d24a310ddbabdc668cafee4d499b51e7)
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=per-pass %s -o /dev/null 2>&1 | \
7 // RUN:     FileCheck %s --check-prefixes=TIME,NPM
8 // RUN: %clang_cc1 -emit-obj -O1 \
9 // RUN:     -ftime-report=per-pass-run %s -o /dev/null 2>&1 | \
10 // RUN:     FileCheck %s --check-prefixes=TIME,NPM-PER-INVOKE
11 
12 // TIME: Pass execution timing report
13 // TIME: Total Execution Time:
14 // TIME: Name
15 // NPM-PER-INVOKE-DAG:   InstCombinePass #
16 // NPM-PER-INVOKE-DAG:   InstCombinePass #
17 // NPM-PER-INVOKE-DAG:   InstCombinePass #
18 // NPM-NOT:   InstCombinePass #
19 // NPM:       InstCombinePass{{$}}
20 // NPM-NOT:   InstCombinePass #
21 // TIME: Total{{$}}
22 // NPM: Pass execution timing report
23 
foo(int x,int y)24 int foo(int x, int y) { return x + y; }
25