[llvm-commits] [llvm] r72443 - /llvm/trunk/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp
Dale Johannesen
dalej at apple.com
Tue May 26 16:19:19 PDT 2009
Author: johannes
Date: Tue May 26 18:19:19 2009
New Revision: 72443
URL: http://llvm.org/viewvc/llvm-project?rev=72443&view=rev
Log:
Testcase for (llvm-gcc-4.2) 72442 (PR 4242).
Added:
llvm/trunk/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp
Added: llvm/trunk/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/x86-64-abi-sret-vs-2word-struct-param.cpp?rev=72443&view=auto
==============================================================================
--- llvm/trunk/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp (added)
+++ llvm/trunk/test/FrontendC++/x86-64-abi-sret-vs-2word-struct-param.cpp Tue May 26 18:19:19 2009
@@ -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;
+}
More information about the llvm-commits
mailing list