summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Other/statistic.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Other/statistic.ll b/llvm/test/Other/statistic.ll
new file mode 100644
index 00000000000..c3be9f362e6
--- /dev/null
+++ b/llvm/test/Other/statistic.ll
@@ -0,0 +1,16 @@
+; RUN: opt < %s -o /dev/null -instsimplify -stats -stats-json 2>&1 | FileCheck %s --check-prefix=JSON
+; RUN: opt < %s -o /dev/null -instsimplify -stats -stats-json -info-output-file %t && FileCheck %s < %t --check-prefix=JSON
+; RUN: opt < %s -o /dev/null -instsimplify -stats 2>&1 | FileCheck %s --check-prefix=DEFAULT
+; RUN: opt < %s -o /dev/null -instsimplify -stats -info-output-file %t && FileCheck %s < %t --check-prefix=DEFAULT
+; REQUIRES: asserts
+
+; JSON: {
+; JSON: "instsimplify.NumSimplified": 1
+; JSON: }
+
+; DEFAULT: 1 instsimplify - Number of redundant instructions removed
+
+define i32 @foo() {
+ %res = add i32 5, 4
+ ret i32 %res
+}
OpenPOWER on IntegriCloud