summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/MIR/Generic
diff options
context:
space:
mode:
authorGeoff Berry <gberry@codeaurora.org>2016-11-18 19:37:24 +0000
committerGeoff Berry <gberry@codeaurora.org>2016-11-18 19:37:24 +0000
commitb51774ac8ca27bb4705a61754781382fadbd1f22 (patch)
treec083a2a54522a3753af638244397120680114faa /llvm/test/CodeGen/MIR/Generic
parent2a3d10ae613af37491fd81747ec418d2d93635b0 (diff)
downloadbcm5719-llvm-b51774ac8ca27bb4705a61754781382fadbd1f22.tar.gz
bcm5719-llvm-b51774ac8ca27bb4705a61754781382fadbd1f22.zip
[MIRPrinter] Print raw branch probabilities as expected by MIRParser
Fixes PR28751. Reviewers: MatzeB, qcolombet Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D26775 llvm-svn: 287368
Diffstat (limited to 'llvm/test/CodeGen/MIR/Generic')
-rw-r--r--llvm/test/CodeGen/MIR/Generic/branch-probabilities.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MIR/Generic/branch-probabilities.ll b/llvm/test/CodeGen/MIR/Generic/branch-probabilities.ll
new file mode 100644
index 00000000000..6a9e70ec47f
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/Generic/branch-probabilities.ll
@@ -0,0 +1,26 @@
+; RUN: llc -stop-after machine-sink %s -o %t.mir
+; RUN: FileCheck %s < %t.mir
+; RUN: llc %t.mir -run-pass machine-sink
+; Check that branch probabilities are printed in a format that can then be parsed.
+
+declare void @foo()
+declare void @bar()
+
+define void @test(i1 %c) {
+; CHECK-LABEL: name: test
+entry:
+ br i1 %c, label %then, label %else
+
+then:
+ call void @foo()
+ br label %end
+; CHECK: successors: %{{[a-z0-9\-\.]+}}({{0x[0-9a-f]+}}), %{{[a-z0-9\-\.]+}}({{0x[0-9a-f]+}})
+
+else:
+ call void @bar()
+ br label %end
+; CHECK: successors: %{{[a-z0-9\-\.]+}}({{0x[0-9a-f]+}})
+
+end:
+ ret void
+}
OpenPOWER on IntegriCloud