summaryrefslogtreecommitdiff
path: root/clang/test/Sema/pragma-align-packed.c
diff options
context:
space:
mode:
authorZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
committerZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
commit222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch)
tree7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/test/Sema/pragma-align-packed.c
parent3d206f03985b50beacae843d880bccdc91a9f424 (diff)
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/test/Sema/pragma-align-packed.c')
-rw-r--r--clang/test/Sema/pragma-align-packed.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/Sema/pragma-align-packed.c b/clang/test/Sema/pragma-align-packed.c
new file mode 100644
index 0000000..74fbd13
--- /dev/null
+++ b/clang/test/Sema/pragma-align-packed.c
@@ -0,0 +1,30 @@
+// 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
+
+#pragma pack(1)
+struct s3_0 { unsigned char f0; unsigned int f1; };
+int t3_0[sizeof(struct s3_0) == 5 ? 1 : -1];
+#pragma options align=reset
+struct s3_1 { unsigned char f0; unsigned int f1; };
+int t3_1[sizeof(struct s3_1) == 8 ? 1 : -1];