summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [Diagnostics] Handle tautological left shifts in boolean context David Bolvansky2019-09-241-7/+12
| | | | llvm-svn: 372749
* [NFC] Update test after r372708David Bolvansky2019-09-241-1/+1
| | | | llvm-svn: 372709
* [Diagnostics] Do not diagnose unsigned shifts in boolean context ↵David Bolvansky2019-09-241-4/+16
| | | | | | | | (-Wint-in-bool-context) I was looking at old GCC's patch. Current "trunk" version avoids warning for unsigned case, GCC warns only for signed shifts. llvm-svn: 372708
* Revert "[static analyzer] Define __clang_analyzer__ macro in driver"Jan Korous2019-09-242-5/+4
| | | | | | This reverts commit fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187. llvm-svn: 372687
* Revert "[static analyzer][test] Test directly that driver sets ↵Jan Korous2019-09-241-2/+5
| | | | | | | | D__clang_analyzer__" This reverts commit c7541903d72765a38808e9973572a8d50c9d94fb. llvm-svn: 372685
* [static analyzer][test] Test directly that driver sets D__clang_analyzer__Jan Korous2019-09-241-5/+2
| | | | | | Follow-up to fbd13570b0d llvm-svn: 372683
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-241-1/+2
| | | | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 Reapplies r372663 after adapting a failing test in the LLDB testsuite. llvm-svn: 372681
* [static analyzer] Define __clang_analyzer__ macro in driverJan Korous2019-09-242-4/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D67938 llvm-svn: 372679
* Revert "Support for DWARF-5 C++ language tags."Jonas Devlieghere2019-09-231-2/+1
| | | | | | This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007. llvm-svn: 372672
* [Diagnostics] Warn for enum constants in bool context ↵David Bolvansky2019-09-231-1/+27
| | | | | | | | (-Wint-in-bool-context; GCC compatibility) Extracted from D63082. llvm-svn: 372664
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-231-1/+2
| | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 llvm-svn: 372663
* [Sema] Fix the atomic expr rebuilding order.Michael Liao2019-09-231-1/+42
| | | | | | | | | | | | | | | | Summary: - Rearrange the atomic expr order to the API order when rebuilding atomic expr during template instantiation. Reviewers: erichkeane Subscribers: jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67924 llvm-svn: 372640
* NFC: Fix a poorly-written testErik Pilkington2019-09-231-7/+7
| | | | | | The author of r364954 foolishly forgot that == binds tighter than ?: llvm-svn: 372631
* Fix __is_fundamental to accept nullptr_tZoe Carver2019-09-231-0/+1
| | | | | | | | | | | | | | Summary: This patch updates the __is_fundamental builtin type trait to return true for nullptr_t. Reviewers: rsmith, EricWF, efriedma, craig.topper, erichkeane Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67899 llvm-svn: 372624
* [OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targetsAlexey Bataev2019-09-231-0/+10
| | | | | | | | | is not provided. We should not emit any target-dependent code if only -fopenmp flag is used and device targets are not provided to prevent compiler crash. llvm-svn: 372623
* Fix __is_signed builtinZoe Carver2019-09-231-21/+23
| | | | | | | | | | | | | | Summary: This patch fixes the __is_signed builtin type trait to work with floating point types and enums. Now, the builtin will return true if it is passed a floating point type and false for an enum type. Reviewers: EricWF, rsmith, erichkeane, craig.topper, efriedma Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67897 llvm-svn: 372621
* [Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC ↵David Bolvansky2019-09-232-1/+32
| | | | | | | | compatibility) Extracted from D63082, addressed review comments related to a warning message. llvm-svn: 372612
* Fix test atomic-expr.cpp after R372422Erich Keane2019-09-231-1/+1
| | | | | | | The test tried to match a path in a printout by doing '^:' which failed on windows, since C:\... is a path. llvm-svn: 372611
* [OPENMP]Call __kmpc_push_tripcount in task context.Alexey Bataev2019-09-236-28/+9
| | | | | | | | | Runtime function __kmpc_push_tripcount better to call inside of the task context for target regions. Otherwise, the libomptarget is unable to link the provided tripcount value for nowait target regions and completely looses this information. llvm-svn: 372609
* [Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested ↵David Bolvansky2019-09-231-13/+10
| | | | | | array by the size of the deepest base type llvm-svn: 372600
* [NFC] Fixed clang wasm test after rL372573David Bolvansky2019-09-231-2/+2
| | | | | | These tests should not depend on -O1.. llvm-svn: 372575
* For P0784R7: add further testing of requirements on constexprRichard Smith2019-09-231-0/+68
| | | | | | destructors. llvm-svn: 372541
* For P0784R7: add support for constexpr destructors, and call them asRichard Smith2019-09-237-9/+145
| | | | | | | | | | | appropriate during constant evaluation. Note that the evaluator is sometimes invoked on incomplete expressions. In such cases, if an object is constructed but we never reach the point where it would be destroyed (and it has non-trivial destruction), we treat the expression as having an unmodeled side-effect. llvm-svn: 372538
* [X86] Require last argument to LWPINS/LWPVAL builtins to be an ICE. Add ↵Craig Topper2019-09-221-0/+16
| | | | | | | | ImmArg to the llvm intrinsics. Update the isel patterns to use timm instead of imm. llvm-svn: 372534
* [NFC] Fixed failed testDavid Bolvansky2019-09-221-1/+1
| | | | llvm-svn: 372533
* [Diagnostics] Warn if ?: with integer constants always evaluates to trueDavid Bolvansky2019-09-221-0/+32
| | | | | | Extracted from D63082. GCC has this warning under -Wint-in-bool-context, but as noted in the D63082's review, we should put it under TautologicalConstantCompare. llvm-svn: 372531
* [clang] fixing conditional explicit for out-of-line definition PR42980Gauthier Harnisch2019-09-221-0/+18
| | | | | | | | | | | | | | | | Summary: not every read in CXXConstructorDecl::getExplicitSpecifierInternal() was made on the canonical declaration. Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67889 llvm-svn: 372530
* [clang] [Basic] Enable __has_feature(leak_sanitizer)Michal Gorny2019-09-221-0/+11
| | | | | | | | | | Add a 'leak_sanitizer' feature akin to existing '*_sanitizer' features to let programmers switch code paths accounting for leak sanitizers being enabled. Differential Revision: https://reviews.llvm.org/D67719 llvm-svn: 372527
* [CLANG][BPF] permit any argument type for __builtin_preserve_access_index()Yonghong Song2019-09-222-2/+28
| | | | | | | | | | | | | | | | | | | | Commit c15aa241f821 ("[CLANG][BPF] change __builtin_preserve_access_index() signature") changed the builtin function signature to PointerT __builtin_preserve_access_index(PointerT ptr) with a pointer type as the argument/return type, where argument and return types must be the same. There is really no reason for this constraint. The builtin just presented a code region so that IR builtins __builtin_{array, struct, union}_preserve_access_index can be applied. This patch removed the pointer type restriction to permit any argument type as long as it is permitted by the compiler. Differential Revision: https://reviews.llvm.org/D67883 llvm-svn: 372516
* Fix bad APInt compare.Richard Trieu2019-09-211-0/+1
| | | | | | | APInt comparison require both to have the same bitwidth. Since only the value is needed, use the compare function APInt::isSameValue instead. llvm-svn: 372454
* Merge and improve code that detects same value in comparisons.Richard Trieu2019-09-214-0/+107
| | | | | | | | | | | | -Wtautological-overlap-compare and self-comparison from -Wtautological-compare relay on detecting the same operand in different locations. Previously, each warning had it's own operand checker. Now, both are merged together into one function that each can call. The function also now looks through member access and array accesses. Differential Revision: https://reviews.llvm.org/D66045 llvm-svn: 372453
* Improve -Wtautological-overlap-compareRichard Trieu2019-09-214-3/+42
| | | | | | | | | Allow this warning to detect a larger number of constant values, including negative numbers, and handle non-int types better. Differential Revision: https://reviews.llvm.org/D66044 llvm-svn: 372448
* [clang-scan-deps] strip the --serialize-diagnostics argumentAlex Lorenz2019-09-212-0/+18
| | | | | | | This ensures that clang-scan-deps won't write out diagnostics when scanning dependencies. llvm-svn: 372444
* Fix assertion failure when constant evaluation of a switch jumps over anRichard Smith2019-09-201-0/+13
| | | | | | uninitialized variable in an init-statement of a 'for' or 'if'. llvm-svn: 372437
* [SystemZ] Support z15 processor nameUlrich Weigand2019-09-2010-6/+17
| | | | | | | | | | The recently announced IBM z15 processor implements the architecture already supported as "arch13" in LLVM. This patch adds support for "z15" as an alternate architecture name for arch13. Corrsponding LLVM support was committed as rev. 372435. llvm-svn: 372436
* Ensure AtomicExpr goes through SEMA checking after TreeTransformErich Keane2019-09-201-0/+19
| | | | | | | | | | | RebuildAtomicExpr was skipping doing semantic analysis which broke in the cases where the expressions were not dependent. This resulted in the ImplicitCastExpr from an array to a pointer being lost, causing a crash in IR CodeGen. Differential Revision: https://reviews.llvm.org/D67854 llvm-svn: 372422
* [CUDA][HIP] Fix hostness of defaulted constructorYaxun Liu2019-09-201-0/+43
| | | | | | | | | | | Clang does not respect the explicit device host attributes of defaulted special members. Also clang does not respect the hostness of special members determined by their first declarations. Clang also adds duplicate implicit device or host attributes in certain cases. This patch fixes that. Differential Revision: https://reviews.llvm.org/D67509 llvm-svn: 372394
* Finish building the full-expression for a static_assert expressionRichard Smith2019-09-201-2/+2
| | | | | | | | | | | | | | before evaluating it rather than afterwards. This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No significant functionality change intended (though this fixes a bug only visible through libclang / -ast-dump / tooling: we now store the converted condition on the StaticAssertDecl rather than the original). llvm-svn: 372368
* [Consumed] Treat by-value class arguments as consuming by default, like ↵Nicholas Allegra2019-09-191-0/+27
| | | | | | | | rvalue refs. Differential Revision: https://reviews.llvm.org/D67743 llvm-svn: 372361
* [CUDA][HIP] Re-apply part of r372318.Michael Liao2019-09-192-2/+21
| | | | | | | | | | - r372318 causes violation of `use-of-uninitialized-value` detected by MemorySanitizer. Once `Viable` field is set to false, `FailureKind` needs setting as well as it will be checked during destruction if `Viable` is not true. - Revert the part trying to skip `std::vector` erasing. llvm-svn: 372356
* Revert "[CUDA][HIP] Fix typo in `BestViableFunction`"Mitch Phillips2019-09-192-21/+2
| | | | | | | | Broke the msan buildbots (see comments on rL372318 for more details). This reverts commit eb231d15825ac345b546f4c99372d1cac8f14f02. llvm-svn: 372353
* Revert r372325 - Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-191-2/+2
| | | | | | This corrects the testing issues. llvm-svn: 372334
* [OpenCL] Add version handling and add vector ld/st builtinsSven van Haastregt2019-09-191-0/+50
| | | | | | | | | | | | | | | | | | | Allow setting a MinVersion, stating from which OpenCL version a builtin function is available, and a MaxVersion, stating from which OpenCL version a builtin function should not be available anymore. Guard some definitions of the "work-item" builtin functions according to the OpenCL versions from which they are available. Add the "vector data load and store" builtin functions (e.g. vload/vstore), whose signatures differ before and after OpenCL 2.0 in the pointer argument address spaces. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63504 llvm-svn: 372321
* [CUDA][HIP] Fix typo in `BestViableFunction`Michael Liao2019-09-192-2/+21
| | | | | | | | | | | | | | | | | | | Summary: - Should consider viable ones only when checking SameSide candidates. - Replace erasing with clearing viable flag to reduce data moving/copying. - Add one and revise another one as the diagnostic message are more relevant compared to previous one. Reviewers: tra Subscribers: cfe-commits, yaxunl Tags: #clang Differential Revision: https://reviews.llvm.org/D67730 llvm-svn: 372318
* [CLANG][BPF] change __builtin_preserve_access_index() signatureYonghong Song2019-09-191-4/+22
| | | | | | | | | | | | | | | | | | | | | | | The clang intrinsic __builtin_preserve_access_index() currently has signature: const void * __builtin_preserve_access_index(const void * ptr) This may cause compiler warning when: - parameter type is "volatile void *" or "const volatile void *", or - the assign-to type of the intrinsic does not have "const" qualifier. Further, this signature does not allow dereference of the builtin result pointer as it is a "const void *" type, which adds extra step for the user to do type casting. Let us change the signature to: PointerT __builtin_preserve_access_index(PointerT ptr) such that the result and argument types are the same. With this, directly dereferencing the builtin return value becomes possible. Differential Revision: https://reviews.llvm.org/D67734 llvm-svn: 372294
* [analyzer] PR43102: Fix an assertion and an out-of-bounds error for ↵Kristof Umann2019-09-181-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic location construction Summary: https://bugs.llvm.org/show_bug.cgi?id=43102 In today's edition of "Is this any better now that it isn't crashing?", I'd like to show you a very interesting test case with loop widening. Looking at the included test case, it's immediately obvious that this is not only a false positive, but also a very bad bug report in general. We can see how the analyzer mistakenly invalidated `b`, instead of its pointee, resulting in it reporting a null pointer dereference error. Not only that, the point at which this change of value is noted at is at the loop, rather then at the method call. It turns out that `FindLastStoreVisitor` works correctly, rather the supplied explodedgraph is faulty, because `BlockEdge` really is the `ProgramPoint` where this happens. {F9855739} So it's fair to say that this needs improving on multiple fronts. In any case, at least the crash is gone. Full ExplodedGraph: {F9855743} Reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs, TWeaver Subscribers: JesperAntonsson, uabelho, Ka-Ka, bjope, whisperity, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66716 llvm-svn: 372269
* fix build, adjust test also for Windows path separatorLubos Lunak2019-09-182-2/+2
| | | | | | Introduced in 1e9c1d2b7bfc. llvm-svn: 372263
* [OPENMP]Fix for PR43349: Crash for privatized loop bound.Alexey Bataev2019-09-181-2/+4
| | | | | | | | If the variable, used in the loop boundaries, is not captured in the construct, this variable must be considered as undefined if it was privatized. llvm-svn: 372252
* actually also compile output in tests for -frewrite-includesLubos Lunak2019-09-1811-61/+74
| | | | | | | | | Checking that the created output matches something is nice, but this should also check whether the output makes sense. Differential Revision: https://reviews.llvm.org/D63979 llvm-svn: 372250
* make -frewrite-includes also rewrite conditions in #if/#elifLubos Lunak2019-09-183-9/+153
| | | | | | | | | | | | | | | Those conditions may use __has_include, which needs to be rewritten. The existing code has already tried to rewrite just __has_include, but it didn't work with macro expansion, so e.g. Qt's "#define QT_HAS_INCLUDE(x) __has_include(x)" didn't get handled properly. Since the preprocessor run knows what each condition evaluates to, just rewrite the entire condition. This of course requires that the -frewrite-include pass has the same setup as the following compilation, but that has always been the requirement. Differential Revision: https://reviews.llvm.org/D63508 llvm-svn: 372248
OpenPOWER on IntegriCloud