From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenCXX/2007-04-10-PackedUnion.cpp | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 clang/test/CodeGenCXX/2007-04-10-PackedUnion.cpp (limited to 'clang/test/CodeGenCXX/2007-04-10-PackedUnion.cpp') diff --git a/clang/test/CodeGenCXX/2007-04-10-PackedUnion.cpp b/clang/test/CodeGenCXX/2007-04-10-PackedUnion.cpp new file mode 100644 index 0000000..863fc82 --- /dev/null +++ b/clang/test/CodeGenCXX/2007-04-10-PackedUnion.cpp @@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -emit-llvm %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; +} -- cgit v1.2.3