llvm-project/clang/test/Headers
Reid Kleckner 5e866e411c Add -fgnuc-version= to control __GNUC__ and other GCC macros
I noticed that compiling on Windows with -fno-ms-compatibility had the
side effect of defining __GNUC__, along with __GNUG__, __GXX_RTTI__, and
a number of other macros for GCC compatibility. This is undesirable and
causes Chromium to do things like mix __attribute__ and __declspec,
which doesn't work. We should have a positive language option to enable
GCC compatibility features so that we can experiment with
-fno-ms-compatibility on Windows. This change adds -fgnuc-version= to be
that option.

My issue aside, users have, for a long time, reported that __GNUC__
doesn't match their expectations in one way or another. We have
encouraged users to migrate code away from this macro, but new code
continues to be written assuming a GCC-only environment. There's really
nothing we can do to stop that. By adding this flag, we can allow them
to choose their own adventure with __GNUC__.

This overlaps a bit with the "GNUMode" language option from -std=gnu*.
The gnu language mode tends to enable non-conforming behaviors that we'd
rather not enable by default, but the we want to set things like
__GXX_RTTI__ by default, so I've kept these separate.

Helps address PR42817

Reviewed By: hans, nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D68055

llvm-svn: 374449
2019-10-10 21:04:25 +00:00
..
Inputs [OpenMP][Bugfix] Move double and float versions of abs under c++ macro 2019-05-15 20:28:23 +00:00
altivec-header.c For PR17164: split -fno-lax-vector-conversion into three different 2019-09-13 06:02:15 +00:00
altivec-intrin.c
arm-acle-header.c
arm-fp16-header.c [Testing] Workaround libcxx bug when OS is "none" 2019-09-26 08:19:44 +00:00
arm-neon-header.c [ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 2. 2019-10-10 18:45:34 +00:00
arm64-apple-ios-types.cpp
c11.c Revert Include corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS compatibility. 2019-05-08 22:01:20 +00:00
c89.c
cpuid.c
cxx11.cpp
float-darwin.c
float.c [clang] Only provide C11 features in <float.h> starting with C++17 2019-02-22 20:48:54 +00:00
float16.c Fix the predefined exponent limit macros for the 16-bit IEEE format. 2019-05-31 01:21:36 +00:00
htm-header.c
int64-type.c
limits.cpp
max_align.c XFAIL clang/test/Headers/max_align.c on i686 2019-07-09 21:06:34 +00:00
mm3dnow.c
ms-arm64-intrin.cpp [COFF, ARM64] Remove definitions for _byteswap library functions 2019-02-11 20:04:02 +00:00
ms-cppoperkey.cpp
ms-cppoperkey1.cpp
ms-cppoperkey2.cpp
ms-intrin.cpp Recommit r351160 "[X86] Make _xgetbv/_xsetbv on non-windows platforms" 2019-01-16 22:56:25 +00:00
ms-null-ms-header-vs-stddef.cpp Revert Include corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS compatibility. 2019-05-08 22:01:20 +00:00
ms-wchar.c
nvptx_device_cmath_functions.c [OpenMP][Bugfix] Move double and float versions of abs under c++ macro 2019-05-15 20:28:23 +00:00
nvptx_device_cmath_functions.cpp [OpenMP][Bugfix] Move double and float versions of abs under c++ macro 2019-05-15 20:28:23 +00:00
nvptx_device_cmath_functions_cxx17.cpp [OpenMP][Bugfix] Move double and float versions of abs under c++ macro 2019-05-15 20:28:23 +00:00
nvptx_device_math_functions.c [OpenMP][Bugfix] Move double and float versions of abs under c++ macro 2019-05-15 20:28:23 +00:00
nvptx_device_math_functions.cpp [OpenMP][Bugfix] Move double and float versions of abs under c++ macro 2019-05-15 20:28:23 +00:00
nvptx_device_math_functions_cxx17.cpp [OpenMP][Bugfix] Move double and float versions of abs under c++ macro 2019-05-15 20:28:23 +00:00
opencl-c-header.cl [OpenCL] Rename lang mode flag for C++ mode 2019-07-25 11:04:29 +00:00
pconfigintin.c [X86] NFC Include immintrin.h in CodeGen tests 2018-05-24 07:09:08 +00:00
pmmintrin.c
ppc-intrinsics.c [PowerPC] [Clang] Port SSE3, SSSE3 and SSE4 intrinsics to PowerPC 2019-08-09 03:39:55 +00:00
sgxintrin.c [X86] NFC Include immintrin.h in CodeGen tests 2018-05-24 07:09:08 +00:00
stdarg-gnuc_va_list.c
stdarg.cpp
stdatomic.c
stdbool.cpp Add -fgnuc-version= to control __GNUC__ and other GCC macros 2019-10-10 21:04:25 +00:00
stddefneeds.cpp
stdint-typeof-MINMAX.cpp
tgmath-darwin.c
tgmath.c
thumbv7-apple-ios-types.cpp PR26547: alignof should return ABI alignment, not preferred alignment 2018-10-26 19:26:45 +00:00
typedef_guards.c
unwind.c
wchar_limits.cpp
wmmintrin.c
x86-intrinsics-headers-clean.cpp For PR17164: split -fno-lax-vector-conversion into three different 2019-09-13 06:02:15 +00:00
x86-intrinsics-headers.c For PR17164: split -fno-lax-vector-conversion into three different 2019-09-13 06:02:15 +00:00
x86_64-apple-macosx-types.cpp
x86intrin-2.c For PR17164: split -fno-lax-vector-conversion into three different 2019-09-13 06:02:15 +00:00
x86intrin.c For PR17164: split -fno-lax-vector-conversion into three different 2019-09-13 06:02:15 +00:00
x86intrin.cpp
xmmintrin.c Fix reliance on lax vector conversions in tests for x86 intrinsics. 2019-09-17 03:56:28 +00:00