summaryrefslogtreecommitdiffstats
path: root/test/Sema/pragma-pack-6.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/pragma-pack-6.c')
-rw-r--r--test/Sema/pragma-pack-6.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Sema/pragma-pack-6.c b/test/Sema/pragma-pack-6.c
new file mode 100644
index 0000000..40659c2
--- /dev/null
+++ b/test/Sema/pragma-pack-6.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple i686-apple-darwin9 %s -fsyntax-only -verify
+
+// Pragma pack handling with tag declarations
+
+struct X;
+
+#pragma pack(2)
+struct X { int x; };
+struct Y;
+#pragma pack()
+
+struct Y { int y; };
+
+extern int check[__alignof(struct X) == 2 ? 1 : -1];
+extern int check[__alignof(struct Y) == 4 ? 1 : -1];
+
OpenPOWER on IntegriCloud