Forbid arrays of function-type and structures with function-typed fields.
[llvm/avr.git] / test / FrontendC++ / x86-64-abi-sret-vs-2word-struct-param.cpp
blobec69afc2154107b84d6090745003fa427aa7c9c9
1 // RUN: %llvmgxx -S -emit-llvm %s -o - | grep byval | count 2
2 // XTARGET: x86
3 // PR4242
4 // (PR 4242 bug is on 64-bit only, test passes on x86-32 as well)
6 struct S {
7 void* data[3];
8 };
10 struct T {
11 void* data[2];
14 extern "C" S fail(int, int, int, int, T t, void* p) {
15 S s;
16 s.data[0] = t.data[0];
17 s.data[1] = t.data[1];
18 s.data[2] = p;
19 return s;
22 extern "C" S* succeed(S* sret, int, int, int, int, T t, void* p) {
23 sret->data[0] = t.data[0];
24 sret->data[1] = t.data[1];
25 sret->data[2] = p;
26 return sret;