summaryrefslogtreecommitdiff
path: root/test/Sema/struct-packed-align.c
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-08-04 22:48:19 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-08-04 22:48:19 +0000
commit3d1e2a3ca90cb0cc17976d3b8fbc3eefcd6a5a86 (patch)
treeb076f3a3a3c15d57aa917c39935991eb83668a63 /test/Sema/struct-packed-align.c
parent2fa221732c9e811c407c68ba33e3f79babbb9ea5 (diff)
downloadclang-3d1e2a3ca90cb0cc17976d3b8fbc3eefcd6a5a86.tar.gz
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." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/struct-packed-align.c')
-rw-r--r--test/Sema/struct-packed-align.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/Sema/struct-packed-align.c b/test/Sema/struct-packed-align.c
index e28399d56a..291de6762c 100644
--- a/test/Sema/struct-packed-align.c
+++ b/test/Sema/struct-packed-align.c
@@ -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) == 1 ? 1 : -1];
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