Do not issue identity copies.
[oota-llvm.git] / test / FrontendC / 2007-09-28-PackedUnionMember.c
1 // RUN: %llvmgcc %s -S -o -
2 // XFAIL: *
3 // See PR2452
4
5 #pragma pack(push, 2)
6 struct H {
7   unsigned long f1;
8   unsigned long f2;
9   union {
10     struct opaque1 *f3;
11     struct opaque2 *f4;
12     struct {
13       struct opaque3 *f5;
14       unsigned short  f6;
15     } f7;
16   } f8;
17 };
18 #pragma pack(pop)
19
20 struct E {
21   unsigned long f1;
22   unsigned long f2;
23 };
24
25 typedef long (*FuncPtr) ();
26
27 extern long bork(FuncPtr handler, const struct E *list);
28
29 static long hndlr()
30 {
31   struct H cmd = { 4, 'fart' };
32   return 0;
33 }
34 void foo(void *inWindow) {
35   static const struct E events[] = {
36     { 'cmds', 1 }
37   };
38   bork(hndlr, events);
39 }
40