summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Make tentative parsing to detect template-argument-lists less aggressiveRichard Smith2019-05-152-4/+15
| | | | | | | | | | | | | | | | | | (and less wrong). It's not correct to assume that X<something, Type> is always a template-id; there are a few cases where the comma takes us into a non-expression syntactic context in which 'Type' might be permissible. Stop doing that. This slightly regresses our error recovery on the cases where the construct is intended to be a template-id. We typically do still manage to diagnose a missing 'template' keyword, but we realize this too late to properly recover from the error. This fixes a regression introduced by r360308. llvm-svn: 360827
* [OpenMP][Bugfix] Move double and float versions of abs under c++ macroGheorghe-Teodor Bercea2019-05-157-0/+26
| | | | | | | | | | | | | | | | | | | | | Summary: This is a fix for the reported bug: [[ https://bugs.llvm.org/show_bug.cgi?id=41861 | 41861 ]] abs functions need to be moved under the c++ macro to avoid conflicts with included headers. Reviewers: tra, jdoerfert, hfinkel, ABataev, caomhin Reviewed By: jdoerfert Subscribers: guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61959 llvm-svn: 360809
* [c++20] For P1327R1: support dynamic_cast in constant expressionRichard Smith2019-05-151-0/+52
| | | | | | evaluation. llvm-svn: 360806
* Revert "[analyzer] Add a test for plugins using checker dependencies"Kristof Umann2019-05-1510-147/+3
| | | | | | Buildbots don't seem to find the new plugin. llvm-svn: 360805
* [OpenMP][bugfix] Fix issues with C++ 17 compilation when handling math functionsGheorghe-Teodor Bercea2019-05-153-0/+49
| | | | | | | | | | | | | | | | Summary: In OpenMP device offloading we must ensure that unde C++ 17, the inclusion of cstdlib will works correctly. Reviewers: ABataev, tra, jdoerfert, hfinkel, caomhin Reviewed By: jdoerfert Subscribers: Hahnfeld, guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61949 llvm-svn: 360804
* [CodeGenObjC] invoke objc_autorelease, objc_retain when necessaryErik Pilkington2019-05-152-6/+54
| | | | | | | | Any of these methods can be overridden, so we need to invoke these functions. Differential revision: https://reviews.llvm.org/D61957 llvm-svn: 360802
* [analyzer] Add a test for plugins using checker dependenciesKristof Umann2019-05-1510-3/+147
| | | | | | | | | | Also, I moved the existing analyzer plugin to test/ as well, in order not to give the illusion that the analyzer supports plugins -- it's capable of handling them, but does not _support_ them. Differential Revision: https://reviews.llvm.org/D59464 llvm-svn: 360799
* [analyzer] RetainCount: Fix os_returns_retained_on_zero with weird return types.Artem Dergachev2019-05-151-0/+13
| | | | | | | | | The checker was crashing when it was trying to assume a structure to be null or non-null so that to evaluate the effect of the annotation. Differential Revision: https://reviews.llvm.org/D61958 llvm-svn: 360790
* [analyzer] MIGChecker: Add support for os_ref_retain().Artem Dergachev2019-05-151-0/+20
| | | | | | | | | | Suppress MIG checker false positives that occur when the programmer increments the reference count before calling a MIG destructor, and the MIG destructor literally boils down to decrementing the reference count. Differential Revision: https://reviews.llvm.org/D61925 llvm-svn: 360737
* Fix bots by adding target triple to test.Leonard Chan2019-05-141-12/+12
| | | | llvm-svn: 360720
* [NewPM] Port HWASan and Kernel HWASanLeonard Chan2019-05-141-0/+34
| | | | | | | | | | | | | | | Port hardware assisted address sanitizer to new PM following the same guidelines as msan and tsan. Changes: - Separate HWAddressSanitizer into a pass class and a sanitizer class. - Create new PM wrapper pass for the sanitizer class. - Use the getOrINsert pattern for some module level initialization declarations. - Also enable kernel-kwasan in new PM - Update llvm tests and add clang test. Differential Revision: https://reviews.llvm.org/D61709 llvm-svn: 360707
* Fix ASTMerge/namespace/test.cpp after r360701Reid Kleckner2019-05-141-1/+1
| | | | llvm-svn: 360705
* Update ASTMerge FileCheck test expectationsReid Kleckner2019-05-1411-84/+64
| | | | | | | | | I belive many of these diagnostics changed from errors to warnings in r357394. I've simply mechanically updated the tests, but whoever owns this code should probably audit for unintented behavior changes. I wasn't able to find a flag to make these warnings errors again. llvm-svn: 360701
* Restore test files accidentally deleted in r354839Reid Kleckner2019-05-1475-0/+1963
| | | | | | | | | | | | I think there must be a bug in git-llvm causing parent directories to be deleted when the diff deletes files in a subdirectory. Perhaps it is Windows-only. There has been a behavior change, so some of these tests now fail. I have marked them XFAIL and will fix them in a follow-up to separate the changes. llvm-svn: 360699
* [Driver][Windows] Add dependent lib argument for profile instr generateRussell Gallop2019-05-142-1/+15
| | | | | | | | | | This is needed so lld-link can find clang_rt.profile when self hosting on Windows with PGO. Using clang-cl as a linker knows to add the library but self hosting, using -DCMAKE_LINKER=<...>/lld-link.exe doesn't. Differential Revision: https://reviews.llvm.org/D61742 llvm-svn: 360674
* Add a new language mode for C2x; enable [[attribute]] support by default in C2x.Aaron Ballman2019-05-147-5/+8
| | | | llvm-svn: 360667
* Revert r360637 "PR41817: Fix regression in r359260 that caused the MS ↵Hans Wennborg2019-05-141-11/+0
| | | | | | | | | | | | compatibility" > extension allowing a "static" declaration to follow an "extern" > declaration to stop working. It introduced asserts for some "static-following-extern" cases, breaking the Chromium build. See the cfe-commits thread for reproducer. llvm-svn: 360657
* PR41817: Fix regression in r359260 that caused the MS compatibilityRichard Smith2019-05-141-0/+11
| | | | | | | extension allowing a "static" declaration to follow an "extern" declaration to stop working. llvm-svn: 360637
* [c++20] P1064R0: Allow virtual function calls in constant expressionRichard Smith2019-05-136-14/+170
| | | | | | | | | | | | | evaluation. This reinstates r360559, reverted in r360580, with a fix to avoid crashing if evaluation-for-overflow mode encounters a virtual call on an object of a class with a virtual base class, and to generally not try to resolve virtual function calls to objects whose (notional) vptrs are not readable. (The standard rules are unclear here, but this seems like a reasonable approach.) llvm-svn: 360635
* [AMDGPU] gfx1010 clang targetStanislav Mekhanoshin2019-05-134-0/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D61875 llvm-svn: 360634
* [X86] Make `x86intrin.h`, `immintrin.h` includable with `-fno-gnu-inline-asm`.Volodymyr Sapsai2019-05-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Currently `immintrin.h` includes `pconfigintrin.h` and `sgxintrin.h` which contain inline assembly. It causes failures when building with the flag `-fno-gnu-inline-asm`. Fix by excluding functions with inline assembly when this extension is disabled. So far there was no need to support `_pconfig_u32`, `_enclu_u32`, `_encls_u32`, `_enclv_u32` on platforms that require `-fno-gnu-inline-asm`. But if developers start using these functions, they'll have compile-time undeclared identifier errors which is preferrable to runtime errors. rdar://problem/49540880 Reviewers: craig.topper, GBuella, rnk, echristo Reviewed By: rnk Subscribers: jkorous, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D61621 llvm-svn: 360630
* [OpenMP][Clang][BugFix] Split declares and math functions inclusion.Gheorghe-Teodor Bercea2019-05-135-4/+22
| | | | | | | | | | | | | | | | Summary: This patches fixes an issue in which the __clang_cuda_cmath.h header is being included even when cmath or math.h headers are not included. Reviewers: jdoerfert, ABataev, hfinkel, caomhin, tra Reviewed By: tra Subscribers: tra, mgorny, guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61765 llvm-svn: 360626
* Make language option `GNUAsm` discoverable with `__has_extension` macro.Volodymyr Sapsai2019-05-132-0/+8
| | | | | | | | | | | | | | | | This can be used for better support of `-fno-gnu-inline-asm` builds. rdar://problem/49540880 Reviewers: aaron.ballman, rsmith Reviewed By: aaron.ballman Subscribers: eraman, jkorous, dexonsmith, craig.topper, cfe-commits Differential Revision: https://reviews.llvm.org/D61619 llvm-svn: 360625
* Introduce the ability to dump the AST to JSON.Aaron Ballman2019-05-133-0/+1659
| | | | | | This adds the -ast-dump=json cc1 flag (in addition to -ast-dump=default, which is the default if no dump format is specified), as well as some initial AST dumping functionality and tests. llvm-svn: 360622
* Make more friendly with unions. Reviewed as https://reviews.llvm.org/D61858Marshall Clow2019-05-131-0/+15
| | | | llvm-svn: 360614
* Revert r360559 "[c++20] P1064R0: Allow virtual function calls in constant ↵Hans Wennborg2019-05-135-143/+10
| | | | | | | | | expression evaluation." This caused Chromium builds to hit the new "can't handle virtual calls with virtual bases" assert. Reduced repro coming up. llvm-svn: 360580
* PR41845: Detect and reject mismatched inner/outer pack expansion sizesRichard Smith2019-05-131-0/+10
| | | | | | in fold expressions rather than crashing. llvm-svn: 360563
* PR41854: Don't assert when constant-evaluating a member function call on an ↵Richard Smith2019-05-131-0/+8
| | | | | | invalid designator. llvm-svn: 360560
* [c++20] P1064R0: Allow virtual function calls in constant expressionRichard Smith2019-05-135-10/+143
| | | | | | evaluation. llvm-svn: 360559
* Fix test to use -cc1.Leonard Chan2019-05-121-1/+2
| | | | llvm-svn: 360548
* Fix for P41852 where builtin attributes were being caught by ↵Leonard Chan2019-05-121-0/+12
| | | | | | FindLocsWithCommonFileID(). llvm-svn: 360544
* Reject attempts to call non-static member functions on objects outsideRichard Smith2019-05-122-12/+68
| | | | | | | | | | | | | | | | their lifetime in constant expressions. This is undefined behavior per [class.cdtor]p2. We continue to allow this for objects whose values are not visible within the constant evaluation, because there's no way we can tell whether the access is defined or not, existing code relies on the ability to make such calls, and every other compiler allows such calls. This reinstates r360499, reverted in r360531. llvm-svn: 360538
* Fix handling of objects under construction during constant expressionRichard Smith2019-05-121-0/+46
| | | | | | | | | | | | | evaluation. It's not enough to just track the LValueBase that we're evaluating, we need to also track the path to the objects whose constructors are running. This reinstates r360464 (reverted in r360531) with a workaround for an MSVC bug that previously caused the Windows bots to fail. llvm-svn: 360537
* Revert rL360499 and rL360464 from cfe/trunk:Simon Pilgrim2019-05-113-114/+12
| | | | | | | | | | | | | | | | | | | | | | | | Reject attempts to call non-static member functions on objects outside their lifetime in constant expressions. This is undefined behavior per [class.cdtor]p2. We continue to allow this for objects whose values are not visible within the constant evaluation, because there's no way we can tell whether the access is defined or not, existing code relies on the ability to make such calls, and every other compiler allows such calls. ........ Fix handling of objects under construction during constant expression evaluation. It's not enough to just track the LValueBase that we're evaluating, we need to also track the path to the objects whose constructors are running. ........ Fixes windows buildbots llvm-svn: 360531
* Reject attempts to call non-static member functions on objects outsideRichard Smith2019-05-112-12/+68
| | | | | | | | | | | | | | their lifetime in constant expressions. This is undefined behavior per [class.cdtor]p2. We continue to allow this for objects whose values are not visible within the constant evaluation, because there's no way we can tell whether the access is defined or not, existing code relies on the ability to make such calls, and every other compiler allows such calls. llvm-svn: 360499
* [cc1as] Change -compress-debug-sections= to use --Fangrui Song2019-05-112-8/+8
| | | | | | The double dash form is documented by GNU as, used by gcc, and accepted by llvm-mc. llvm-svn: 360495
* [Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the ↵Amara Emerson2019-05-101-0/+6
| | | | | | | | | | | | | | | builtins library. This driver flag is useful when users want to link against the compiler's builtins, but nothing else, and so use flags like -nostdlib. Darwin can't use -nolibc & nostdlib++ like other platforms on because we disable all runtime lib linking with -static, which we still want to have an option to link with the builtins. Differential Revision: https://reviews.llvm.org/D58320 llvm-svn: 360483
* [CodeGen][ObjC] Emit invoke instead of call to call `objc_release` whenAkira Hatanaka2019-05-101-0/+11
| | | | | | | | | | | | | | | | | | necessary. Prior to r349952, clang used to call objc_msgSend when sending a release messages, emitting an invoke instruction instead of a call instruction when it was necessary to catch an exception. That changed in r349952 because runtime function objc_release is called as a nounwind function, which broke programs that were overriding the dealloc method and throwing an exception from it. This patch restores the behavior prior to r349952. rdar://problem/50253394 Differential Revision: https://reviews.llvm.org/D61803 llvm-svn: 360474
* [ThinLTO] Clang test changes for new CanAutoHide flagTeresa Johnson2019-05-102-2/+2
| | | | llvm-svn: 360468
* Fixed tests where grep was not matching the linefeedAlexandre Ganea2019-05-104-6/+12
| | | | | | | | When files are synchronized locally as CRLF on Windows, grep didn't match the newline. Switched to FileCheck instead. Differential Revision: https://reviews.llvm.org/D61496 llvm-svn: 360467
* Add target triple to test.Leonard Chan2019-05-101-1/+1
| | | | llvm-svn: 360465
* Fix handling of objects under construction during constant expressionRichard Smith2019-05-101-0/+46
| | | | | | | | | | evaluation. It's not enough to just track the LValueBase that we're evaluating, we need to also track the path to the objects whose constructors are running. llvm-svn: 360464
* Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two waysPaul Robinson2019-05-101-1/+1
| | | | | | to say the same thing. llvm-svn: 360452
* Fix and test for assertion error in P41835.Leonard Chan2019-05-101-0/+6
| | | | llvm-svn: 360448
* Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that betterPaul Robinson2019-05-104-4/+4
| | | | | | expresses the intent of the exclusion. llvm-svn: 360447
* [Sema] Mark array element destructors referenced during initializationErik Pilkington2019-05-103-7/+86
| | | | | | | | | | | | This fixes a crash where we would neglect to mark a destructor referenced for an __attribute__((no_destory)) array. The destructor is needed though, since if an exception is thrown we need to cleanup the elements. rdar://48462498 Differential revision: https://reviews.llvm.org/D61165 llvm-svn: 360446
* [libclang] Forward isInline for NamespaceDecl to libclangNikolai Kosjar2019-05-101-0/+3
| | | | llvm-svn: 360428
* Replace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminatePaul Robinson2019-05-104-13/+9
| | | | | | 'non-ps4-sdk' and use just 'ps4'. llvm-svn: 360425
* Assume `__cxa_allocate_exception` returns an under-aligned memory onAkira Hatanaka2019-05-102-4/+72
| | | | | | | | | | | | | | | | | | | | | Darwin if the version of libc++abi isn't new enough to include the fix in r319123 This patch resurrects r264998, which was committed to work around a bug in libc++abi that was causing _cxa_allocate_exception to return a memory that wasn't double-word aligned. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160328/154332.html In addition, this patch makes clang issue a warning if the type of the thrown object requires an alignment that is larger than the minimum guaranteed by the target C++ runtime. rdar://problem/49864414 Differential Revision: https://reviews.llvm.org/D61667 llvm-svn: 360404
* Remember to decay arrays to pointers before checking whether theRichard Smith2019-05-091-0/+13
| | | | | | left-hand side of an -> operator is a pointer to class type. llvm-svn: 360387
OpenPOWER on IntegriCloud