1 // RUN: %llvmgxx -S -O0 -emit-llvm %s -o - | grep retval | grep S242 | grep {i32 1} | count 2
3 // Test that all 8 bytes of ret in check242 are copied. llvm-gcc was
4 // treating S242 as if it were S93, which does not need to have the
5 // last 4 padding bytes copied.
6 typedef __builtin_va_list va_list;
7 typedef unsigned long size_t;
8 void *memset(void *, int, size_t);
9 struct S92 { int a:14; } ;
10 extern struct S92 s92;
12 struct S92 check92 () { struct S92 ret;
13 memset (&ret, 0, sizeof (ret));
17 struct S93 { __attribute__((aligned (8))) void * a; } ;
18 extern struct S93 s93;
19 struct S93 check93 () {
21 memset (&ret, 0, sizeof (ret));
25 struct S242 { char * a;int b[1]; } ;
26 extern struct S242 s242;
28 struct S242 check242 () {
30 memset (&ret, 0, sizeof (ret));
35 void check93va (int z, ...) {
38 __builtin_va_start(ap,z);
39 arg = __builtin_va_arg(ap,struct S93);
40 __builtin_va_end(ap); }
42 void check242va (int z, ...) {
45 __builtin_va_start(ap,z);
46 arg = __builtin_va_arg(ap,struct S242);
47 __builtin_va_end(ap); }