Commit Graph

97 Commits

Author SHA1 Message Date
Akira Hatanaka c0303355e9 Recommit r209532 with -ffreestanding.
This is a test case for r209489.

llvm-svn: 209559
2014-05-23 22:12:01 +00:00
Akira Hatanaka d59c92d047 Remove test while I investigate why the test is breaking the bots.
llvm-svn: 209558
2014-05-23 21:35:50 +00:00
Akira Hatanaka 3f1b632ad8 XFAIL test which is breaking some of the build bots.
llvm-svn: 209556
2014-05-23 21:24:24 +00:00
Akira Hatanaka 4625f85bb7 Test case for r209489.
llvm-svn: 209532
2014-05-23 17:35:08 +00:00
Alp Toker a01285c4b3 Split out header integration tests
These are somewhat arbitrary tests that check if "thing goes fine" when
processing various platform-specific headers.

Also move warn-sysheader.cpp to Misc where the other diagnostics infrastructure
tests live.

File moves only.

llvm-svn: 207936
2014-05-04 13:00:32 +00:00
Nico Weber ae360dc36c Add a triple to new test.
NULL is just 0 on Windows, so the Wsentinel part of the test doesn't pass there.

llvm-svn: 207607
2014-04-30 04:54:42 +00:00
Nico Weber 272bcf6768 Let stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}.
glibc expects that stddef.h only defines a single thing if either of these
defines is set.  For example, before this change, a C file containing

  #include <stdlib.h>
  int ptrdiff_t = 0;

would compile with gcc but not with clang. Now it compiles with clang too.

This also fixes PR12997, where older versions of the Linux headers would define
NULL incorrectly, and glibc would define __need_NULL and expect stddef.h to
redefine NULL with the correct definition.

llvm-svn: 207606
2014-04-30 04:35:09 +00:00
Nico Weber f077c51a70 Revert r207482; I fail at reading IRC.
llvm-svn: 207483
2014-04-29 01:25:49 +00:00
Nico Weber 8af28c1e61 Let stddef.h redefine NULL if __need_NULL is set, as needed by glibc, PR12997.
See the bug and the cfe-commits thread "[patch] Let stddef.h redefine NULL if
__need_NULL is set" for discussion.

Fixes PR12997 and is similar to the __need_wint_t bits already in this file.

llvm-svn: 207482
2014-04-29 01:19:21 +00:00
Alp Toker 8ee5b01f34 Move ObjC Cocoa.h header test to Headers
This tests for broad compatibility with platform SDK headers using the clang
driver and so belongs alongside the other header ingtegration tests.

llvm-svn: 206687
2014-04-19 19:07:24 +00:00
Alp Toker 7591a05d14 Re-enable the C++11 modules integration test on OS X
XCode 5.1.1 has shipped with fixed SDK headers.

This reverts commit r200256.

Fixes PR18322.

llvm-svn: 206686
2014-04-19 19:07:19 +00:00
Hans Wennborg dd0f5304f6 MS intrinsics: don't declare __readeflags and __writeeflags in Intrin.h
They're already defined in ia32intrin.h, and this would cause including Intrin.h
in 64-bit mode to fail because of conflicting types. Update ms-intrin.cpp to
also run in 64-bit mode to catch things like this.

llvm-svn: 203714
2014-03-12 21:09:03 +00:00
Ben Langmuir 101390e116 Add -fmodules-cache-path to test/Headers/c11.c
This started failing for me the last time someone modified the AST file
format. It would be nice if we could just have lit take care of the
module cache used during testing for us, but this helps in the meantime.

llvm-svn: 203511
2014-03-10 23:17:14 +00:00
Rafael Espindola 1368f8ac96 Update for llvm change.
llvm-svn: 203000
2014-03-05 20:08:57 +00:00
David Majnemer 1e57976ec0 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

