Tests to verify PowerPC ABI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31825 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Laskey 2006-11-17 16:54:21 +00:00
parent 2ff5cdb16c
commit 64c32dd2ea
4 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,24 @@
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'stwu r1, -64(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'lwz r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'stwu r1, -64(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'lwz r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'std r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'stdu r1, -112(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'ld r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'ld r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'std r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'stdu r1, -112(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'ld r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'ld r31, 40(r1)'
implementation
int* %f1(uint %n) {
%tmp = alloca int, uint %n
ret int* %tmp
}

View File

@ -0,0 +1,32 @@
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'lis r0, -1' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'ori r0, r0, 32704' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'stwux r1, r1, r0' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'lwz r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'lis r0, -1' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'ori r0, r0, 32704' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'stwux r1, r1, r0' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'lwz r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'std r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'lis r0, -1' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'ori r0, r0, 32656' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'stdux r1, r1, r0' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'ld r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'ld r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'std r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'lis r0, -1' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'ori r0, r0, 32656' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'stdux r1, r1, r0' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'ld r1, 0(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'ld r31, 40(r1)'
implementation
int* %f1() {
%tmp = alloca int, uint 8191
ret int* %tmp
}

View File

@ -0,0 +1,24 @@
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'stwu r1, -.*(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'addi r1, r1, ' &&
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | NOT grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | NOT grep 'stwu r1, -.*(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | NOT grep 'addi r1, r1, ' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | NOT grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'std r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'stdu r1, -.*(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'addi r1, r1, ' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'ld r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | NOT grep 'stw r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | NOT grep 'stdu r1, -.*(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | NOT grep 'addi r1, r1, ' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | NOT grep 'ld r31, 40(r1)'
implementation
int* %f1() {
%tmp = alloca int, uint 2
ret int* %tmp
}

View File

@ -0,0 +1,24 @@
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'stwu r1, -16448(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep 'addi r1, r1, 16448' &&
; RUN: llvm-as < %s | llc -march=ppc32 | NOT grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'stw r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'stwu r1, -16448(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'addi r1, r1, 16448' &&
; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | grep 'lwz r31, 20(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'std r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'stdu r1, -16496(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 | grep 'addi r1, r1, 16496' &&
; RUN: llvm-as < %s | llc -march=ppc64 | NOT grep 'ld r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'std r31, 40(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'stdu r1, -16496(r1)' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'addi r1, r1, 16496' &&
; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | grep 'ld r31, 40(r1)'
implementation
int* %f1() {
%tmp = alloca int, uint 4095
ret int* %tmp
}