aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/C++Frontend/2007-04-10-PackedUnion.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/C++Frontend/2007-04-10-PackedUnion.cpp b/test/C++Frontend/2007-04-10-PackedUnion.cpp
new file mode 100644
index 0000000000..b4b8894ae2
--- /dev/null
+++ b/test/C++Frontend/2007-04-10-PackedUnion.cpp
@@ -0,0 +1,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;
+}