xref: /llvm-project/llvm/test/Other/statistic.ll (revision a11faeed446882a81e79d780125d93e7199df645)
1; RUN: opt < %s -o /dev/null -p=instsimplify -stats -stats-json 2>&1 | FileCheck %s --check-prefix=JSON
2; RUN: opt < %s -o /dev/null -p=instsimplify -stats -stats-json -info-output-file %t && FileCheck %s < %t --check-prefix=JSON
3; RUN: opt < %s -o /dev/null -p=instsimplify -stats 2>&1 | FileCheck %s --check-prefix=DEFAULT
4; RUN: opt < %s -o /dev/null -p=instsimplify -stats -info-output-file %t && FileCheck %s < %t --check-prefix=DEFAULT
5; REQUIRES: asserts
6
7; JSON: {
8; JSON-DAG:   "instsimplify.NumSimplified": 1
9; JSON: }
10
11; DEFAULT: 1 instsimplify - Number of redundant instructions removed
12
13define i32 @foo() {
14  %res = add i32 5, 4
15  ret i32 %res
16}
17