summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorWesley Peck <peckw@wesleypeck.com>2010-12-15 20:27:28 +0000
committerWesley Peck <peckw@wesleypeck.com>2010-12-15 20:27:28 +0000
commit0c558b20807fdfcb3c346501caefa849ceebcc44 (patch)
tree3aa1a7ea97d558364345bc3a1cef5dcbaf32af4f /llvm/test/CodeGen
parent1ee1d6364930b579810cff0362024780c52f6dcd (diff)
downloadbcm5719-llvm-0c558b20807fdfcb3c346501caefa849ceebcc44.tar.gz
bcm5719-llvm-0c558b20807fdfcb3c346501caefa849ceebcc44.zip
Lower the MBlaze target specific calling conventions for "interrupt_handler"
and "save_volatiles" correctly. This completes the custom calling convention functionality changes for the MBlaze backend that were started in 121888. llvm-svn: 121891
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/MBlaze/intr.ll48
-rw-r--r--llvm/test/CodeGen/MBlaze/svol.ll80
2 files changed, 128 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MBlaze/intr.ll b/llvm/test/CodeGen/MBlaze/intr.ll
new file mode 100644
index 00000000000..79c6bffd00c
--- /dev/null
+++ b/llvm/test/CodeGen/MBlaze/intr.ll
@@ -0,0 +1,48 @@
+; Ensure that the MBlaze interrupt_handler calling convention (cc73) is handled
+; correctly correctly by the MBlaze backend.
+;
+; RUN: llc < %s -march=mblaze | FileCheck %s
+
+@.str = private constant [28 x i8] c"The interrupt has gone off\0A\00"
+@_interrupt_handler = alias void ()* @myintr
+
+define cc73 void @myintr() nounwind noinline {
+ ; CHECK: myintr:
+ ; CHECK: swi r3, r1
+ ; CHECK: swi r4, r1
+ ; CHECK: swi r5, r1
+ ; CHECK: swi r6, r1
+ ; CHECK: swi r7, r1
+ ; CHECK: swi r8, r1
+ ; CHECK: swi r9, r1
+ ; CHECK: swi r10, r1
+ ; CHECK: swi r11, r1
+ ; CHECK: swi r12, r1
+ ; CHECK: swi r17, r1
+ ; CHECK: swi r18, r1
+ ; CHECK: mfs r11, rmsr
+ ; CHECK: swi r11, r1
+ entry:
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([28 x i8]* @.str, i32 0, i32 0))
+ ret void
+
+ ; CHECK: lwi r11, r1
+ ; CHECK: mts rmsr, r11
+ ; CHECK: lwi r18, r1
+ ; CHECK: lwi r17, r1
+ ; CHECK: lwi r12, r1
+ ; CHECK: lwi r11, r1
+ ; CHECK: lwi r10, r1
+ ; CHECK: lwi r9, r1
+ ; CHECK: lwi r8, r1
+ ; CHECK: lwi r7, r1
+ ; CHECK: lwi r6, r1
+ ; CHECK: lwi r5, r1
+ ; CHECK: lwi r4, r1
+ ; CHECK: lwi r3, r1
+ ; CHECK: rtid r14, 0
+}
+
+ ; CHECK: .globl _interrupt_handler
+ ; CHECK: _interrupt_handler = myintr
+declare i32 @printf(i8*, ...)
diff --git a/llvm/test/CodeGen/MBlaze/svol.ll b/llvm/test/CodeGen/MBlaze/svol.ll
new file mode 100644
index 00000000000..c1e96202845
--- /dev/null
+++ b/llvm/test/CodeGen/MBlaze/svol.ll
@@ -0,0 +1,80 @@
+; Ensure that the MBlaze save_volatiles calling convention (cc74) is handled
+; correctly correctly by the MBlaze backend.
+;
+; RUN: llc < %s -march=mblaze | FileCheck %s
+
+@.str = private constant [28 x i8] c"The interrupt has gone off\0A\00"
+
+define cc74 void @mysvol() nounwind noinline {
+ ; CHECK: mysvol:
+ ; CHECK: swi r3, r1
+ ; CHECK: swi r4, r1
+ ; CHECK: swi r5, r1
+ ; CHECK: swi r6, r1
+ ; CHECK: swi r7, r1
+ ; CHECK: swi r8, r1
+ ; CHECK: swi r9, r1
+ ; CHECK: swi r10, r1
+ ; CHECK: swi r11, r1
+ ; CHECK: swi r12, r1
+ ; CHECK: swi r17, r1
+ ; CHECK: swi r18, r1
+ ; CHECK-NOT: mfs r11, rmsr
+ entry:
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([28 x i8]* @.str, i32 0, i32 0))
+ ret void
+
+ ; CHECK-NOT: mts rmsr, r11
+ ; CHECK: lwi r18, r1
+ ; CHECK: lwi r17, r1
+ ; CHECK: lwi r12, r1
+ ; CHECK: lwi r11, r1
+ ; CHECK: lwi r10, r1
+ ; CHECK: lwi r9, r1
+ ; CHECK: lwi r8, r1
+ ; CHECK: lwi r7, r1
+ ; CHECK: lwi r6, r1
+ ; CHECK: lwi r5, r1
+ ; CHECK: lwi r4, r1
+ ; CHECK: lwi r3, r1
+ ; CHECK: rtsd r15, 8
+}
+
+define cc74 void @mysvol2() nounwind noinline {
+ ; CHECK: mysvol2:
+ ; CHECK-NOT: swi r3, r1
+ ; CHECK-NOT: swi r4, r1
+ ; CHECK-NOT: swi r5, r1
+ ; CHECK-NOT: swi r6, r1
+ ; CHECK-NOT: swi r7, r1
+ ; CHECK-NOT: swi r8, r1
+ ; CHECK-NOT: swi r9, r1
+ ; CHECK-NOT: swi r10, r1
+ ; CHECK-NOT: swi r11, r1
+ ; CHECK-NOT: swi r12, r1
+ ; CHECK: swi r17, r1
+ ; CHECK: swi r18, r1
+ ; CHECK-NOT: mfs r11, rmsr
+entry:
+
+ ; CHECK-NOT: mts rmsr, r11
+ ; CHECK: lwi r18, r1
+ ; CHECK: lwi r17, r1
+ ; CHECK-NOT: lwi r12, r1
+ ; CHECK-NOT: lwi r11, r1
+ ; CHECK-NOT: lwi r10, r1
+ ; CHECK-NOT: lwi r9, r1
+ ; CHECK-NOT: lwi r8, r1
+ ; CHECK-NOT: lwi r7, r1
+ ; CHECK-NOT: lwi r6, r1
+ ; CHECK-NOT: lwi r5, r1
+ ; CHECK-NOT: lwi r4, r1
+ ; CHECK-NOT: lwi r3, r1
+ ; CHECK: rtsd r15, 8
+ ret void
+}
+
+ ; CHECK-NOT: .globl _interrupt_handler
+ ; CHECK-NOT: _interrupt_handler = mysvol
+ ; CHECK-NOT: _interrupt_handler = mysvol2
+declare i32 @printf(i8*, ...)
OpenPOWER on IntegriCloud