diff options
Diffstat (limited to 'test/CodeGen')
| -rw-r--r-- | test/CodeGen/Mips/brdelayslot.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/brdelayslot.ll b/test/CodeGen/Mips/brdelayslot.ll index 2fdb736dc8..897fc9768f 100644 --- a/test/CodeGen/Mips/brdelayslot.ll +++ b/test/CodeGen/Mips/brdelayslot.ll @@ -35,3 +35,35 @@ entry: declare void @foo4(double) +@g2 = external global i32 +@g1 = external global i32 +@g3 = external global i32 + +; Check that branch delay slot can be filled with an instruction with operand +; $1. +; +; Default: foo5: +; Default-NOT: nop + +define void @foo5(i32 %a) nounwind { +entry: + %0 = load i32* @g2, align 4 + %tobool = icmp eq i32 %a, 0 + br i1 %tobool, label %if.else, label %if.then + +if.then: + %1 = load i32* @g1, align 4 + %add = add nsw i32 %1, %0 + store i32 %add, i32* @g1, align 4 + br label %if.end + +if.else: + %2 = load i32* @g3, align 4 + %sub = sub nsw i32 %2, %0 + store i32 %sub, i32* @g3, align 4 + br label %if.end + +if.end: + ret void +} + |
