diff options
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/constants.ll')
-rw-r--r-- | llvm/test/CodeGen/PowerPC/constants.ll | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/constants.ll b/llvm/test/CodeGen/PowerPC/constants.ll new file mode 100644 index 00000000000..37164cb4c94 --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/constants.ll @@ -0,0 +1,51 @@ +; All of these routines should be perform optimal load of constants. +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep lis | wc -l | grep 5 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep ori | wc -l | grep 3 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep 'li ' | wc -l | grep 4 + +implementation ; Functions: + +int %f1() { +entry: + ret int 1 +} + +int %f2() { +entry: + ret int -1 +} + +int %f3() { +entry: + ret int 0 +} + +int %f4() { +entry: + ret int 32767 +} + +int %f5() { +entry: + ret int 65535 +} + +int %f6() { +entry: + ret int 65536 +} + +int %f7() { +entry: + ret int 131071 +} + +int %f8() { +entry: + ret int 2147483647 +} + +int %f9() { +entry: + ret int -2147483648 +} |