From 9c84d4a8a0ab6d12dca3cc15120114fedb7219bf Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 27 May 2010 18:42:17 +0000 Subject: Parse/Sema: Add support for '#pragma options align=packed', which, it should be noted, is not the same as __attribute__((packed)). That would be ridiculous! llvm-svn: 104865 --- clang/test/Sema/pragma-align-packed.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/Sema/pragma-align-packed.c (limited to 'clang/test') diff --git a/clang/test/Sema/pragma-align-packed.c b/clang/test/Sema/pragma-align-packed.c new file mode 100644 index 00000000000..6c9b06c6d6f --- /dev/null +++ b/clang/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 -- cgit v1.2.3