diff options
author | Roman Divacky <rdivacky@freebsd.org> | 2013-07-25 21:36:47 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@freebsd.org> | 2013-07-25 21:36:47 +0000 |
commit | 6ebf55d811bab50e7f42ee8cec60c125f6fe0cd2 (patch) | |
tree | 96010301ba3704305cec3486ec3391d7138709e6 /test/CodeGen/PowerPC/ppc32-vacopy.ll | |
parent | 3367ed322026a475273dc676896c0d03c1e8102f (diff) | |
download | external_llvm-6ebf55d811bab50e7f42ee8cec60c125f6fe0cd2.zip external_llvm-6ebf55d811bab50e7f42ee8cec60c125f6fe0cd2.tar.gz external_llvm-6ebf55d811bab50e7f42ee8cec60c125f6fe0cd2.tar.bz2 |
PPC32 va_list is an actual structure so va_copy needs to copy the whole
structure not just a pointer. This implements that and thus fixes va_copy
on PPC32. Fixes #15286. Both bug and patch by Florian Zeitz!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/ppc32-vacopy.ll')
-rw-r--r-- | test/CodeGen/PowerPC/ppc32-vacopy.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/ppc32-vacopy.ll b/test/CodeGen/PowerPC/ppc32-vacopy.ll new file mode 100644 index 0000000..bc39412 --- /dev/null +++ b/test/CodeGen/PowerPC/ppc32-vacopy.ll @@ -0,0 +1,24 @@ +; RUN: llc -mtriple="powerpc-unknown-linux-gnu" < %s | FileCheck %s +; PR15286 + +%va_list = type {i8, i8, i16, i8*, i8*} +declare void @llvm.va_copy(i8*, i8*) + +define void @test_vacopy() nounwind { +entry: + %0 = alloca %va_list + %1 = alloca %va_list + %2 = bitcast %va_list* %0 to i8* + %3 = bitcast %va_list* %1 to i8* + + call void @llvm.va_copy(i8* %3, i8* %2) + + ret void +} +; CHECK: test_vacopy: +; CHECK: lwz [[REG1:[0-9]+]], {{.*}} +; CHECK: lwz [[REG2:[0-9]+]], {{.*}} +; CHECK: lwz [[REG3:[0-9]+]], {{.*}} +; CHECK: stw [[REG1]], {{.*}} +; CHECK: stw [[REG2]], {{.*}} +; CHECK: stw [[REG3]], {{.*}} |