summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [Sema] __is_constructible should return false for function typesDavid Majnemer2015-11-131-0/+3
| | | | | | | | While functions types are complete, they cannot be constructed. This fixes PR25513. llvm-svn: 253013
* [modules] When a declaration has non-trivial visibility, check whether it'sRichard Smith2015-11-131-0/+7
| | | | | | | actually hidden before we check its linkage. This avoids computing the linkage "too early" for an anonymous struct with a typedef name for linkage. llvm-svn: 253012
* clang/test/Driver/mips-mti-linux.c: Tweak to match DOSish paths.NAKAMURA Takumi2015-11-131-4/+2
| | | | llvm-svn: 253011
* [modules] Follow the C++ standard's rule for linkage of enumerators: they haveRichard Smith2015-11-134-6/+9
| | | | | | | | | the linkage of the enumeration. For enumerators of unnamed enumerations, extend the -Wmodules-ambiguous-internal-linkage extension to allow selecting an arbitrary enumerator (but only if they all have the same value, otherwise it's ambiguous). llvm-svn: 253010
* Add support for function attribute 'disable_tail_calls'.Akira Hatanaka2015-11-134-5/+69
| | | | | | | | | | | | | | | | | | | | | | The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. For example, int callee(int); int foo(int a) __attribute__((disable_tail_calls)) { return callee(a); // This call is not tail-call optimized. } Note that this attribute is different from 'not_tail_called', which prevents tail-call optimization to the marked function. rdar://problem/8973573 Differential Revision: http://reviews.llvm.org/D12547 llvm-svn: 252986
* clang/test/Driver/mips-mti-linux.c: Remove XFAIL. It shouldn't fail for ↵NAKAMURA Takumi2015-11-121-1/+1
| | | | | | | | targeting win32. I will remove REQUIRES later. llvm-svn: 252972
* Remove -Wobjc-weak-compat; there isn't a compelling use case for this.John McCall2015-11-121-2/+2
| | | | llvm-svn: 252971
* Avoid duplicated diagnostic when lookup for a nested-name-specifier fails ↵Richard Smith2015-11-122-3/+2
| | | | | | due to ambiguity. llvm-svn: 252967
* Mark clang/test/Driver/ms-bitfields.c as REQUIRES:clang-driver.NAKAMURA Takumi2015-11-121-0/+2
| | | | llvm-svn: 252961
* [modules] Simplify and generalize the existing rule for finding hiddenRichard Smith2015-11-1211-23/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | declarations in redeclaration lookup. A declaration is now visible to lookup if: * It is visible (not in a module, or in an imported module), or * We're doing redeclaration lookup and it's externally-visible, or * We're doing typo correction and looking for unimported decls. We now support multiple modules having different internal-linkage or no-linkage definitions of the same name for all entities, not just for functions, variables, and some typedefs. As previously, if multiple such entities are visible, any attempt to use them will result in an ambiguity error. This patch fixes the linkage calculation for a number of entities where we previously didn't need to get it right (using-declarations, namespace aliases, and so on). It also classifies enumerators as always having no linkage, which is a slight deviation from the C++ standard's definition, but not an observable change outside modules (this change is being discussed on the -core reflector currently). This also removes the prior special case for tag lookup, which made some cases of this work, but also led to bizarre, bogus "must use 'struct' to refer to type 'Foo' in this scope" diagnostics in C++. llvm-svn: 252960
* DR407: Rationalize how we handle tags being hidden by typedefs. Even withRichard Smith2015-11-121-9/+9
| | | | | | | | | | | | | | | | | | DR407, the C++ standard doesn't really say how this should work. Here's what we do (which is consistent with DR407 as far as I can tell): * When performing name lookup for an elaborated-type-specifier, a tag declaration hides a typedef declaration that names the same type. * When performing any other kind of lookup, a typedef declaration hides a tag declaration that names the same type. In any other case where lookup finds both a typedef and a tag (that is, when they name different types), the lookup will be ambiguous. If lookup finds a tag and a typedef that name the same type, and finds anything else, the lookup will always be ambiguous (even if the other entity would hide the tag, it does not also hide the typedef). llvm-svn: 252959
* Revert r240335.Richard Smith2015-11-122-3/+6
| | | | | | | | | | | | | | | This failed to solve the problem it was aimed at, and introduced just as many issues as it resolved. Realistically, we need to deal with the possibility that multiple modules might define different internal linkage symbols with the same name, and this isn't a problem unless two such symbols are simultaneously visible. The case where two modules define equivalent internal linkage symbols is handled by r252063: if lookup finds multiple sufficiently-similar entities from different modules, we just pick one of them as an extension (but we keep them separate). llvm-svn: 252957
OpenPOWER on IntegriCloud