llvm-svn: 202911
2014-03-04 23:43:48 +00:00
Daniel Jasper 2f0f297bdb Revert r201734 and r201742.
This breaks backwards compatibility with existing code. Previously, this
was defined as

  #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))

Which basically accepts any pointer. Changing this to char* simply
breaks a lot of existing code. I have tried changing char* to
"const void*", which seems to be the right thing as per Intel
specification this should work on basically any pointer. However,
apparently this breaks windows compatibility (because of a conflicting
declaration in windows.h).

So, we probably need to #ifdef this based on whether clang is compiling
for windows. According to Chandler, this might be done by introducing an
additional symbol to a fake type in BuiltinsX86.def and then condition
the type expansion on the platform.

llvm-svn: 201775
2014-02-20 11:10:48 +00:00
Timur Iskhodzhanov 1f2ce39006 Revert r201772 as it breaks things on Windows
We should probably use different argument types on different platforms?

llvm-svn: 201774
2014-02-20 10:46:28 +00:00
Daniel Jasper 5a02bf26fc Change parameter type of _mm_prefetch to "const void *".
Otherwise, this is not backwards compatible to the existing macro and
can break existing code.

llvm-svn: 201772
2014-02-20 10:04:07 +00:00
Daniel Jasper 2b05fd96d5 Don't actually emit output in test/Headers/mmprefetch.c.
The test directory cannot assumed to be writable.

llvm-svn: 201768
2014-02-20 08:45:49 +00:00
Warren Hunt 40d6f29ad8 Add _mm_prefetch and some others as MS builtins
This patch adds several built-ins that are required for ms 
compatibility. _mm_prefetch must be a built-in because it takes a 
compile-time constant argument and our prior approach of using a #define 
to the current built-in doesn't work in the presence of re-declaration 
of _mm_prefetch. The others can be obtained by including the windows 
system headers. If a user includes the windows system headers but not 
intrin.h they still need to work and therefore must be built-in because 
we don't get a chance to implement them in intrin.h in this case.

llvm-svn: 201734
2014-02-19 23:20:20 +00:00
Chandler Carruth e813984b43 Teach Clang to provide ::max_align_t in C11 and C++11 modes.
This definition is not chosen idly. There is an unfortunate reality with
max_align_t -- the specific nature of its definition leaks into the ABI
almost immediately. Because it is part of C11 and C++11 it becomes
essential for it to match with other systems on that ABI. There is an
effort to discourage any further use of this construct as a consequence
-- using max_align_t introduces an immediate ABI problem. We can never
update it to have larger alignment even as the microarchitecture changes
to necessitate higher alignment. =/

The particular definition here exactly matches the ABI of GCC's chosen
::max_align_t definition, for better or worse. This was written with the
help of Richard Smith who was decoding the exact ABI implications of the
selected definition in GCC. Notably, in-register arguments are impacted
by the particular definition chosen. =/

No one is under the illusion that this is a "good" or "useful"
definition of max_align_t, and we are working with the standards
committee to specify a more useful interface to address this need.

llvm-svn: 201729
2014-02-19 22:35:01 +00:00
Hans Wennborg 1fd6dd3616 Intrin.h: include setjmp.h to get a jmp_buf definition
This makes sure that the ms-intrin.cpp test passes by providing
a mock setjmp.h as a test input.

llvm-svn: 200344
2014-01-28 23:01:59 +00:00
Bob Wilson 2d5d005842 Temporarily disable test that fails on Mac OS X 10.9.
PR18322. This test will be reenabled when the SDK gets fixed. In the meantime,
it is pretty disruptive to have this test keep failing.

llvm-svn: 200256
2014-01-27 22:43:21 +00:00
Alp Toker 6bd95b8aac Add a proper test for -Wsystem-headers
This will be extended as we fix issues in the current implementation.

