Imported Upstream version 4.7.2
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / torture / pr52402.c
1 /* { dg-do run } */
2 /* { dg-options "-w -Wno-psabi" } */
3 /* { dg-require-effective-target int32plus } */
4 /* { dg-xfail-run-if "pr52450" { { hppa*-*-hpux* } && { ! lp64 } } } */
5
6 typedef int v4si __attribute__((vector_size(16)));
7 struct T { v4si i[2]; int j; } __attribute__((packed));
8
9 static v4si __attribute__((noinline))
10 foo (struct T t)
11 {
12   return t.i[0];
13 }
14
15 static struct T *__attribute__((noinline))
16 init ()
17 {
18   char *p = __builtin_malloc (sizeof (struct T) + 1);
19   p++;
20   __builtin_memset (p, 1, sizeof (struct T));
21   return (struct T *)p;
22 }
23
24 int main()
25 {
26   struct T *p;
27   p = init ();
28   if (foo (*p)[0] != 0x01010101)
29     __builtin_abort ();
30   return 0;
31 }