clang/test/Sema/struct-packed-align.c: Add the case in MS mode that alignment doesn...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 4 Aug 2014 22:48:19 +0000 (22:48 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 4 Aug 2014 22:48:19 +0000 (22:48 +0000)
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."

llvm-svn: 214794

clang/test/Sema/struct-packed-align.c

index e28399d..291de67 100644 (file)
@@ -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