From 773fd3855310f91aef4ef974ce57ed409d26341d Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 10 Apr 2007 21:43:01 +0000 Subject: [PATCH] New test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35868 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/C++Frontend/2007-04-10-PackedUnion.cpp | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/C++Frontend/2007-04-10-PackedUnion.cpp 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 00000000000..b4b8894ae2c --- /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; +}