aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/pragma-pack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/pragma-pack.cpp')
-rw-r--r--test/SemaCXX/pragma-pack.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/SemaCXX/pragma-pack.cpp b/test/SemaCXX/pragma-pack.cpp
new file mode 100644
index 000000000000..1bc738b087a9
--- /dev/null
+++ b/test/SemaCXX/pragma-pack.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -verify %s
+
+namespace rdar8745206 {
+
+struct Base {
+ int i;
+};
+
+#pragma pack(push, 1)
+struct Sub : public Base {
+ char c;
+};
+#pragma pack(pop)
+
+int check[sizeof(Sub) == 5 ? 1 : -1];
+
+}
+
+namespace check2 {
+
+struct Base {
+ virtual ~Base();
+ int x;
+};
+
+#pragma pack(push, 1)
+struct Sub : virtual Base {
+ char c;
+};
+#pragma pack(pop)
+
+int check[sizeof(Sub) == 13 ? 1 : -1];
+
+}