summaryrefslogtreecommitdiffstats
path: root/test/Sema/pragma-align-packed.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/pragma-align-packed.c')
-rw-r--r--test/Sema/pragma-align-packed.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Sema/pragma-align-packed.c b/test/Sema/pragma-align-packed.c
new file mode 100644
index 0000000..30b87bf
--- /dev/null
+++ b/test/Sema/pragma-align-packed.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
+
+#pragma pack(push, 1)
+struct s0 {
+ char f0;
+ int f1 __attribute__((aligned(4)));
+};
+extern int a[sizeof(struct s0) == 5 ? 1 : -1];
+#pragma pack(pop)
+
+struct __attribute__((packed)) s1 {
+ char f0;
+ int f1 __attribute__((aligned(4)));
+};
+extern int a[sizeof(struct s1) == 8 ? 1 : -1];
+
+#pragma options align=packed
+struct s2 {
+ char f0;
+ int f1 __attribute__((aligned(4)));
+};
+extern int a[sizeof(struct s2) == 5 ? 1 : -1];
+#pragma options align=reset
OpenPOWER on IntegriCloud