diff options
author | Dale Johannesen <dalej@apple.com> | 2009-05-26 23:19:19 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-05-26 23:19:19 +0000 |
commit | 1ffaa15bfe5f2d577922e060ced2182c24eb2200 (patch) | |
tree | 513475949364117984ea281c8babbe154e0917d7 /test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp | |
parent | 82205570d1017c95fef1fe10b1741ccf6d01904e (diff) | |
download | external_llvm-1ffaa15bfe5f2d577922e060ced2182c24eb2200.zip external_llvm-1ffaa15bfe5f2d577922e060ced2182c24eb2200.tar.gz external_llvm-1ffaa15bfe5f2d577922e060ced2182c24eb2200.tar.bz2 |
Testcase for (llvm-gcc-4.2) 72442 (PR 4242).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp')
-rw-r--r-- | test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp b/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp new file mode 100644 index 0000000..ec69afc --- /dev/null +++ b/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp @@ -0,0 +1,27 @@ +// RUN: %llvmgxx -S -emit-llvm %s -o - | grep byval | count 2 +// XTARGET: x86 +// PR4242 +// (PR 4242 bug is on 64-bit only, test passes on x86-32 as well) + +struct S { + void* data[3]; +}; + +struct T { + void* data[2]; +}; + +extern "C" S fail(int, int, int, int, T t, void* p) { + S s; + s.data[0] = t.data[0]; + s.data[1] = t.data[1]; + s.data[2] = p; + return s; +} + +extern "C" S* succeed(S* sret, int, int, int, int, T t, void* p) { + sret->data[0] = t.data[0]; + sret->data[1] = t.data[1]; + sret->data[2] = p; + return sret; +} |