summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper2015-11-1863-278/+278
| | | | | | | | | | | | | | | | | | | | | | This is a follow on from a similar LLVM commit: r253511. Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. The only code change to clang is hidden in CGBuilder.h which now passes both dest and source alignment to IRBuilder, instead of taking the minimum of dest and source alignments. Reviewed by Hal Finkel. llvm-svn: 253512
* [MSVC Compat] Make -Wmicrosoft-cast not an error by defaultDavid Majnemer2015-11-181-1/+1
| | | | | | Too much code is sloppy about this to error by default. llvm-svn: 253506
* [PGO] Test update for revision 253484.Betul Buyukkurt2015-11-181-1/+1
| | | | llvm-svn: 253485
* [Myriad]: fix test for WindowsDouglas Katzman2015-11-181-4/+4
| | | | llvm-svn: 253476
* [ARM] Support +feature targeting in -mcpu/-marchBradley Smith2015-11-181-0/+13
| | | | llvm-svn: 253471
* [Myriad]: insert -L paths into linker cmd only when they exist.Douglas Katzman2015-11-184-0/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D14754 llvm-svn: 253467
* Fix tests in order for them to not fail after r252604.Igor Laevsky2015-11-181-2/+2
| | | | | | | | Some expected attributes appear to be incorrect after optimizations are run and llvm will strip them. Use -O0 so that llvm will not have a chance to remove them. llvm-svn: 253458
* [NFC] Change the evaluation context of a non-type default template argument ↵Faisal Vali2015-11-181-0/+14
| | | | | | | | | | | | | | | | from Unevaluated to ConstantEvaluated. This patch emits a more appropriate (but still noisy) diagnostic stream when a lambda-expression is encountered within a non-type default argument. For e.g. template<int N = ([] { return 5; }())> int f(); As opposed to complaining that a lambda expression is not allowed in an unevaluated operand, the patch complains about the lambda being forbidden in a constant expression context (which will be allowed in C++17 now that they have been accepted by EWG, unless of course CWG or national bodies (that have so far shown no signs of concern) rise in protest) As I start submitting patches for constexpr lambdas (http://wg21.link/P0170R0) under C++1z (OK'd by Richard Smith at Kona), this will be one less change to make. Thanks! llvm-svn: 253431
* Produce a better diagnostic for global register variables.Akira Hatanaka2015-11-189-22/+53
| | | | | | | | | | | | | | | | | | Currently, when there is a global register variable in a program that is bound to an invalid register, clang/llvm prints an error message that is not very user-friendly. This commit improves the diagnostic and moves the check that used to be in the backend to Sema. In addition, it makes changes to error out if the size of the register doesn't match the declared variable size. e.g., volatile register int B asm ("rbp"); rdar://problem/23084219 Differential Revision: http://reviews.llvm.org/D13834 llvm-svn: 253405
* [modules] When a #include is mapped to a module import and appears somewhereRichard Smith2015-11-171-1/+13
| | | | | | | | | | | | | | other than the top level, we issue an error. This breaks a fair amount of C++ code wrapping C libraries, where the C library is #included within a namespace / extern "C" combination, because the C library (probably) includes C++ standard library headers which may be within modules. Without modules, this setup is harmless if (and *only* if) the corresponding standard library module was already included outside the namespace, so downgrade the error to a default-error extension in that case, so that it can be selectively disabled for such misbehaving libraries. llvm-svn: 253398
* [Myriad]: -nostdlib implies -nostartfilesDouglas Katzman2015-11-171-0/+1
| | | | llvm-svn: 253390
* [CUDA] Make CUDA compilation usable by default.Artem Belevich2015-11-171-3/+8
| | | | | | | | | | | | | | | | | | Currently clang requires several additional command line options in order to enable new features needed during CUDA compilation. This patch makes these options default. * Automatically include cuda_runtime.h if we've found a valid CUDA installation. * Disable automatic CUDA header inclusion during unit tests. * Added test case for command line construction. * Enabled target overloads and relaxed call checks that are needed in order to include CUDA headers. * Added CUDA-7.5 installation path to the CUDA installation search list. * Define __CUDA__ macro to indicate CUDA compilation. llvm-svn: 253389
* [CUDA] Detect and link with CUDA's libdevice bitcode library.Artem Belevich2015-11-173-4/+29
| | | | | | | | | | | - added detection of libdevice bitcode file and API to find one appropriate for the GPU we're compiling for. - pass additional cc1 options for linking with detected libdevice bitcode - added -nocudalib to prevent automatic linking with libdevice - added test cases to verify new functionality Differential Revision: http://reviews.llvm.org/D14556 llvm-svn: 253387
* [CUDA] added include paths for both sides of CUDA compilation.Artem Belevich2015-11-171-1/+25
| | | | | | | | | | | | | | | | | | | | | In order to compile a CUDA file clang must be able to find include files for both both host and device. This patch passes AuxToolchain to AddPreprocessingOptions and uses it to add include paths for the opposite side of compilation. We also must be able to find CUDA include files. If the driver found CUDA installation, it adds appropriate include path to CUDA headers. This can be disabled with '-nocudainc'. - Added include paths for the opposite side of compilation. - Added include paths to detected CUDA installation. - Added -nocudainc to prevent adding CUDA include path. - Added test cases to verify new functionality. Differential Revision: http://reviews.llvm.org/D13170 llvm-svn: 253386
* [CUDA] use -aux-triple to pass target triple of opposite side of compilationArtem Belevich2015-11-172-18/+23
| | | | | | | | | | | | | | | | Clang needs to know target triple for both sides of compilation so that preprocessor macros and target builtins from both sides are available. This change augments Compilation class to carry information about toolchains used during different CUDA compilation passes and refactors BuildActions to use it when it constructs CUDA jobs. Removed DeviceTriple from CudaHostAction/CudaDeviceAction as it's no longer needed. Differential Revision: http://reviews.llvm.org/D13144 llvm-svn: 253385
* Use !hasArg with two options instead of !hasArg && !hasArg.Douglas Katzman2015-11-171-0/+7
| | | | | | Thereby fixing a warning about failure to claim all args. llvm-svn: 253372
* [Lit Test] Updated 34 Lit tests to be C++11 compatible.Charles Li2015-11-1734-26/+260
| | | | | | | Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 253371
* ARM: fix mismatch between Clang and backend on exception type.Tim Northover2015-11-171-1/+9
| | | | | | | | | | | | "-arch armv7k" is only normally used with a watchos target, but Clang doesn't stop you from giving a "-miphoneos-version-min" option too, converting the triple to "thumbv7k-apple-ios". In this case the backend will decide to use SjLj exceptions, so Clang needs to agree so it can create the correct predefines. Fortunately, there's a handy function to make the decision for us now. llvm-svn: 253355
* Revert "Make FP_CONTRACT ON the default."Manuel Klimek2015-11-174-191/+13
| | | | | | | | | This reverts commit r253269. This leads to assert / segfault triggering on the following reduced example: float foo(float U, float base, float cell) { return (U = 2 * base) - cell; } llvm-svn: 253337
* [modules] Fix some more cases where we used to reject a conflict between twoRichard Smith2015-11-172-0/+31
| | | | | | | declarations that are not simultaneously visible, and where at least one of them has internal/no linkage. llvm-svn: 253283
* Make FP_CONTRACT ON the default.Stephen Canon2015-11-164-13/+191
| | | | | | Differential Revision: D14200 llvm-svn: 253269
* Correctly handle type mismatches in the __weak copy/move-initializationJohn McCall2015-11-162-0/+54
| | | | | | | | peephole I added in r250916. rdar://23559789 llvm-svn: 253255
* When producing error messages for always_inline functions with theEric Christopher2015-11-161-0/+9
| | | | | | | | | | target attribute, don't include "negative" subtarget features in the list of required features. Builtins are positive by default so don't need this change, but we pull the default list of features from the command line and so need to make sure that we only include features that are turned on for code generation in our error. llvm-svn: 253242
* [mips] Do not add arch name in the compiler-rt's components.Vasileios Kalintiris2015-11-161-1/+1
| | | | | | | Instead, use the constant "mips" since the libraries are already placed under the multilib's OS suffix. llvm-svn: 253214
* [Myriad]: pass the 'std=' option to moviCompileDouglas Katzman2015-11-161-0/+4
| | | | llvm-svn: 253213
* [ARM,AArch64] Fix __rev16l and __rev16ll intrinsicsOliver Stannard2015-11-161-10/+36
| | | | | | | | | | | | | | | | | | | | These two intrinsics are defined in arm_acle.h. __rev16l needs to rotate by 16 bits, bit it was actually rotating by 2 bits. For AArch64, where long is 64 bits, this would still be wrong. __rev16ll was incorrect, it reversed the bytes in each 32-bit word, rather than each 16-bit halfword. The correct implementation is to apply __rev16 to the top and bottom words of the 64-bit value. For AArch32 targets, these get compiled down to the hardware rev16 instruction at -O1 and above. For AArch64 targets, the 64-bit ones get compiled to two 32-bit rev16 instructions, because there is not currently a pattern for the 64-bit rev16 instruction. Differential Revision: http://reviews.llvm.org/D14609 llvm-svn: 253211
* Handle ARMv6KZ namingArtyom Skrobov2015-11-162-5/+8
| | | | | | | | | | | | Summary: Update for clang tests for D14568 Reviewers: rengolin, joerg, bogden Subscribers: aemerson, rengolin, cfe-commits Differential Revision: http://reviews.llvm.org/D14570 llvm-svn: 253207
* clang-format: Enable #include sorting by default.Daniel Jasper2015-11-161-0/+10
| | | | | | | | | This has seen quite some usage and I am not aware of any issues. Also add a style option to enable/disable include sorting. The existing command line flag can from now on be used to override whatever is set in the style. llvm-svn: 253202
* Update for the gnu flavor being renamed to old-gnu.Rafael Espindola2015-11-163-7/+7
| | | | llvm-svn: 253191
* [CGDebugInfo] Set the size and align for reference typesKeno Fischer2015-11-161-1/+1
| | | | | | | | | | In r253186, I changed the DIBuilder API to now take size and align for reference types as well. This was done in preparation for upcoming changes to the Verifier that will validate that sizes match between DI types and IR values that are declared as having those types. This updates clang to actually pass the information through. llvm-svn: 253190
* [Sema] Implement several unary type traits more accuratelyDavid Majnemer2015-11-163-13/+30
| | | | | | | | | | | | | | is_empty, is_polymorphic, and is_abstract didn't handle incomplete types correctly. Only non-union class types must be complete for these traits. is_final and is_sealed don't care about the particular spelling of the FinalAttr. is_interface_class should always return false regardless of its input. The type trait can only be satisfied in a mode we do not support (/CLR). llvm-svn: 253184
* [analyzer] Handle calling ObjC super method from inside C++ lambda.Devin Coughlin2015-11-151-0/+46
| | | | | | | | | | When calling a ObjC method on super from inside a C++ lambda, look at the captures to find "self". This mirrors how the analyzer handles calling super in an ObjC block and fixes an assertion failure. rdar://problem/23550077 llvm-svn: 253176
* [X86][MMX] Added MMX IR + assembly codegen builtin tests for some missing ↵Simon Pilgrim2015-11-151-14/+81
| | | | | | cvt intrinsics llvm-svn: 253169
* [libclang] Visit TypeAliasTemplateDeclSergey Kalinichev2015-11-152-1/+8
| | | | | | | | This makes TypeAliasTemplateDecl accessible via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13844 llvm-svn: 253166
* [libclang] Expose AutoTypeSergey Kalinichev2015-11-151-5/+5
| | | | | | | | Expose the AutoType via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13000 llvm-svn: 253165
* Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.Yaron Keren2015-11-151-4/+0
| | | | | | Post-commit suggestion by Filipe Cabecinhas. llvm-svn: 253161
* [analyzer] Refer to capture field to determine if capture is reference.Devin Coughlin2015-11-151-0/+72
| | | | | | | | | | | | | The analyzer incorrectly treats captures as references if either the original captured variable is a reference or the variable is captured by reference. This causes the analyzer to crash when capturing a reference type by copy (PR24914). Fix this by refering solely to the capture field to determine when a DeclRefExpr for a lambda capture should be treated as a reference type. https://llvm.org/bugs/show_bug.cgi?id=24914 rdar://problem/23524412 llvm-svn: 253157
* [Sema] Don't crash trying to diagnose abs called on a pointer typeDavid Majnemer2015-11-151-2/+18
| | | | | | | | | | | | | | | | | Clang tries to figure out if a call to abs is suspicious by looking through implicit casts to look at the underlying, implicitly converted type. Interestingly, C has implicit conversions from pointer-ish types like function to less exciting types like int. This trips up our 'abs' checker because it doesn't know which variant of 'abs' is appropriate. Instead, diagnose 'abs' called on function types upfront. This sort of thing is highly suspicious and is likely indicative of a missing pointer dereference/function call/array index operation. This fixes PR25532. llvm-svn: 253156
* [X86][MMX] Sorted MMX IR + assembly codegen builtin testsSimon Pilgrim2015-11-141-367/+374
| | | | | | Makes it easier to track what tests are missing.... llvm-svn: 253131
* [X86][MMX] Added MMX IR + assembly codegen builtin testsSimon Pilgrim2015-11-141-196/+358
| | | | | | Improved tests as discussed in PR24580 llvm-svn: 253130
* [modules] Allow "redefinition" of typedef of anon tag from unimported submoduleBen Langmuir2015-11-145-1/+18
| | | | | | | | | r233345 started being stricter about typedef names for linkage purposes in non-visible modules, but broke languages without the ODR. rdar://23527954 llvm-svn: 253123
* Add support for the always_inline + target feature diagnostic to printEric Christopher2015-11-142-2/+2
| | | | | | | out the first missing target feature that's required and reword the diagnostic accordingly. llvm-svn: 253121
* Use %select to merge similar diagnostics. NFCCraig Topper2015-11-142-4/+3
| | | | llvm-svn: 253119
* Make some tests LLVM-optimization agnostic and remove some others that were ↵David Blaikie2015-11-145-146/+16
| | | | | | | | | | | | | | | | beyond value/repair Several of these tests (the two deleted, and the one removal edit) were relying on the optimizer to collapse things to test some frontend feature. The tests were really old and features seemed amply covered by other parts of the test suite, so I just removed them. If anyone thinks they're valuable enough to keep/fix, we can play around with that, for sure. (inspired by r252872) llvm-svn: 253114
* CFG: Delay creating Dtors for CompoundStmts which end in ReturnStmtMatthias Gehre2015-11-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: VisitReturnStmt would create a new block with including Dtors, so the Dtors created in VisitCompoundStmts would be in an unreachable block. Example: struct S { ~S(); }; void f() { S s; return; } void g() { S s; } Before this patch, f has one additional unreachable block containing just the destructor of S. With this patch, both f and g have the same blocks. Reviewers: krememek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13973 llvm-svn: 253107
* Revert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."Justin Bogner2015-11-131-5/+0
| | | | | | | | | This reverts r243310, which is redundant as of r253102. Conflicts: lib/Driver/Tools.cpp llvm-svn: 253104
* Relax mingw-useld test to fix bot failures.Yaron Keren2015-11-131-3/+3
| | | | llvm-svn: 253069
* Add test case for mingw -fuse-ld= support introduced in r242121.Yaron Keren2015-11-131-0/+20
| | | | llvm-svn: 253066
* Fix auto-link for text-based dynamic library SDKs.Juergen Ributzka2015-11-133-0/+19
| | | | | | | | | | When linking against text-based dynamic library SDKs the library name of a framework has now more than one possible filename extensions. This fix tests for both possible extensions (none, and .tbd). This fixes rdar://problem/20609975 llvm-svn: 253060
* Slacken the norecurse test slightlyJames Molloy2015-11-131-1/+1
| | | | | | | | It has been reported that this test currently fails on some Power buildbots due to them adding a "signext" function attribute. As that's not what we're checking here, slacken off the test a bit. llvm-svn: 253055
OpenPOWER on IntegriCloud