r214794 - clang/test/Sema/struct-packed-align.c: Add the case in MS mode that alignment doesn't affect packing.
NAKAMURA Takumi
geek4civic at gmail.com
Mon Aug 4 15:48:19 PDT 2014
Author: chapuni
Date: Mon Aug 4 17:48:19 2014
New Revision: 214794
URL: http://llvm.org/viewvc/llvm-project?rev=214794&view=rev
Log:
clang/test/Sema/struct-packed-align.c: Add the case in MS mode that alignment doesn't affect packing.
Also, revert a couple of suppressions.
r214298, "Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64."
r214301, "Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating."
Modified:
cfe/trunk/test/Sema/struct-packed-align.c
Modified: cfe/trunk/test/Sema/struct-packed-align.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/struct-packed-align.c?rev=214794&r1=214793&r2=214794&view=diff
==============================================================================
--- cfe/trunk/test/Sema/struct-packed-align.c (original)
+++ cfe/trunk/test/Sema/struct-packed-align.c Mon Aug 4 17:48:19 2014
@@ -1,9 +1,6 @@
// RUN: %clang_cc1 %s -fsyntax-only -verify
// expected-no-diagnostics
-// FIXME: This test is incompatible to MS compat mode.
-// REQUIRES: shell
-
// Packed structs.
struct s {
char a;
@@ -123,7 +120,6 @@ extern int m1[sizeof(struct packed_fas2)
extern int m2[__alignof(struct packed_fas2) == 1 ? 1 : -1];
// Attribute aligned can round down typedefs. PR9253
-// REQUIRES: LP64
typedef long long __attribute__((aligned(1))) nt;
struct nS {
@@ -131,5 +127,11 @@ struct nS {
nt start_lba;
};
+#if defined(_WIN32) && !defined(__declspec) // _MSC_VER is unavailable in cc1.
+// Alignment doesn't affect packing in MS mode.
+extern int n1[sizeof(struct nS) == 16 ? 1 : -1];
+extern int n2[__alignof(struct nS) == 8 ? 1 : -1];
+#else
extern int n1[sizeof(struct nS) == 9 ? 1 : -1];
extern int n2[__alignof(struct nS) == 1 ? 1 : -1];
+#endif
More information about the cfe-commits
mailing list