aboutsummaryrefslogtreecommitdiff
path: root/test/FrontendC++/2007-04-10-PackedUnion.cpp
blob: b4b8894ae2cf9fd34c6583a18fe1518f2e792c05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RUN: %llvmgxx -S %s -o /dev/null
extern "C" {

#pragma pack(push, 2)
  typedef struct ABC* abc;

  struct ABCS {
    float red;
    float green;
    float blue;
    float alpha;
  };

  typedef void (*XYZ)();
#pragma pack(pop)
}


union ABCU {
  ABCS color;
  XYZ bg;
};

struct AData {
  ABCU data;
};

class L {
 public:
  L() {}
  L(const L& other);

 private:
  AData fdata;
};


L::L(const L& other)
{
  fdata = other.fdata;
}