[llvm-branch-commits] [cfe-branch] r208601 - Merging r202911:
Tom Stellard
thomas.stellard at amd.com
Mon May 12 10:32:31 PDT 2014
Author: tstellar
Date: Mon May 12 12:32:31 2014
New Revision: 208601
URL: http://llvm.org/viewvc/llvm-project?rev=208601&view=rev
Log:
Merging r202911:
------------------------------------------------------------------------
r202911 | david.majnemer | 2014-03-04 18:43:48 -0500 (Tue, 04 Mar 2014) | 14 lines
Headers: Provide an ABI compatible max_align_t when _MSC_VER is defined
Summary:
Our usual definition of max_align_t wouldn't match up with MSVC if it
was used in a template argument.
Reviewers: chandlerc, rsmith, rnk
Reviewed By: chandlerc
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2924
------------------------------------------------------------------------
Modified:
cfe/branches/release_34/lib/Headers/stddef.h
cfe/branches/release_34/test/Headers/c11.c
Modified: cfe/branches/release_34/lib/Headers/stddef.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Headers/stddef.h?rev=208601&r1=208600&r2=208601&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Headers/stddef.h (original)
+++ cfe/branches/release_34/lib/Headers/stddef.h Mon May 12 12:32:31 2014
@@ -85,12 +85,16 @@ using ::std::nullptr_t;
#endif
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
+#ifndef _MSC_VER
typedef struct {
long long __clang_max_align_nonce1
__attribute__((__aligned__(__alignof__(long long))));
long double __clang_max_align_nonce2
__attribute__((__aligned__(__alignof__(long double))));
} max_align_t;
+#else
+typedef double max_align_t;
+#endif
#define __CLANG_MAX_ALIGN_T_DEFINED
#endif
Modified: cfe/branches/release_34/test/Headers/c11.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/test/Headers/c11.c?rev=208601&r1=208600&r2=208601&view=diff
==============================================================================
--- cfe/branches/release_34/test/Headers/c11.c (original)
+++ cfe/branches/release_34/test/Headers/c11.c Mon May 12 12:32:31 2014
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -triple i686-pc-win32 -fmsc-version=1700 %s
noreturn int f(); // expected-error 1+{{}}
@@ -27,6 +28,10 @@ _Static_assert(alignof(max_align_t) >= a
_Static_assert(sizeof(max_align_t) >= sizeof(long double), "");
_Static_assert(alignof(max_align_t) >= alignof(long double), "");
+#ifdef _MSC_VER
+_Static_assert(sizeof(max_align_t) == sizeof(double), "");
+#endif
+
// If we are freestanding, then also check RSIZE_MAX (in a hosted implementation
// we will use the host stdint.h, which may not yet have C11 support).
#ifndef __STDC_HOSTED__
More information about the llvm-branch-commits
mailing list