summaryrefslogtreecommitdiffstats
path: root/test/Headers
Commit message (Collapse)AuthorAgeFilesLines
* support operator keywords used in Windows SDKErich Keane2017-06-093-0/+54
| | | | | | | | | | | | | | | | | | | | | to support operator keywords used in Windows SDK, alter token type when seen in system headers Hello, I submitted D33505 to address this problem, but the proposal was rejected as too big a hammer. This change will allow clang to parse the WindowsSDK header <query.h> which uses the operator name "or" as a field name. Treat cpp operator keywords as ordinary identifiers inside the Microsoft headers, but treat them as usual in the user's program. Original Submitter: Melanie Blower (mibintc) Differential Revision: https://reviews.llvm.org/D33782 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305087 91177308-0d34-0410-b5e6-96231b3b80d8
* Headers: Make the type of SIZE_MAX the same as size_tDuncan P. N. Exon Smith2017-04-271-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | size_t is usually defined as unsigned long, but on 64-bit platforms, stdint.h currently defines SIZE_MAX using "ull" (unsigned long long). Although this is the same width, it doesn't necessarily have the same alignment or calling convention. It also triggers printf warnings when using the format flag "%zu" to print SIZE_MAX. This changes SIZE_MAX to reuse the compiler-provided __SIZE_MAX__, and provides similar fixes for the other integers: - INTPTR_MIN - INTPTR_MAX - UINTPTR_MAX - PTRDIFF_MIN - PTRDIFF_MAX - INTMAX_MIN - INTMAX_MAX - UINTMAX_MAX - INTMAX_C() - UINTMAX_C() ... and fixes the typedefs for intptr_t and uintptr_t to use __INTPTR_TYPE__ and __UINTPTR_TYPE__ instead of int32_t, effectively reverting r89224, r89226, and r89237 (r89221 already having been effectively reverted). We can probably also kill __INTPTR_WIDTH__, __INTMAX_WIDTH__, and __UINTMAX_WIDTH__ in a follow-up, but I was hesitant to delete all the per-target CHECK lines in this commit since those might serve their own purpose. rdar://problem/11811377 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301593 91177308-0d34-0410-b5e6-96231b3b80d8
* Use __CLANG_ATOMIC_TYPE_LOCK_FREE macros in `stdatomic.h`Eric Fiselier2017-04-201-0/+1
| | | | | | | | | | | | | | Summary: This patch makes the header `stdatomic.h` work when `-fms-compatibility` is specified. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32322 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300919 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -faltivec alias option and replace it with -maltivec everywhere.Eric Christopher2017-03-212-4/+4
| | | | | | | | | | | The alias was only ever used on darwin and had some issues there, and isn't used in practice much. Also fixes a problem with -mno-altivec not turning off -maltivec. Also add a diagnostic for faltivec/fno-altivec that directs users to use maltivec options and include the altivec.h file explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298449 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix parsing of htmxlintrin.h in C++ modeEric Christopher2017-03-201-0/+19
| | | | | | | | - Fix a variable naming mismatch - Fix gcc extension pointer arithmetic on void to cast to char *. - Test that the header (and htmintrin.h) parse. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298318 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Add NumRegisterParameters Module Flag.Nirav Dave2017-03-181-1/+1
| | | | | | | | | | Reviewers: rnk, mkuper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27051 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298177 91177308-0d34-0410-b5e6-96231b3b80d8
* [Headers] Reapply: Add #include_next for tgmath.h on DarwinBruno Cardoso Lopes2017-03-163-0/+17
| | | | | | | | | | | | Reapply r289181 but rename the include guard to avoid conflict with the one from Darwin. Allow darwin to provide additional definitions and implementation specifc values for tgmath.h on Apple platforms. rdar://problem/19019845 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298013 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Correct ndrange_t implementationAnastasia Stulova2017-02-161-9/+9
| | | | | | | | | | | | | | | | Removed ndrange_t as Clang builtin type and added as a struct type in the OpenCL header. Use type name to do the Sema checking in enqueue_kernel and modify IR generation accordingly. Review: D28058 Patch by Dmitry Borisenkov! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295311 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Diagnose write_only image3d when extension is disabledAnastasia Stulova2017-01-251-6/+19
| | | | | | | | | | | | | | | | | Prior to OpenCL 2.0, image3d_t can only be used with the write_only access qualifier when the cl_khr_3d_image_writes extension is enabled, see e.g. OpenCL 1.1 s6.8b. Require the extension for write_only image3d_t types and guard uses of write_only image3d_t in the OpenCL header. Patch by Sven van Haastregt! Review: https://reviews.llvm.org/D28860 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293050 91177308-0d34-0410-b5e6-96231b3b80d8
* Guard __gnuc_va_list typedef.Paul Robinson2017-01-231-0/+10
| | | | | | | Differential Revision: http://reviews.llvm.org/D28620 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292819 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Headers] Add #include_next for tgmath.h on Darwin"Bruno Cardoso Lopes2016-12-122-16/+0
| | | | | | | | | Reverts r289181: it's currently breaking modules using simd.h in 10.12 SDK. This reverts commit 6e73e3464e96a4e00492c24aa790d36e1adb5702. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289487 91177308-0d34-0410-b5e6-96231b3b80d8
* [Headers] Add #include_next for tgmath.h on DarwinBruno Cardoso Lopes2016-12-092-0/+16
| | | | | | | | | Allow darwin to provide additional definitions and implementation specifc values for tgmath.h on Apple platforms. rdar://problem/19019845 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289181 91177308-0d34-0410-b5e6-96231b3b80d8
* [Headers] Enable #include_next<float.h> on DarwinBruno Cardoso Lopes2016-12-082-0/+19
| | | | | | | | | Allows darwin targets to provide additional definitions and implementation specifc values for float.h rdar://problem/21961491 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289018 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Remove redundant test for OpenCL header fileYaxun Liu2016-11-071-32/+3
| | | | | | | Differential Revision: https://reviews.llvm.org/D26302 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286114 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement __stosb intrinsic as a volatile memsetAlbert Gutowski2016-10-141-1/+0
| | | | | | | | | | | | Summary: We need `__stosb` to be an intrinsic, because SecureZeroMemory function uses it without including intrin.h. Implementing it as a volatile memset is not consistent with MSDN specification, but it gives us target-independent IR while keeping the most important properties of `__stosb`. Reviewers: rnk, hans, thakis, majnemer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25334 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284253 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some MS aliases for existing intrinsicsAlbert Gutowski2016-09-141-0/+11
| | | | | | | | | | | Reviewers: thakis, compnerd, majnemer, rsmith, rnk Subscribers: alexshap, cfe-commits Differential Revision: https://reviews.llvm.org/D24330 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281540 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MS __nop intrinsic to intrin.hReid Kleckner2016-09-071-0/+1
| | | | | | | | | | | | | | | Summary: There was no definition for __nop function - added inline assembly. Patch by Albert Gutowski! Reviewers: rnk, thakis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24286 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280826 91177308-0d34-0410-b5e6-96231b3b80d8
* Test case for r280607 to check presence and sanity of the *_LOCK_FREEJoerg Sonnenberger2016-09-041-0/+32
| | | | | | | macros. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280622 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows ↵Reid Kleckner2016-08-161-0/+1
| | | | | | | | platforms" This reverts commit r278783. It breaks usage of _xgetbv on Windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278814 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platformsMarina Yatsina2016-08-161-1/+0
| | | | | | | | | | commit on behalf of guyblank Differential Revision: https://reviews.llvm.org/D21959 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278783 91177308-0d34-0410-b5e6-96231b3b80d8
* Headers: Add ARM support to intrin.h for MSVC compatibilitySaleem Abdulrasool2016-08-061-0/+4
| | | | | | | | | | | | | | | | | This fixes compiling with headers from the Windows SDK for ARM, where the YieldProcessor function (in winnt.h) refers to _ARM_BARRIER_ISHST. The actual MSVC armintr.h contains a lot more definitions, but this is enough to build code that uses the Windows SDK but doesn't use ARM intrinsics directly. An alternative would to just keep the addition to intrin.h (to include armintr.h), but not actually ship armintr.h, instead having clang's intrin.h include armintr.h from MSVC's include directory. (That one works fine with clang, at least for building code that uses the Windows SDK.) Patch by Martin Storsjö! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277928 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempting to fix lit test test/Headers/opencl-c-header.cl on cygwin.Yaxun Liu2016-06-271-2/+2
| | | | | | "chmod u-x *" does not work for lit on cygwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273948 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/Headers/opencl-c-header.cl: Add explicit -triple x86_64-unknown ↵NAKAMURA Takumi2016-06-211-1/+1
| | | | | | | | | | to appease *-win32 targets. <stdin>:9:25: note: possible intended match here %call = tail call i8 @"\01?convert_char_rte@@$$J0YADD@Z"(i8 %x) #2 ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273230 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Include opencl-c.h by default as a clang moduleYaxun Liu2016-06-201-7/+64
| | | | | | | | | | Include opencl-c.h by default as a module to utilize the automatic AST caching mechanism of clang modules. Add an option -finclude-default-header to enable default header for OpenCL, which is off by default. Differential Revision: http://reviews.llvm.org/D20444 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273191 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] _MM_ALIGN16 attribute support for non-windows targetsZvi Rackover2016-06-181-0/+3
| | | | | | | | | | | | | | | | | Summary: This patch adds support for the _MM_ALIGN16 attribute on non-windows targets. This aligns Clang with ICC which supports the attribute on all targets. Fixes PR28056 Reviewers: aaboud, echristo, cfe-commits, mkuper Subscribers: zvi, mehdi_amini Projects: #clang-c Differential Revision: http://reviews.llvm.org/D21173 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273095 91177308-0d34-0410-b5e6-96231b3b80d8
* s/Intrin.h/intrin.h/, trying to fix the build after r272701Hans Wennborg2016-06-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272702 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Remove tests without triple from test/Headers/opencl-c-header.cl.Yaxun Liu2016-05-301-4/+0
| | | | | | | This test requires triples with Itanium C++ ABI whereas triples with MSVC environment uses Microsoft C++ ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271198 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add the default header file opencl-c.h for OpenCL C languageYaxun Liu2016-05-301-0/+37
| | | | | | | | | | | | OpenCL has large number of "builtin" functions ("builtin" in the sense of OpenCL spec) which are defined in header files. To compile OpenCL kernels using these builtin functions, a header file is needed. This header file is based on the Khronos implementation (https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl.h) with heavy refactoring. Re-commit after fixing failures on ppc64/systemz etc. Differential Revision: http://reviews.llvm.org/D18369 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271197 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r271136 [OpenCL] Add the default header file opencl-c.h for OpenCL C ↵Yaxun Liu2016-05-281-9/+0
| | | | | | language due to build failure on ppc64/hexagon/systemz. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271144 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add the default header file opencl-c.h for OpenCL C languageYaxun Liu2016-05-281-0/+9
| | | | | | | | | | OpenCL has large number of "builtin" functions ("builtin" in the sense of OpenCL spec) which are defined in header files. To compile OpenCL kernels using these builtin functions, a header file is needed. This header file is based on the Khronos implementation (https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl.h) with heavy refactoring. Differential Revision: http://reviews.llvm.org/D18369 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271136 91177308-0d34-0410-b5e6-96231b3b80d8
* [AVX512] _m512_setzero_qi/hi should return __m512i.Craig Topper2016-05-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269733 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Don't expose *intrin.h headers that cannot be included standalone asRichard Smith2016-04-161-0/+1
| | | | | | | separate modules. These cause build breakage with -fmodules-local-submodule-visibility. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266501 91177308-0d34-0410-b5e6-96231b3b80d8
* D18325: Added mm_malloc module export.John Thompson2016-03-221-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264092 91177308-0d34-0410-b5e6-96231b3b80d8
* test/Headers/float.c: fix theoretical edge valuesHubert Tong2016-02-121-11/+11
| | | | | | | | | | | For *_MANT_DIG, *_MAX_EXP and *_MIN_EXP, the C Standard does not list the least requirements directly. This patch adjusts the test values with refined ones. Patch by Jorge Teixeira! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260710 91177308-0d34-0410-b5e6-96231b3b80d8
* <float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added ↵Richard Smith2016-02-121-6/+20
| | | | | | | | | in C99. Patch by Jorge Teixeira! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260639 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove bogus check that larger floating point types have smaller minimumRichard Smith2016-02-111-8/+0
| | | | | | | normalized exponents. That's not true for double versus double double. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260610 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL this test for PPC64 for now. It looks like the *_MIN_EXP macros are in ↵Richard Smith2016-02-111-0/+2
| | | | | | fact defined incorrectly for that target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260583 91177308-0d34-0410-b5e6-96231b3b80d8
* In C11, provide macros FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, and ↵Richard Smith2016-02-111-0/+211
| | | | | | | | | LDBL_DECIMAL_DIG in <float.h>. Patch by Jorge Teixeira! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260577 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ms-intrin.cpp test require the x86 target.Nico Weber2015-09-231-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248355 91177308-0d34-0410-b5e6-96231b3b80d8
* Add bug number to FIXME comment.Nico Weber2015-09-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248235 91177308-0d34-0410-b5e6-96231b3b80d8
* ms Intrin.h: Fix __movsw's and __stosw's inline asm.Nico Weber2015-09-221-2/+34
| | | | | | | | | | | | Before, clang's internal assembler would reject the inline asm in clang's Intrin.h. To make sure this doesn't happen for other Intrin.h functions using __asm__ blocks, add 32-bit and 64-bit codegen tests for Intrin.h. Sadly, these tests discovered that __readcr3 and __writecr3 have bad implementations in 64-bit builds. This will have to be fixed in a follow-up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248234 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-081-1/+1
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241653 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-071-1/+1
| | | | | | failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241642 91177308-0d34-0410-b5e6-96231b3b80d8
* Update testcases that use precompiled headers to require a target afterAdrian Prantl2015-07-071-1/+1
| | | | | | r241620. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241623 91177308-0d34-0410-b5e6-96231b3b80d8
* Move xtest to its own file to match the gcc header organization.Eric Christopher2015-06-171-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239926 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang/test/Headers/x86intrin-2.c. _readfsbase_u32() is provided in not ↵NAKAMURA Takumi2015-06-171-0/+2
| | | | | | i686 but x86-64. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239896 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the intel intrinsic headers to use the target attribute support.Eric Christopher2015-06-173-120/+144
| | | | | | | | | | | | | | | | | | | This involved removing the conditional inclusion and replacing them with target attributes matching the original conditional inclusion and checks. The testcase update removes the macro checks for each file and replaces them with usage of the __target__ attribute, e.g.: int __attribute__((__target__(("sse3")))) foo(int a) { _mm_mwait(0, 0); return 4; } This usage does require the enclosing function have the requisite __target__ attribute for inlining and code generation - also for any macro intrinsic uses in the enclosing function. There's no change for existing uses of the intrinsic headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239883 91177308-0d34-0410-b5e6-96231b3b80d8
* Commit some test changes somehow missed in r239789.Richard Smith2015-06-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239791 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] This revision adds 68 of the missing "Predefined Functions for ↵Bill Seurer2015-06-041-2/+2
| | | | | | | | | | | | | | Vector Programming" from appendix A of the OpenPOWER ABI for Linux Supplement document. I also added tests for the new functions and updated another test that was looking for specific line numbers in error messages from altivec.h. https://llvm.org/bugs/show_bug.cgi?id=23679 http://reviews.llvm.org/D10131 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239066 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch adds support for the vector quadword add/sub instructions introducedKit Barton2015-05-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | in POWER8. These are the Clang-related changes for http://reviews.llvm.org/D9081 vadduqm vaddeuqm vaddcuq vaddecuq vsubuqm vsubeuqm vsubcuq vsubecuq All builtins are added in altivec.h, and guarded with the POWER8_VECTOR and powerpc64 macros. http://reviews.llvm.org/D9903 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238145 91177308-0d34-0410-b5e6-96231b3b80d8