summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/2007-04-05-StructPackedFieldUnpacked.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/2007-04-05-StructPackedFieldUnpacked.cpp')
-rw-r--r--clang/test/CodeGenCXX/2007-04-05-StructPackedFieldUnpacked.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/2007-04-05-StructPackedFieldUnpacked.cpp b/clang/test/CodeGenCXX/2007-04-05-StructPackedFieldUnpacked.cpp
new file mode 100644
index 0000000..c848e7c
--- /dev/null
+++ b/clang/test/CodeGenCXX/2007-04-05-StructPackedFieldUnpacked.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+
+#ifdef PACKED
+#define P __attribute__((packed))
+#else
+#define P
+#endif
+
+struct UnPacked {
+ int X;
+ int Y;
+};
+
+struct P M_Packed {
+ unsigned char A;
+ struct UnPacked B;
+};
+
+struct M_Packed sM_Packed;
+
+int testM_Packed (void) {
+ struct M_Packed x;
+ return (x.B.Y != 0);
+}