summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll
diff options
context:
space:
mode:
authorStrahinja Petrovic <strahinja.petrovic@rt-rk.com>2016-06-13 10:29:29 +0000
committerStrahinja Petrovic <strahinja.petrovic@rt-rk.com>2016-06-13 10:29:29 +0000
commit7417e353113ab169ba6bc7616c932a6f960621e2 (patch)
treeaf0523f093791c637a9408cf8d3c8621551a013b /test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll
parentdc051d0c8c52818e2e91297efefbca0c057c36d2 (diff)
This patch fixes handling long double type when it is
constant in soft float mode on PowerPC 32 architecture. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll')
-rw-r--r--test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll b/test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll
new file mode 100644
index 00000000000..3a23ae31a85
--- /dev/null
+++ b/test/CodeGen/PowerPC/ppc32-constant-BE-ppcf128.ll
@@ -0,0 +1,24 @@
+; RUN: llc -O2 -mtriple=powerpc-unknown-linux-gnu < %s | FileCheck %s
+
+target datalayout = "E-m:e-p:32:32-i64:64-n32"
+target triple = "powerpc-buildroot-linux-gnu"
+
+@.str = private unnamed_addr constant [5 x i8] c"%Lf\0A\00", align 1
+
+define i32 @main() #0 {
+entry:
+ %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), ppc_fp128 0xM3FF00000000000000000000000000000)
+ ret i32 0
+}
+
+; First available register for long double argument is r4, so put
+; Hi part in r4/r5, Lo part in r6/r7 (do not switch Hi/Lo parts)
+; CHECK: lis 4, 16368
+; CHECK-NOT: lis 6, 16368
+; CHECK: li 5, 0
+; CHECK: li 7, 0
+
+declare i32 @printf(i8* nocapture readonly, ...)
+
+attributes #0 = { "use-soft-float"="true" }
+