llvm-svn: 200054
2014-01-25 00:32:40 +00:00
Hans Wennborg 72005cb59d ms-intrin.cpp: add -Werror to the test
llvm-svn: 199450
2014-01-17 01:41:07 +00:00
Hans Wennborg b3dec1b4b9 ms-intrin.cpp: no need for -verify anymore
llvm-svn: 199442
2014-01-17 00:04:43 +00:00
Hans Wennborg aae6ac48e7 Relax the ms-intrin.cpp test
The part that checks that certain functions are marked deprecated doesn't
seem that useful, and it has the bad effect that the test hard-coded the
locations of the notes from that test.

llvm-svn: 199441
2014-01-16 23:59:08 +00:00
Alp Toker 11a71128b7 Forbid driver use in Sema tests
This ports the last Sema tests over to use the frontend directly, and adds a
local lit substitution to disable inappropriate %clang usage under this
directory.

llvm-svn: 199348
2014-01-16 02:37:08 +00:00
Nico Weber 428a93b8ab Add a FIXME to a failing test.
(See discussion in the bug for why this isn't XFAILed.)

llvm-svn: 197991
2013-12-24 20:48:13 +00:00
Ted Kremenek b79ee57080 Implemented delayed processing of 'unavailable' checking, just like with 'deprecated'.
Fixes <rdar://problem/15584219> and <rdar://problem/12241361>.

This change looks large, but all it does is reuse and consolidate
the delayed diagnostic logic for deprecation warnings with unavailability
warnings.  By doing so, it showed various inconsistencies between the
diagnostics, which were close, but not consistent.  It also revealed
some missing "note:"'s in the deprecated diagnostics that were showing
up in the unavailable diagnostics, etc.

This change also changes the wording of the core deprecation diagnostics.
Instead of saying "function has been explicitly marked deprecated"
we now saw "'X' has been been explicitly marked deprecated".  It
turns out providing a bit more context is useful, and often we
got the actual term wrong or it was not very precise
 (e.g., "function" instead of "destructor").  By just saying the name
of the thing that is deprecated/deleted/unavailable we define
this issue away.  This diagnostic can likely be further wordsmithed
to be shorter.

llvm-svn: 197627
2013-12-18 23:30:06 +00:00
NAKAMURA Takumi 7cbe30fc43 clang/test: REQUIRES: s/ppc{32|64}-registered-target/powerpc-registered-target/
llvm-svn: 196349
2013-12-04 03:41:15 +00:00
JF Bastien 1334d0aedf Define [U]LLONG_{MIN,MAX} for C++11, add tests.
Add tests for limits.h, not just [U]LLONG_{MIN,MAX}.

llvm-svn: 193506
2013-10-27 19:00:49 +00:00
Reid Kleckner 00d33a5cb1 Add implementations of the MSVC barrier intrinsics
Summary:
These are deprecated in VS 2012 according to MSDN.  They don't actually
compile down to any code.  They prevent the compiler from reordering
memory accesses across the barrier, which is what a memory-clobbering
volatile asm does.

Reviewers: echristo

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1954

llvm-svn: 192860
2013-10-17 01:29:48 +00:00
Chandler Carruth 2c93cb2a6f Switch tests in test/Headers to use %clang_cc1 rather than %clang. There
is no need to go through the driver indirection here, and it clutters
things up as dependencies can sneak in for specific things the driver is
doing.

llvm-svn: 191107
2013-09-20 21:12:25 +00:00
Reid Kleckner 2f7fe8acb3 Use -ffreestanding in ms-intrin.cpp and define size_t manually.
llvm-svn: 190985
2013-09-19 01:54:40 +00:00
Reid Kleckner 5cc15addbe Avoid including <stdlib.h> in the intrin.h test
llvm-svn: 190979
2013-09-19 00:32:11 +00:00
Reid Kleckner f0e232287a Fix ifdef ordering at the end of Intrin.h from r190965
Test that intrin.h at least parses in C++ TUs.

llvm-svn: 190978
2013-09-19 00:19:53 +00:00
Peter Collingbourne ec1cb850d1 Add missing definitions to unwind.h.
Original patch by Charles Davis.

llvm-svn: 189535
2013-08-28 23:16:49 +00:00
Hans Wennborg d1ddb9afd4 CC1: Only parse command-line options that have the CC1Option flag.
We already reject flags that don't have the CC1Option flag,
but we would previously do so after parsing the command-line
arguments.

Since the option parser now has a parameter for excluding options,
we should just use that instead.

Differential Revision: http://llvm-reviews.chandlerc.com/D1270

llvm-svn: 187668
2013-08-02 20:16:22 +00:00
Richard Smith a9d6a0e1f8 Enable -ffreestanding for this test, to avoid #include_next'ing the system's
<stdint.h> (which might not exist or might not work).

llvm-svn: 185565
2013-07-03 18:35:53 +00:00
Richard Smith 2edd9709c6 Remove dependence on system headers from this test, to try to make the Windows bots happier.
llvm-svn: 181558
2013-05-09 22:45:27 +00:00
Richard Smith 8797d39fd9 Add testcase missed from r181527.
llvm-svn: 181531
2013-05-09 18:33:50 +00:00
Benjamin Kramer 4baf67a61b xopintrin.h: Add wrappers for all flavors of _mm_com.
GCC defines only the wrappers, MSVC defines both, we define both now too.
PR15844.

llvm-svn: 181514
2013-05-09 15:07:46 +00:00
Hans Wennborg 4c02be3b83 Make sure we define wchar_t related macros correctly in -fms-extensions mode.
This adds a test to make sure we define _WCHAR_T_DEFINED and
_NATIVE_WCHAR_T_DEFINED correctly in the preprocessor, and updates
stddef.h to set it when typedeffing wchar_t.

llvm-svn: 180918
2013-05-02 13:12:32 +00:00
Daniel Dunbar 893f3d54d9 [tests] Only include stdint.h if we are in freestanding mode.
- We shouldn't even try to include stdint.h in hosted mode, as the dependency
   on even parsing a platforms stdint.h might fail for some targets.

llvm-svn: 179723
2013-04-17 21:11:07 +00:00
Daniel Dunbar 50b8b5507b Headers: Don't try to use RSIZE_MAX unless we are freestanding.
- We don't want to depend on the platforms stdint.h.

llvm-svn: 179429
2013-04-12 23:41:08 +00:00
Daniel Dunbar 95f1de3de5 Headers: Add support for ISO9899:2011 rsize_t.
llvm-svn: 179427
2013-04-12 23:24:56 +00:00
Richard Smith 2362829734 tl;dr: Teach Clang to work around g++ changing its workaround to glibc's
implementation of C99's attempt to control the C++ standard. *sigh*


The C99 standard says that certain macros in <stdint.h>, such as SIZE_MAX,
should not be defined when the header is included in C++ mode, unless
__STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined. The C++11 standard
says "Thanks, but no thanks" and C11 removed this rule, but various C library
implementations (such as glibc) follow C99 anyway.

g++ prior to 4.8 worked around the C99 / glibc behavior by defining
__STDC_*_MACROS in <cstdint>, which was incorrect, because <stdint.h> is
supposed to provide these macros too. g++ 4.8 works around it by defining
__STDC_*_MACROS in its builtin <stdint.h> header.

This change makes Clang act like g++ 4.8 in this regard: our <stdint.h> now
countermands any attempt by the C library to implement the undesired C99 rules,
by defining the __STDC_*_MACROS first. Unlike g++, we do this even in C++98
mode, since that was the intent of the C++ committee, matches the behavior
required in C11, and matches our built-in implementation of <stdint.h>.

llvm-svn: 179419
2013-04-12 22:11:07 +00:00
Richard Smith 5dacbec4aa Don't build this test with modules for now, it's causing buildbot failures.
llvm-svn: 178740
2013-04-04 03:48:33 +00:00
Richard Smith 584f7dcc0e Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so.
llvm-svn: 178736
2013-04-04 02:55:24 +00:00