• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Check that legacy pass manager could only use -ftime-report
2 // RUN: %clang_cc1 -fno-experimental-new-pass-manager -emit-obj -O1 \
3 // RUN:     -ftime-report %s -o /dev/null 2>&1 | \
4 // RUN:     FileCheck %s --check-prefixes=TIME,LPM
5 // RUN: not %clang_cc1 -fno-experimental-new-pass-manager -emit-obj -O1 \
6 // RUN:     -ftime-report=per-pass %s -o /dev/null 2>&1 | \
7 // RUN:     FileCheck %s --check-prefixes=ERROR
8 // RUN: not %clang_cc1 -fno-experimental-new-pass-manager -emit-obj -O1 \
9 // RUN:     -ftime-report=per-pass-run %s -o /dev/null 2>&1 | \
10 // RUN:     FileCheck %s --check-prefixes=ERROR
11 
12 // Check -ftime-report/-ftime-report= output for the new pass manager
13 // RUN: %clang_cc1 -emit-obj -O1 -fexperimental-new-pass-manager \
14 // RUN:     -ftime-report %s -o /dev/null 2>&1 | \
15 // RUN:     FileCheck %s --check-prefixes=TIME,NPM
16 // RUN: %clang_cc1 -emit-obj -O1 -fexperimental-new-pass-manager \
17 // RUN:     -ftime-report=per-pass %s -o /dev/null 2>&1 | \
18 // RUN:     FileCheck %s --check-prefixes=TIME,NPM
19 // RUN: %clang_cc1 -emit-obj -O1 -fexperimental-new-pass-manager \
20 // RUN:     -ftime-report=per-pass-run %s -o /dev/null 2>&1 | \
21 // RUN:     FileCheck %s --check-prefixes=TIME,NPM-PER-INVOKE
22 
23 // TIME: Pass execution timing report
24 // TIME: Total Execution Time:
25 // TIME: Name
26 // LPM-DAG:   Dominator Tree Construction #
27 // LPM-DAG:   Dominator Tree Construction #
28 // LPM-DAG:   Dominator Tree Construction #
29 // NPM-PER-INVOKE-DAG:   InstCombinePass #
30 // NPM-PER-INVOKE-DAG:   InstCombinePass #
31 // NPM-PER-INVOKE-DAG:   InstCombinePass #
32 // NPM-NOT:   InstCombinePass #
33 // NPM:       InstCombinePass{{$}}
34 // NPM-NOT:   InstCombinePass #
35 // TIME: Total{{$}}
36 // LPM-NOT: Pass execution timing report
37 // NPM: Pass execution timing report
38 
39 // ERROR: error: invalid argument '-ftime-report={{.*}}' only allowed with '-fexperimental-new-pass-manager'
40 
foo(int x,int y)41 int foo(int x, int y) { return x + y; }
42