Commit Graph

76 Commits

Author SHA1 Message Date
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
Richard Smith 8acb4044d8 libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against
being included in C++. Don't define alignof or alignas in this case. Note that
the C++11 standard is broken in various ways here (it refers to the contents
of <stdalign.h> in C99, where that header did not exist, and doesn't mention
the alignas macro at all), but we do our best to do what it intended.

llvm-svn: 175708
2013-02-21 02:17:58 +00:00
Douglas Gregor 1a347f76c2 Reinstate r173952, this time limiting it to exactly the form
#define X X

for which there is no point warning, ever.

llvm-svn: 173991
2013-01-30 23:10:17 +00:00
Argyrios Kyrtzidis a94bd438f8 Revert "[preprocessor] Don't warn about "disabled expansion of recursive macro""
This reverts commit r173952

llvm-svn: 173970
2013-01-30 20:42:17 +00:00
Argyrios Kyrtzidis 8c8684bbe1 [preprocessor] Don't warn about "disabled expansion of recursive macro"
for "#define X X".

This is a pattern that, for example, stdbool.h uses.
rdar://12435773

llvm-svn: 173952
2013-01-30 18:55:52 +00:00
Richard Smith 4dab709484 C11: Provide the missing half of <stdalign.h>
llvm-svn: 173900
2013-01-30 06:33:54 +00:00
Richard Smith 0015f09877 Parsing support for C11's _Noreturn keyword. No semantics yet.
llvm-svn: 172761
2013-01-17 22:16:11 +00:00
Michael Gottesman 3d423040f5 [clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to ensure it only runs on ppc64.
llvm-svn: 167162
2012-10-31 20:20:04 +00:00
Ulrich Weigand 9936f137eb Add "static" to some functions in altivec.c where it was missing.
llvm-svn: 167148
2012-10-31 18:17:07 +00:00
Andy Gibbs c6e68daac0 Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.
llvm-svn: 166280
2012-10-19 12:44:48 +00:00
Jordan Rose 8ba0fba28a Use %clang_cc1 so that the test works even if the target isn't available.
Xcode-style clang builds only support Xcode's architectures, so mips
isn't available and the driver tries to use gcc instead. cc1 will go
ahead and do -fsyntax-only for any platform it knows about even if it
can't actually compile.

llvm-svn: 164742
2012-09-27 01:40:12 +00:00
Jordan Rose 17df40d484 Make our mini-stdint.h platform-independent by using predefined macros.
This also adds a definition for uint64_t, which was causing build failures
on some platforms. (I'm actually surprised this didn't happen on more
builders, but maybe the search paths are different.)

llvm-svn: 164706
2012-09-26 16:41:11 +00:00
Logan Chien 35795cf9c1 Fix build failure and enhance the testcase for unwind.h.
llvm-svn: 164683
2012-09-26 09:40:37 +00:00
Benjamin Kramer 010f114093 Run test in a freestanding environment so it doesn't accidentally pick up system headers for the wrong target.
While there add a test that verifies that the header parses in C++ mode.

llvm-svn: 164679
2012-09-26 09:10:53 +00:00
Logan Chien 774442162d Add struct keyword before _Unwind_Context.
In the C programming language, we have to add the
"struct" keyword.  Otherwise, the compiler will
emit error message.

llvm-svn: 164665
2012-09-26 06:35:17 +00:00
Chandler Carruth 4496c44e5f Remove the 'intrin.h' builtin header file and its tests for now.
After discussion with several people, including Doug Gregor, we've
decided to change our approach here. If you have questions about this
header file, the commit removing it, etc., please reach out to me
off-list.

llvm-svn: 156322
2012-05-07 20:46:58 +00:00
Nico Weber 1d725ecf93 Let NULL and MSVC headers coexist better.
Fixes the two issues mentioned in PR12146.

llvm-svn: 155490
2012-04-24 21:27:01 +00:00
Chandler Carruth 3dfb6d84c6 Introduce an initial sketch of a MSVC compatible 'intrin.h' builtin
header, along with a stub test to make sure it compiles in the
appropriate modes.

Thanks to Aaron Ballman for working with me to figure out the initial
strategy here, and to Nico for reviewing and pestering me to actually
commit it.

llvm-svn: 155425
2012-04-24 05:23:54 +00:00
David Blaikie 83261063d1 Fix tests that weren't actually verifying anything.
Passing -verify to clang without -cc1 or -Xclang silently passes (with a
printed warning, but lit doesn't care about that). This change adds -cc1 or,
as is necessary in one case, -Xclang to fix this so that these tests are
actually verifying as intended.

I'd like to change the driver so this kind of mistake could not be made, but
I'm not entirely sure how. Further, since the driver only warns about unknown
flags in general, we could have similar bugs with a misspellings of arguments
that would be nice to find.

llvm-svn: 154776
2012-04-15 22:09:44 +00:00
Sebastian Pop 422377cfd3 rename -ccc-host-triple into -target
llvm-svn: 148582
2012-01-20 22:01:23 +00:00
Eli Friedman d749c6bf2e Revert r148138; it's causing test failures.
llvm-svn: 148141
2012-01-13 21:33:06 +00:00
Sebastian Pop 9a8d528ddf rename -ccc-host-triple into -target
llvm-svn: 148138
2012-01-13 20:37:02 +00:00