summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] [RetainCountChecker] Bugfix for tracking top-level parameters of ↵George Karpenkov2019-01-303-4306/+4323
| | | | | | | | Objective-C methods Differential Revision: https://reviews.llvm.org/D57433 llvm-svn: 352588
* Fix thread safety tests after r352549Aaron Puchert2019-01-302-2/+2
| | | | llvm-svn: 352574
* Thread safety analysis: Improve diagnostics for double lockingAaron Puchert2019-01-291-14/+14
| | | | | | | | | | | | | | | | Summary: We use the existing diag::note_locked_here to tell the user where we saw the first locking. Reviewers: aaron.ballman, delesley Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56967 llvm-svn: 352549
* OpenCL: Try to fix bot test failureMatt Arsenault2019-01-291-0/+2
| | | | llvm-svn: 352544
* [OPENMP]Fix PR40513: lastprivate taskloop counter.Alexey Bataev2019-01-291-2/+15
| | | | | | | | We don't need to use the predetermined data-sharing attributes for the loop counters if the user explicitly specified correct data-sharing attributes for such variables. llvm-svn: 352543
* [cc1as] Test that -g of empty .s file does something sensible.Paul Robinson2019-01-291-0/+11
| | | | | | Depends on LLVM r352541. llvm-svn: 352542
* OpenCL: Use length modifier for warning on vector printf argumentsMatt Arsenault2019-01-294-11/+178
| | | | | | | | | | | | Re-enable format string warnings on printf. The warnings are still incomplete. Apparently it is undefined to use a vector specifier without a length modifier, which is not currently warned on. Additionally, type warnings appear to not be working with the hh modifier, and aren't warning on all of the special restrictions from c99 printf. llvm-svn: 352540
* Revert "OpenCL: Extend argument promotion rules to vector types"Matt Arsenault2019-01-293-17/+16
| | | | | | | | | | | | This reverts r348083. This was based on a misreading of the spec for printf specifiers. Also revert r343653, as without a subsequent patch, a correctly specified format for a vector will incorrectly warn. Fixes bug 40491. llvm-svn: 352539
* Fix the tests from r350970Steven Wu2019-01-291-2/+2
| | | | | | Relax the tests from r350970 to allow non-standard path for ld. llvm-svn: 352537
* Fix the behavior of clang's -w flag.James Y Knight2019-01-296-10/+27
| | | | | | | | | | It is intended to disable _all_ warnings, even those upgraded to errors via `-Werror=warningname` or `#pragma clang diagnostic error' Fixes: https://llvm.org/PR38231 Differential Revision: https://reviews.llvm.org/D53199 llvm-svn: 352535
* [analyzer] [RetainCountChecker] Track input parameters to the top-level functionGeorge Karpenkov2019-01-294-6455/+6490
| | | | | | | | | | Track them for ISL/OS objects by default, and for NS/CF under a flag. rdar://47536377 Differential Revision: https://reviews.llvm.org/D57356 llvm-svn: 352534
* [analyzer] [RetainCountChecker] Support 'taggedRetain' and 'taggedRelease'George Karpenkov2019-01-293-6/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D57211 llvm-svn: 352530
* [OPENMP]Make the loop with unsigned counter countable.Alexey Bataev2019-01-293-5/+10
| | | | | | | | According to the report, better to keep the original strict compare operation as the loop condition with unsigned loop counters to make the loop countable. This allows further loop transformations. llvm-svn: 352526
* Rollback unwindlib patch.Sterling Augustine2019-01-291-50/+0
| | | | llvm-svn: 352524
* [CUDA][HIP] Do not diagnose use of _Float16Yaxun Liu2019-01-291-0/+7
| | | | | | | | | | | r352221 caused regressions in CUDA/HIP since device function may use _Float16 whereas host does not support it. In this case host compilation should not diagnose usage of _Float16 in device functions or variables. For now just do not diagnose _Float16 for CUDA/HIP. In the future we should have more precise check. Differential Revision: https://reviews.llvm.org/D57369 llvm-svn: 352488
* [analyzer] Toning down invalidation a bitGabor Horvath2019-01-295-7/+10
| | | | | | | | | When a function takes the address of a field the analyzer will no longer assume that the function will change other fields of the enclosing structs. Differential Revision: https://reviews.llvm.org/D57230 llvm-svn: 352473
* [AArch64] Update int64_t ACLE builtin argumentsSam Parker2019-01-292-12/+27
| | | | | | | | Re-applying r351740 with fixes (changing LL to W). Differential Revision: https://reviews.llvm.org/D56852 llvm-svn: 352463
* AMDGPU: Add ds append/consume builtinsMatt Arsenault2019-01-281-0/+12
| | | | llvm-svn: 352443
* [ASTImporter] Fix handling of overriden methods during ASTImportShafik Yaghmour2019-01-282-14/+19
| | | | | | | | | Summary: When importing classes we may add a CXXMethodDecl more than once to a CXXRecordDecl when handling overrides. This patch will fix the cases we currently know about and handle the case where we are only dealing with declarations. Differential Revision: https://reviews.llvm.org/D56936 llvm-svn: 352436
* [OPENMP][NVPTX]Emit service debug variable for NVPTX.Alexey Bataev2019-01-281-0/+1
| | | | | | | In case of the empty module, the ptxas tool may emit error message about empty debug info sections. This patch fixes this bug. llvm-svn: 352421
* Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib=Sterling Augustine2019-01-281-0/+50
| | | | | | | | | | | | | | | | Summary: "clang++ hello.cc --rtlib=compiler-rt" now works without specifying additional unwind or exception handling libraries. Reviewers: rsmith Subscribers: srhines, dberris, aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D57128 llvm-svn: 352404
* Add -fapply-global-visibility-to-externs for -cc1Scott Linder2019-01-284-3/+59
| | | | | | | | | | | | | Introduce an option to request global visibility settings be applied to declarations without a definition or an explicit visibility, rather than the existing behavior of giving these default visibility. When the visibility of all or most extern definitions are known this allows for the same optimisations -fvisibility permits without updating source code to annotate all declarations. Differential Revision: https://reviews.llvm.org/D56868 llvm-svn: 352391
* [AMDGPU] Add interpolation builtinsTim Corringham2019-01-281-0/+34
| | | | | | | | | | | | | | | | Summary: Added builtins for the interpolation intrinsics, and related LIT test. Reviewers: arsenm, tpr, dstuttard, #amdgpu Reviewed By: arsenm, #amdgpu Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, cfe-commits Differential Revision: https://reviews.llvm.org/D46871 llvm-svn: 352358
* [X86] Add new variadic avx512 compress/expand intrinsics that use vXi1 types ↵Craig Topper2019-01-284-72/+72
| | | | | | | | for the mask argument. Custom lower the builtins to these intrinsics. This enables the middle end to optimize out bitcasts for the masks. llvm-svn: 352344
* [SemaCXX] Fix ICE with structure bindings to members of templateNicolas Lesser2019-01-271-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Trying to use structure binding with a structure that doesn't implement std::tuple_size, should unpack the data members. When the struct is a template though, clang might hit an assertion (if the type has not been completed before), because CXXRecordDecl::DefinitionData is nullptr. This commit fixes the problem by completing the type while trying to decompose the structured binding. The ICE happens in real world code, for example, when trying to iterate a protobuf generated map with a range-based for loop and structure bindings (because google::protobuf::MapPair is a template and doesn't support std::tuple_size). Reported-by: nicholas.sun@nlsun.com Patch by Daniele Di Proietto Reviewers: #clang, rsmith Reviewed By: #clang, rsmith Subscribers: cpplearner, Rakete1111, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56974 llvm-svn: 352323
* Remove Expr sugar decorating the CXXUuidofExpr node.Bill Wendling2019-01-271-0/+16
| | | | | | | | | | | | | | Summary: Sugar, like ConstantExpr, causes an infinite expansion of the template object. Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: riccibruno, aaron.ballman, cfe-commits, tzik, rnk Differential Revision: https://reviews.llvm.org/D57114 llvm-svn: 352307
* [FIX] Adjust CXX microsoft abi dynamic cast test to r352293Johannes Doerfert2019-01-272-3/+3
| | | | llvm-svn: 352299
* [analyzer] Add CheckerManager::getChecker, make sure that a registry ↵Kristof Umann2019-01-264-5/+20
| | | | | | | | | | | | | function registers no more than 1 checker This patch effectively fixes the almost decade old checker naming issue. The solution is to assert when CheckerManager::getChecker is called on an unregistered checker, and assert when CheckerManager::registerChecker is called on a checker that is already registered. Differential Revision: https://reviews.llvm.org/D55429 llvm-svn: 352292
* [analyzer] Reimplement dependencies between checkersKristof Umann2019-01-2614-536/+568
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, up until now, the fact that certain checkers depended on one another was known, but how these actually unfolded was hidden deep within the implementation. For example, many checkers (like RetainCount, Malloc or CString) modelled a certain functionality, and exposed certain reportable bug types to the user. For example, while MallocChecker models many many different types of memory handling, the actual "unix.MallocChecker" checker the user was exposed to was merely and option to this modeling part. Other than this being an ugly mess, this issue made resolving the checker naming issue almost impossible. (The checker naming issue being that if a checker registered more than one checker within its registry function, both checker object recieved the same name) Also, if the user explicitly disabled a checker that was a dependency of another that _was_ explicitly enabled, it implicitly, without "telling" the user, reenabled it. Clearly, changing this to a well structured, declarative form, where the handling of dependencies are done on a higher level is very much preferred. This patch, among the detailed things later, makes checkers declare their dependencies within the TableGen file Checkers.td, and exposes the same functionality to plugins and statically linked non-generated checkers through CheckerRegistry::addDependency. CheckerRegistry now resolves these dependencies, makes sure that checkers are added to CheckerManager in the correct order, and makes sure that if a dependency is disabled, so will be every checker that depends on it. In detail: * Add a new field to the Checker class in CheckerBase.td called Dependencies, which is a list of Checkers. * Move unix checkers before cplusplus, as there is no forward declaration in tblgen :/ * Add the following new checkers: - StackAddrEscapeBase - StackAddrEscapeBase - CStringModeling - DynamicMemoryModeling (base of the MallocChecker family) - IteratorModeling (base of the IteratorChecker family) - ValistBase - SecuritySyntaxChecker (base of bcmp, bcopy, etc...) - NSOrCFErrorDerefChecker (base of NSErrorChecker and CFErrorChecker) - IvarInvalidationModeling (base of IvarInvalidation checker family) - RetainCountBase (base of RetainCount and OSObjectRetainCount) * Clear up and registry functions in MallocChecker, happily remove old FIXMEs. * Add a new addDependency function to CheckerRegistry. * Neatly format RUN lines in files I looked at while debugging. Big thanks to Artem Degrachev for all the guidance through this project! Differential Revision: https://reviews.llvm.org/D54438 llvm-svn: 352287
* [analyzer] Split unix.API up to UnixAPIMisuseChecker and ↵Kristof Umann2019-01-261-18/+18
| | | | | | | | | | | | | | | | UnixAPIPortabilityChecker The actual implementation of unix.API features a dual-checker: two checkers in one, even though they don't even interact at all. Split them up, as this is a problem for establishing dependencies. I added no new code at all, just merely moved it around. Since the plist files change (and that's a benefit!) this patch isn't NFC. Differential Revision: https://reviews.llvm.org/D55425 llvm-svn: 352278
* [X86] Custom codegen 512-bit cvt(u)qq2tops, cvt(u)qqtopd, and cvt(u)dqtops ↵Craig Topper2019-01-262-24/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | intrinsics. Summary: The 512-bit cvt(u)qq2tops, cvt(u)qqtopd, and cvt(u)dqtops intrinsics all have the possibility of taking an explicit rounding mode argument. If the rounding mode is CUR_DIRECTION we'd like to emit a sitofp/uitofp instruction and a select like we do for 256-bit intrinsics. For cvt(u)qqtopd and cvt(u)dqtops we do this when the form of the software intrinsics that doesn't take a rounding mode argument is used. This is done by using convertvector in the header with the select builtin. But if the explicit rounding mode form of the intrinsic is used and CUR_DIRECTION is passed, we don't do this. We shouldn't have this inconsistency. For cvt(u)qqtops nothing is done because we can't use the select builtin in the header without avx512vl. So we need to use custom codegen for this. Even when the rounding mode isn't CUR_DIRECTION we should also use select in IR for consistency. And it will remove another scalar integer mask from our intrinsics. To accomplish all of these goals I've taken a slightly unusual approach. I've added two new X86 specific intrinsics for sitofp/uitofp with rounding. These intrinsics are variadic on the input and output type so we only need 2 instead of 6. This avoids the need for a switch to map them in CGBuiltin.cpp. We just need to check signed vs unsigned. I believe other targets also use variadic intrinsics like this. So if the rounding mode is CUR_DIRECTION we'll use an sitofp/uitofp instruction. Otherwise we'll use one of the new intrinsics. After that we'll emit a select instruction if needed. Reviewers: RKSimon, spatel Reviewed By: RKSimon Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56998 llvm-svn: 352267
* Fixed frontend clang tests in windows read-only containerStella Stamenova2019-01-252-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When mounting LLVM source into a windows container in read-only mode, certain tests fail. Ideally, we want all these tests to pass so that developers can mount the same source folder into multiple (windows) containers simultaneously, allowing them to build/test the same source code using various different configurations simultaneously. **Fix**: I've found that when attempting to open a file for writing on windows, if you don't have the correct permissions (trying to open a file for writing in a read-only folder), you get [Access is denied](https://support.microsoft.com/en-us/help/2623670/access-denied-or-other-errors-when-you-access-or-work-with-files-and-f). In llvm, we map this error message to a linux based error, see: https://github.com/llvm-mirror/llvm/blob/master/lib/Support/ErrorHandling.cpp This is why we see "Permission denied" in our output as opposed to the expected "No such file or directory", thus causing the tests to fail. I've changed the test locally to instead point to the root drive so that they can successfully bypass the Access is denied error when LLVM is mounted in as a read-only directory. This way, the test operate exactly the same, but we can get around the windows-complications of what error to expect in a read-only directory. Patch By: justice_adams Reviewers: rsmith, zturner, MatzeB, stella.stamenova Reviewed By: stella.stamenova Subscribers: ormris, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D50563 llvm-svn: 352252
* [Sema] Improve a -Warray-bounds diagnosticErik Pilkington2019-01-251-2/+10
| | | | | | | | | | | Fix a bug where we would compare array sizes with incompatible element types, and look through explicit casts. rdar://44800168 Differential revision: https://reviews.llvm.org/D57064 llvm-svn: 352239
* Remove F16 literal support based on Float16 support.Erich Keane2019-01-251-0/+18
| | | | | | | | | Float16 support was disabled recently on many platforms, however that commit still allowed literals of Float16 type to work. This commit removes those based on the same logic as Float16 disable. Change-Id: I72243048ae2db3dc47bd3d699843e3edf9c395ea llvm-svn: 352229
* Disable _Float16 for non ARM/SPIR TargetsErich Keane2019-01-255-10/+18
| | | | | | | | | | | | | | As Discussed here: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129543.html There are problems exposing the _Float16 type on architectures that haven't defined the ABI/ISel for the type yet, so we're temporarily disabling the type and making it opt-in. Differential Revision: https://reviews.llvm.org/D57188 Change-Id: I5db7366dedf1deb9485adb8948b1deb7e612a736 llvm-svn: 352221
* Allow 'static' storage specifier on an out-of-line member function templateErich Keane2019-01-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | declaration in MSVCCompat mode Microsoft compiler permits the use of 'static' storage specifier outside of a class definition if it's on an out-of-line member function template declaration. This patch allows 'static' storage specifier on an out-of-line member function template declaration with a warning in Clang (To be compatible with Microsoft). Intel C/C++ compiler allows the 'static' keyword with a warning in Microsoft mode. GCC allows this with -fpermissive. Patch By: Manna Differential Revision: https://reviews.llvm.org/D56473 Change-Id: I97b2d9e9d57cecbcd545d17e2523142a85ca2702 llvm-svn: 352219
* [NFC][Clang] Add driver tests for sb and predresDiogo N. Sampaio2019-01-252-0/+25
| | | | | | | | | | Add tests that arguments for enabling/disabling sb and predres are correctly being or not passed by the driver. Differential Revision: https://reviews.llvm.org/D57060 llvm-svn: 352203
* Revert r352181 as it's breaking the botsAnton Korobeynikov2019-01-251-29/+0
| | | | llvm-svn: 352186
* Disable PIC/PIE for MSP430 target by default.Anton Korobeynikov2019-01-251-0/+29
| | | | | | | | | | Relocatable code generation is meaningless on MSP430, as the platform is too small to use shared libraries. Patch by Dmitry Mikushev! Differential Revision: https://reviews.llvm.org/D56927 llvm-svn: 352181
* [MSP430] Ajust f32/f64 alignment according to MSP430 EABIAnton Korobeynikov2019-01-252-1/+24
| | | | | | | | Patch by Kristina Bessonova! Differential Revision: https://reviews.llvm.org/D57015 llvm-svn: 352177
* [X86] Remove mask and passthru arguments from vpconflict builtins. Use ↵Craig Topper2019-01-252-18/+30
| | | | | | select in IR instead. llvm-svn: 352173
* [AArch64] Make the test for rsr and rsr64 stricterPetr Hosek2019-01-251-2/+7
| | | | | | | | | | | | | | | ACLE specifies that return type for rsr and rsr64 is uint32_t and uint64_t respectively. D56852 change the return type of rsr64 from unsigned long to unsigned long long which at least on Linux doesn't match uint64_t, but the test isn't strict enough to detect that because compiler implicitly converts unsigned long long to uint64_t, but it breaks other uses such as printf with PRIx64 type specifier. This change makes the test stricter enforcing that the return type of rsr and rsr64 builtins is what is actually specified in ACLE. Differential Revision: https://reviews.llvm.org/D57210 llvm-svn: 352156
* Revert "[AArch64] Use LL for 64-bit intrinsic arguments"Petr Hosek2019-01-252-15/+10
| | | | | | | | | | This reverts commit r351740: this broke on platforms where unsigned long long isn't the same as uint64_t which is what ACLE specifies for the return value of rsr64. Differential Revision: https://reviews.llvm.org/D57209 llvm-svn: 352153
* [clang-cl] Ignore space-separated /AI argumentsReid Kleckner2019-01-241-0/+1
| | | | | | | | | | The /AI flag is for #using directives, which I don't think we support. This is consistent with how the /I flag is handled by MSVC. Add a test for it. Differential Revision: https://reviews.llvm.org/D57189 llvm-svn: 352119
* [WebAssembly] Add WebAssemblyImportModule to ↵Dan Gohman2019-01-241-0/+1
| | | | | | pragma-attribute-supported-attributes-list.test llvm-svn: 352108
* [WebAssembly] Add an import_module function attributeDan Gohman2019-01-241-0/+11
| | | | | | | | | This adds a C/C++ attribute which corresponds to the LLVM IR wasm-import-module attribute. It allows code to specify an explicit import module. Differential Revision: https://reviews.llvm.org/D57160 llvm-svn: 352106
* [WebAssembly] Add a __wasi__ target macroDan Gohman2019-01-241-0/+7
| | | | | | | | | This adds a `__wasi__` macro for the wasi OS, similar to `__linux__` etc. for other OS's. Differential Revision: https://reviews.llvm.org/D57155 llvm-svn: 352105
* Add a triple to this test so it passes for targets where alignof(double)Richard Smith2019-01-241-1/+1
| | | | | | really should be equal to alignof(float). llvm-svn: 352102
* [WebAssembly] Support __float128Dan Gohman2019-01-241-0/+1
| | | | | | | | This enables support for the "__float128" keyword. Differential Revision: https://reviews.llvm.org/D57154 llvm-svn: 352100
* [WebAssembly] Factor commonality between wasm32 and wasm64 in ↵Dan Gohman2019-01-241-633/+342
| | | | | | | | | | | test/Preprocessor/init.c Use the -check-prefixes= feature to merge most of the WEBASSEMBLY32 and WEBASSEMBLY64 test checks into a shared WEBASSEMBLY test check. Differential Revision: https://reviews.llvm.org/D57153 llvm-svn: 352099
OpenPOWER on IntegriCloud