summaryrefslogtreecommitdiff
path: root/test/CodeGen/Thumb2/thumb2-bcc.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-bcc.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-bcc.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-bcc.ll b/test/CodeGen/Thumb2/thumb2-bcc.ll
index aae9f5c0af714..70febc060e8d3 100644
--- a/test/CodeGen/Thumb2/thumb2-bcc.ll
+++ b/test/CodeGen/Thumb2/thumb2-bcc.ll
@@ -1,5 +1,8 @@
; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
; RUN: llc < %s -march=thumb -mattr=+thumb2 | not grep it
+; If-conversion defeats the purpose of this test, which is to check CBZ
+; generation, so use memory barrier instruction to make sure it doesn't
+; happen and we get actual branches.
define i32 @t1(i32 %a, i32 %b, i32 %c) {
; CHECK: t1:
@@ -8,12 +11,16 @@ define i32 @t1(i32 %a, i32 %b, i32 %c) {
br i1 %tmp2, label %cond_false, label %cond_true
cond_true:
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
%tmp5 = add i32 %b, 1
%tmp6 = and i32 %tmp5, %c
ret i32 %tmp6
cond_false:
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
%tmp7 = add i32 %b, -1
%tmp8 = xor i32 %tmp7, %c
ret i32 %tmp8
}
+
+declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind