Index: lib/AST/RecordLayoutBuilder.cpp =================================================================== --- lib/AST/RecordLayoutBuilder.cpp +++ lib/AST/RecordLayoutBuilder.cpp @@ -1754,8 +1754,8 @@ CharUnits TypeSize = Context.getTypeSizeInChars(BTy); assert( (llvm::isPowerOf2_64(TypeSize.getQuantity()) || - Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) && - "Non PowerOf2 size outside of GNU mode"); + !Context.getTargetInfo().getTriple().isWindowsMSVCEnvironment()) && + "Non PowerOf2 size in MSVC mode"); if (TypeSize > FieldAlign && llvm::isPowerOf2_64(TypeSize.getQuantity())) FieldAlign = TypeSize; Index: test/CodeGen/ms_struct-long-double.c =================================================================== --- /dev/null +++ test/CodeGen/ms_struct-long-double.c @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -emit-llvm-only -triple i686-windows-gnu -fdump-record-layouts %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm-only -triple i686-linux -fdump-record-layouts %s | FileCheck %s + +struct ldb_struct { + char c; + long double ldb; +} __attribute__((__ms_struct__)); + +struct ldb_struct a; + +// CHECK: 0 | struct ldb_struct +// CHECK-NEXT: 0 | char c +// CHECK-NEXT: 4 | long double ldb +// CHECK-NEXT: | [sizeof=16, align=4]