From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Sema/pragma-align-packed.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 clang/test/Sema/pragma-align-packed.c (limited to 'clang/test/Sema/pragma-align-packed.c') 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]; -- cgit v1.2.3