summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Stop implicitly enabling avx512vl when avx512bf16 is enabled.Craig Topper2019-05-161-2/+2
| | | | | | | | Previously we were doing this so that the 256 bit selectw builtin could be used in the implementation of the 512->256 bit conversion intrinsic. After this commit we now use a masked convert builtin that will emit the intrinsic call and the 256-bit select from custom code in CGBuiltin. Then the header only needs to call that one intrinsic. llvm-svn: 360924
* [CodeComplete] Complete enumerators when preferred type is an enumIlya Biryukov2019-05-161-0/+24
| | | | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62010 llvm-svn: 360912
* [analyzer] Add a test plugin for checker option handlingKristof Umann2019-05-165-0/+73
| | | | | | Differential Revision: https://reviews.llvm.org/D59465 llvm-svn: 360910
* ftime-trace as a CoreOptionAlexandre Ganea2019-05-161-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61945 llvm-svn: 360907
* Add AIX Version MacrosXing Xue2019-05-161-0/+123
| | | | | | | | | | | | | | | | | | | | Summary: - This patch checks the AIX version and defines the appropriate macros. - Follow up to a comment on D59048. Author: andusy Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue Reviewed By: sfertile Subscribers: jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61530 llvm-svn: 360900
* [clang] Handle lround/llround builtinsAdhemerval Zanella2019-05-163-12/+22
| | | | | | | | | | | | As for other floating-point rounding builtins that can be optimized when build with -fno-math-errno, this patch adds support for lround and llround. It currently only optimize for AArch64 backend. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D61392 llvm-svn: 360896
* Reland "[analyzer] Add an example plugin for checker dependency handling"Kristof Umann2019-05-1610-15/+159
| | | | | | | | | | | Buildbots complained that they couldn't find the newly added plugins. The solution was to move the check-clang cmake target closer to the bottom of the file, after the new dependencies are added. Differential Revision: https://reviews.llvm.org/D59464 llvm-svn: 360891
* Fix isInSystemMacro in presence of macro and pasted tokenSerge Guelton2019-05-161-1/+6
| | | | | | | | | | | When a warning is raised from the expansion of a system macro that involves pasted token, there was still situations were they were not skipped, as showcased by this issue: https://bugzilla.redhat.com/show_bug.cgi?id=1472437 Differential Revision: https://reviews.llvm.org/D59413 llvm-svn: 360885
* [builtin] Fixed definitions of builtins that rely on the int/long long type ↵Karl-Johan Karlsson2019-05-162-0/+154
| | | | | | | | | | | | | | | | | | | | | | is 32/64 bits Summary: The definition of the builtins __builtin_bswap32, __builtin_bitreverse32, __builtin_rotateleft32 and __builtin_rotateright32 rely on that the int type is 32 bits wide on the target. The defintions of the builtins __builtin_bswap64, __builtin_bitreverse64, __builtin_rotateleft64, and __builtin_rotateright64 rely on that the long long type is 64 bits wide. On targets where this is not the case (e.g. AVR) clang will generate faulty code (wrong llvm assembler intrinsics). This patch add support for using 'Z' (the int32_t type) in Bultins.def. The builtins above are changed to be based on the int32_t type instead of the int type, and the int64_t type instead of the long long type. The AVR backend (experimental) have a native int type that is only 16 bits wide. The supplied testcase will therefore fail if running the testcase on trunk as clang will convert e.g. __builtin_bitreverse32 into llvm.bitreverse.i16 on AVR. Reviewers: dylanmckay, spatel, rsmith, efriedma Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D61845 llvm-svn: 360863
* Revert r360833 until I can work out the issue with Win32 botsKristina Brooks2019-05-165-53/+0
| | | | | | | | | This reverts "r360833: [Clang][PP] Add the __FILE_NAME__ builtin macro." The tests are failing on Windows bots, reverting the patchset until I can work out why. llvm-svn: 360842
* Fix regression in r360311 caused by reversed bool arguments.Richard Smith2019-05-161-0/+21
| | | | llvm-svn: 360837
* [Clang][PP] Add the __FILE_NAME__ builtin macro.Kristina Brooks2019-05-165-0/+53
| | | | | | | | | | | | | | | | This patch adds the `__FILE_NAME__` macro that expands to the last component of the path, similar to `__FILE__` except with a guarantee that only the last path component (without the separator) will be rendered. I intend to follow through with discussion of this with WG14 as a potential inclusion in the C standard or failing that, try to discuss this with GCC developers since this extension is desired by GCC and Clang users/developers alike. Differential Revision: https://reviews.llvm.org/D61756 llvm-svn: 360833
* 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
OpenPOWER on IntegriCloud