summaryrefslogtreecommitdiffstats
path: root/clang/test/Headers
Commit message (Collapse)AuthorAgeFilesLines
...
* Let stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}.Nico Weber2014-04-301-0/+69
| | | | | | | | | | | | | | | | 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
* Revert r207482; I fail at reading IRC.Nico Weber2014-04-291-20/+0
| | | | llvm-svn: 207483
* Let stddef.h redefine NULL if __need_NULL is set, as needed by glibc, PR12997.Nico Weber2014-04-291-0/+20
| | | | | | | | | 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
* Move ObjC Cocoa.h header test to HeadersAlp Toker2014-04-191-0/+5
| | | | | | | 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
* Re-enable the C++11 modules integration test on OS XAlp Toker2014-04-191-2/+2
| | | | | | | | | | XCode 5.1.1 has shipped with fixed SDK headers. This reverts commit r200256. Fixes PR18322. llvm-svn: 206686
* MS intrinsics: don't declare __readeflags and __writeeflags in Intrin.hHans Wennborg2014-03-121-0/+5
| | | | | | | | 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
* Add -fmodules-cache-path to test/Headers/c11.cBen Langmuir2014-03-101-1/+2
| | | | | | | | 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
* Update for llvm change.Rafael Espindola2014-03-051-2/+5
| | | | llvm-svn: 203000
* Headers: Provide an ABI compatible max_align_t when _MSC_VER is definedDavid Majnemer2014-03-041-0/+5
| | | | | | | | | | | | | | | | 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
* Revert r201734 and r201742.Daniel Jasper2014-02-201-16/+0
| | | | | | | | | | | | | | | | | | | | | 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
* Revert r201772 as it breaks things on WindowsTimur Iskhodzhanov2014-02-201-1/+1
| | | | | | We should probably use different argument types on different platforms? llvm-svn: 201774
* Change parameter type of _mm_prefetch to "const void *".Daniel Jasper2014-02-201-1/+1
| | | | | | | Otherwise, this is not backwards compatible to the existing macro and can break existing code. llvm-svn: 201772
* Don't actually emit output in test/Headers/mmprefetch.c.Daniel Jasper2014-02-201-1/+1
| | | | | | The test directory cannot assumed to be writable. llvm-svn: 201768
* Add _mm_prefetch and some others as MS builtinsWarren Hunt2014-02-191-0/+16
| | | | | | | | | | | | | 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
* Teach Clang to provide ::max_align_t in C11 and C++11 modes.Chandler Carruth2014-02-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | 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
* Intrin.h: include setjmp.h to get a jmp_buf definitionHans Wennborg2014-01-282-1/+10
| | | | | | | This makes sure that the ms-intrin.cpp test passes by providing a mock setjmp.h as a test input. llvm-svn: 200344
* Temporarily disable test that fails on Mac OS X 10.9.Bob Wilson2014-01-271-1/+1
| | | | | | | 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
* Add a proper test for -Wsystem-headersAlp Toker2014-01-251-0/+33
| | | | | | This will be extended as we fix issues in the current implementation. llvm-svn: 200054
* ms-intrin.cpp: add -Werror to the testHans Wennborg2014-01-171-1/+1
| | | | llvm-svn: 199450
* ms-intrin.cpp: no need for -verify anymoreHans Wennborg2014-01-171-1/+1
| | | | llvm-svn: 199442
* Relax the ms-intrin.cpp testHans Wennborg2014-01-161-11/+0
| | | | | | | | 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
* Forbid driver use in Sema testsAlp Toker2014-01-161-0/+4
| | | | | | | | 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
* Add a FIXME to a failing test.Nico Weber2013-12-241-0/+2
| | | | | | (See discussion in the bug for why this isn't XFAILed.) llvm-svn: 197991
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | '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
* clang/test: REQUIRES: s/ppc{32|64}-registered-target/powerpc-registered-target/NAKAMURA Takumi2013-12-041-1/+1
| | | | llvm-svn: 196349
* Define [U]LLONG_{MIN,MAX} for C++11, add tests.JF Bastien2013-10-271-0/+42
| | | | | | Add tests for limits.h, not just [U]LLONG_{MIN,MAX}. llvm-svn: 193506
* Add implementations of the MSVC barrier intrinsicsReid Kleckner2013-10-171-1/+12
| | | | | | | | | | | | | | | | 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
* Switch tests in test/Headers to use %clang_cc1 rather than %clang. ThereChandler Carruth2013-09-208-14/+16
| | | | | | | | 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
* Use -ffreestanding in ms-intrin.cpp and define size_t manually.Reid Kleckner2013-09-191-5/+5
| | | | llvm-svn: 190985
* Avoid including <stdlib.h> in the intrin.h testReid Kleckner2013-09-191-0/+5
| | | | llvm-svn: 190979
* Fix ifdef ordering at the end of Intrin.h from r190965Reid Kleckner2013-09-191-0/+6
| | | | | | Test that intrin.h at least parses in C++ TUs. llvm-svn: 190978
* Add missing definitions to unwind.h.Peter Collingbourne2013-08-281-0/+1
| | | | | | Original patch by Charles Davis. llvm-svn: 189535
* CC1: Only parse command-line options that have the CC1Option flag.Hans Wennborg2013-08-021-3/+3
| | | | | | | | | | | | | 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
* Enable -ffreestanding for this test, to avoid #include_next'ing the system'sRichard Smith2013-07-031-2/+2
| | | | | | <stdint.h> (which might not exist or might not work). llvm-svn: 185565
* Remove dependence on system headers from this test, to try to make the ↵Richard Smith2013-05-093-5/+6
| | | | | | Windows bots happier. llvm-svn: 181558
* Add testcase missed from r181527.Richard Smith2013-05-091-0/+41
| | | | llvm-svn: 181531
* xopintrin.h: Add wrappers for all flavors of _mm_com.Benjamin Kramer2013-05-091-0/+91
| | | | | | | GCC defines only the wrappers, MSVC defines both, we define both now too. PR15844. llvm-svn: 181514
* Make sure we define wchar_t related macros correctly in -fms-extensions mode.Hans Wennborg2013-05-021-0/+15
| | | | | | | | 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
* [tests] Only include stdint.h if we are in freestanding mode.Daniel Dunbar2013-04-171-1/+1
| | | | | | | - 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
* Headers: Don't try to use RSIZE_MAX unless we are freestanding.Daniel Dunbar2013-04-121-1/+9
| | | | | | - We don't want to depend on the platforms stdint.h. llvm-svn: 179429
* Headers: Add support for ISO9899:2011 rsize_t.Daniel Dunbar2013-04-121-0/+5
| | | | llvm-svn: 179427
* tl;dr: Teach Clang to work around g++ changing its workaround to glibc'sRichard Smith2013-04-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't build this test with modules for now, it's causing buildbot failures.Richard Smith2013-04-041-1/+0
| | | | llvm-svn: 178740
* Add tests that build modules for our builtin headers, and fix two buglets ↵Richard Smith2013-04-043-0/+3
| | | | | | exposed by doing so. llvm-svn: 178736
* libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard againstRichard Smith2013-02-211-0/+14
| | | | | | | | | 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
* Reinstate r173952, this time limiting it to exactly the formDouglas Gregor2013-01-301-0/+5
| | | | | | | | #define X X for which there is no point warning, ever. llvm-svn: 173991
* Revert "[preprocessor] Don't warn about "disabled expansion of recursive macro""Argyrios Kyrtzidis2013-01-301-5/+0
| | | | | | This reverts commit r173952 llvm-svn: 173970
* [preprocessor] Don't warn about "disabled expansion of recursive macro"Argyrios Kyrtzidis2013-01-301-0/+5
| | | | | | | | | for "#define X X". This is a pattern that, for example, stdbool.h uses. rdar://12435773 llvm-svn: 173952
* C11: Provide the missing half of <stdalign.h>Richard Smith2013-01-301-0/+6
| | | | llvm-svn: 173900
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-171-0/+12
| | | | llvm-svn: 172761
OpenPOWER on IntegriCloud