This should always be signed chars, so use int8_t. This fixes a miscompile when
[llvm/stm8.git] / test / FrontendC++ / x86-64-abi-sret-vs-2word-struct-param.cpp
blobf81854e0cb92683555980793852492ad641ad90d
1 // RUN: %llvmgxx -S %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;