summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/tools/llvm-opt-report/Inputs/unrl.c10
-rw-r--r--llvm/test/tools/llvm-opt-report/Inputs/unrl.yaml42
-rw-r--r--llvm/test/tools/llvm-opt-report/unrl.test14
3 files changed, 66 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-opt-report/Inputs/unrl.c b/llvm/test/tools/llvm-opt-report/Inputs/unrl.c
new file mode 100644
index 00000000000..0982ba24886
--- /dev/null
+++ b/llvm/test/tools/llvm-opt-report/Inputs/unrl.c
@@ -0,0 +1,10 @@
+void bar();
+
+void foo() {
+ for (int i = 0; i < 5; ++i)
+ bar();
+
+ for (int i = 0; i < 11; ++i)
+ bar();
+}
+
diff --git a/llvm/test/tools/llvm-opt-report/Inputs/unrl.yaml b/llvm/test/tools/llvm-opt-report/Inputs/unrl.yaml
new file mode 100644
index 00000000000..46fea68cb81
--- /dev/null
+++ b/llvm/test/tools/llvm-opt-report/Inputs/unrl.yaml
@@ -0,0 +1,42 @@
+--- !Missed
+Pass: inline
+Name: NoDefinition
+DebugLoc: { File: Inputs/unrl.c, Line: 5, Column: 5 }
+Function: foo
+Args:
+ - Callee: bar
+ - String: ' will not be inlined into '
+ - Caller: foo
+ - String: ' because its definition is unavailable'
+...
+--- !Missed
+Pass: inline
+Name: NoDefinition
+DebugLoc: { File: Inputs/unrl.c, Line: 8, Column: 5 }
+Function: foo
+Args:
+ - Callee: bar
+ - String: ' will not be inlined into '
+ - Caller: foo
+ - String: ' because its definition is unavailable'
+...
+--- !Passed
+Pass: loop-unroll
+Name: FullyUnrolled
+DebugLoc: { File: Inputs/unrl.c, Line: 7, Column: 3 }
+Function: foo
+Args:
+ - String: 'completely unrolled loop with '
+ - UnrollCount: '11'
+ - String: ' iterations'
+...
+--- !Passed
+Pass: loop-unroll
+Name: FullyUnrolled
+DebugLoc: { File: Inputs/unrl.c, Line: 4, Column: 3 }
+Function: foo
+Args:
+ - String: 'completely unrolled loop with '
+ - UnrollCount: '5'
+ - String: ' iterations'
+...
diff --git a/llvm/test/tools/llvm-opt-report/unrl.test b/llvm/test/tools/llvm-opt-report/unrl.test
new file mode 100644
index 00000000000..3232d18effc
--- /dev/null
+++ b/llvm/test/tools/llvm-opt-report/unrl.test
@@ -0,0 +1,14 @@
+RUN: llvm-opt-report -r %p %p/Inputs/unrl.yaml | FileCheck -strict-whitespace %s
+
+; CHECK: < {{.*[/\]}}unrl.c
+; CHECK-NEXT: 1 | void bar();
+; CHECK-NEXT: 2 |
+; CHECK-NEXT: 3 | void foo() {
+; CHECK-NEXT: 4 U5 | for (int i = 0; i < 5; ++i)
+; CHECK-NEXT: 5 | bar();
+; CHECK-NEXT: 6 |
+; CHECK-NEXT: 7 U11 | for (int i = 0; i < 11; ++i)
+; CHECK-NEXT: 8 | bar();
+; CHECK-NEXT: 9 | }
+; CHECK-NEXT: 10 |
+
OpenPOWER on IntegriCloud