summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Add default calling convention support for regcall.Erich Keane2017-11-022-1/+15
| | | | | | | | | | | Added support for regcall as default calling convention. Also added code to exclude main when applying default calling conventions. Patch-By: eandrews Differential Revision: https://reviews.llvm.org/D39210 llvm-svn: 317268
* [CodeGen] fix const-ness of builtin equivalents of <math.h> and <complex.h> ↵Sanjay Patel2017-11-022-133/+131
| | | | | | | | | | | | | | | | functions that might set errno This just makes const-ness of the builtins match const-ness of their lib function siblings. We're deferring fixing some of these that are obviously wrong to follow-up patches. Hopefully, the bugs are visible in the new test file (added at rL317220). As the description in Builtins.def says: "e = const, but only when -fmath-errno=0". This is step 2 of N to fix builtins and math calls as discussed in D39204. Differential Revision: https://reviews.llvm.org/D39481 llvm-svn: 317265
* [OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.Alexey Bataev2017-11-021-6/+29
| | | | | | | The compiler may crash under some conditions if the getInvokeDest() is used, but later it is not used. Fixed this problem in OpenMP. llvm-svn: 317227
* [CodeGen] add builtin attr tests to show errno-related diffs; NFCSanjay Patel2017-11-021-0/+777
| | | | llvm-svn: 317220
* [OPENMP] Fix PR35156: Get correct thread id with windows exceptions.Alexey Bataev2017-11-0211-10/+48
| | | | | | | If the thread id is requested in windows mode within funclets, we may generate incorrect function call that could lead to broken codegen. llvm-svn: 317208
* [OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as baseJonas Hahnfeld2017-11-021-12/+46
| | | | | | | | | We can generate constant sized arrays whenever the array section has constant length, even if the base expression itself is a VLA. Differential Revision: https://reviews.llvm.org/D39504 llvm-svn: 317207
* PR33746: Store the 'inline'ness of a static data member with the update recordRichard Smith2017-11-021-0/+30
| | | | | | | | | for instantiating its definition. We model the 'inline'ness as being instantiated with the static data member in order to track whether the declaration has become a definition yet. llvm-svn: 317147
* Fix missing -Wregister warning when 'register' is applied to a function ↵Richard Smith2017-11-013-2/+8
| | | | | | parameter. llvm-svn: 317140
* Fix -Wunused-private-field to fire regardless of which implicit special ↵Richard Smith2017-11-012-1/+18
| | | | | | members have been implicitly declared. llvm-svn: 317076
* Change assertion to quick exit from checking function.Richard Trieu2017-11-011-0/+14
| | | | | | | Remove the assertion that could be triggered by invalid code. Replace it with an early exit from the checking function. llvm-svn: 317073
* [X86] Define i586 and pentium preprocessor defines for -march=lakemont to ↵Craig Topper2017-11-011-7/+11
| | | | | | match GCC llvm-svn: 317069
* [c++17] Refine resolution of constructor / conversion function disambiguation.Richard Smith2017-11-011-0/+9
| | | | | | | | | | | | Given a choice between a constructor call and a conversion function in C++17, we prefer the constructor for direct-initialization and the conversion function for copy-initialization, matching the behavior in C++14 and before. The guaranteed copy elision rules were not intended to change the meaning of such code (other than by removing unnecessary copy constructor calls). This tweak will be raised with CWG. llvm-svn: 317066
* [refactor][extract] code extracted from inline method should be placedAlex Lorenz2017-11-011-0/+42
| | | | | | in a function defined before the outer class llvm-svn: 317062
* [refactor][extract] prohibit extraction of ObjC property settersAlex Lorenz2017-11-011-0/+41
| | | | llvm-svn: 317056
* Making a couple of tests a bit more flexible wrt thunk mangling. Fixes ↵Wolfgang Pieb2017-11-012-2/+2
| | | | | | checkin for r317047. llvm-svn: 317053
* Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.Wolfgang Pieb2017-10-312-0/+51
| | | | | | | | | The cloning happens before all metadata nodes are resolved. Prevent the value mapper from running into unresolved or temporary MD nodes. Differential Revision: https://reviews.llvm.org/D39396 llvm-svn: 317047
* [CFI] Add CFI-icall pointer type generalizationVlad Tsyrklevich2017-10-315-14/+52
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows generalizing pointers in type signatures used for cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag. This works by 1) emitting an additional generalized type signature metadata node for functions and 2) llvm.type.test()ing for the generalized type for translation units with the flag specified. This flag is incompatible with -fsanitize-cfi-cross-dso because it would require emitting twice as many type hashes which would increase artifact size. Reviewers: pcc, eugenis Reviewed By: pcc Subscribers: kcc Differential Revision: https://reviews.llvm.org/D39358 llvm-svn: 317044
* Fix usage of right shift operator in fold expressionsRichard Smith2017-10-311-0/+17
| | | | | | | | The right shift operator was not seen as a valid operator in a fold expression, which is PR32563. Patch by Nicolas Lesser ("Blitz Rakete")! llvm-svn: 317032
* [CodeGen] map sqrt libcalls to llvm.sqrt when errno is not setSanjay Patel2017-10-313-23/+31
| | | | | | | | | | | | | | | | | The LLVM sqrt intrinsic definition changed with: D28797 ...so we don't have to use any relaxed FP settings other than errno handling. This patch sidesteps a question raised in PR27435: https://bugs.llvm.org/show_bug.cgi?id=27435 Is a programmer using __builtin_sqrt() invoking the compiler's intrinsic definition of sqrt or the mathlib definition of sqrt? But we have an answer now: the builtin should match the behavior of the libm function including errno handling. Differential Revision: https://reviews.llvm.org/D39204 llvm-svn: 317031
* Typo correct the condition of 'do-while' before exiting its scopeAlex Lorenz2017-10-301-1/+33
| | | | | | rdar://35172419 llvm-svn: 316966
* [modules] Retain multiple using-directives in the same scope even if they ↵Richard Smith2017-10-301-0/+37
| | | | | | | | | | | | name the same namespace. They might have different visibility, and thus discarding all but one of them can result in rejecting valid code. Also fix name lookup to cope with multiple using-directives being found that denote the same namespace, where some are not visible -- don't cache an "already visited" state for a using-directive that we didn't visit because it was hidden. llvm-svn: 316965
* Undo accidental language mode change in this test.Richard Smith2017-10-301-1/+1
| | | | llvm-svn: 316936
* Add a test to make sure that -Wdeprecated doesn't warn on use of 'throw()' ↵Richard Smith2017-10-302-2/+5
| | | | | | in system headers (deprecated in C++17). llvm-svn: 316935
* [analyzer] Left shifting a negative value is undefinedGabor Horvath2017-10-301-0/+7
| | | | | | | | | | The analyzer did not return an UndefVal in case a negative value was left shifted. I also altered the UndefResultChecker to emit a clear warning in this case. Differential Revision: https://reviews.llvm.org/D39423 llvm-svn: 316924
* CodeGen: Fix insertion position of addrspace cast for allocaYaxun Liu2017-10-301-8/+23
| | | | | | | | | | | | | | | | | | | | For non-zero alloca addr space, alloca is usually casted to default addr space immediately. For non-vla, alloca is inserted at AllocaInsertPt, therefore the addr space cast should also be insterted at AllocaInsertPt. However, for vla, alloca is inserted at the current insertion point of IRBuilder, therefore the addr space cast should also inserted at the current insertion point of IRBuilder. Currently clang always insert addr space cast at AllocaInsertPt, which causes invalid IR. This patch fixes that. Differential Revision: https://reviews.llvm.org/D39374 llvm-svn: 316909
* [analyzer] Use the signature of the primary template for issue hash calculationGabor Horvath2017-10-302-6/+10
| | | | | | | | | | | | | Now when a template is instantiated more times and there is a bug found in the instantiations the issue hash will be different for each instantiation even if every other property of the bug (path, message, location) is the same. This patch aims to resolve this issue. Note that explicit specializations still generate different hashes but that is intended. Differential Revision: https://reviews.llvm.org/D38728 llvm-svn: 316900
* [analyzer] Make issue hash related tests more conciseGabor Horvath2017-10-302-2492/+109
| | | | | | | | | | Extend ExprInspection checker to make it possible to dump the issue hash of arbitrary expressions. This change makes it possible to make issue hash related tests more concise and also makes debugging issue hash related problems easier. Differential Revision: https://reviews.llvm.org/D38844 llvm-svn: 316899
* [CodeGen] Generate TBAA info for reference loadsIvan A. Kosarev2017-10-301-14/+22
| | | | | | Differential Revision: https://reviews.llvm.org/D39177 llvm-svn: 316896
* [analyzer] lock_guard and unique_lock extension for BlockInCriticalSection ↵Gabor Horvath2017-10-301-0/+42
| | | | | | | | | | checker A patch by zdtorok (Zoltán Dániel Török)! Differential Revision: https://reviews.llvm.org/D33729 llvm-svn: 316892
* Add missing expected-no-diagnostics comment to test.Gabor Horvath2017-10-301-0/+1
| | | | llvm-svn: 316886
* [analyzer] Handle ObjC messages conservatively in CallDescriptionGabor Horvath2017-10-301-0/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D37470 llvm-svn: 316885
* Driver: default to `unsigned int` `wchar_t` for ARMSaleem Abdulrasool2017-10-291-0/+53
| | | | | | | | | | AAPCS and AAPCS64 mandate that `wchar_t` with `-fno-short-wchar` is an `unsigned int` rather than a `signed int`. Ensure that the driver does not flip the signedness of `wchar_t` for those targets. Add additional tests to ensure that this does not regress. llvm-svn: 316858
* [analyzer] MisusedMovedObjectChecker: More precise warning messagePeter Szecsi2017-10-281-11/+43
| | | | | | | | | | | | Added new enum in order to differentiate the warning messages on "misusing" into 3 categories: function calls, moving an object, copying an object. (At the moment the checker gives the same message in case of copying and moving.) Additional test cases added as well. Differential Revision: https://reviews.llvm.org/D38674 llvm-svn: 316852
* [analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, ↵Peter Szecsi2017-10-281-3/+19
| | | | | | | | | | | | | | | | | | | | handling method calls on base-class sub-objects An earlier solution from Artem r315301 solves the reset problem, however, the reports should be handled the same way in case of method calls. We should not just report the base class of the object where the method was defined but the whole object. Fixed false positive which came from not removing the subobjects in case of a state-resetting function. (Just replaced the State->remove(...) call to removeFromState(..) which was defined exactly for that purpose.) Some minor typos fixed in this patch as well which did not worth a whole new patch in my opinion, so included them here. Differential Revision: https://reviews.llvm.org/D31538 llvm-svn: 316850
* PR35039: Materialize temporary objects before wrapping them in anRichard Smith2017-10-282-27/+80
| | | | | | | | | OpaqueValueExpr in a GNU binary conditional expression. It's not meaningful for a non-materialized temporary object to be used as a common subexpression of multiple expressions. llvm-svn: 316836
* [analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)Peter Szecsi2017-10-281-0/+6
| | | | | | | | | | | | | | | The loop unrolling feature aims to track the maximum possible steps a loop can make. In order to implement this, it investigates the initial value of the counter variable and the bound number. (It has to be known.) These numbers are used as llvm::APInts, however, it was not checked if their bitwidths are the same which lead to some crashes. This revision solves this problem by extending the "shorter" one (to the length of the "longer" one). For the detailed bug report, see: https://bugs.llvm.org/show_bug.cgi?id=34943 Differential Revision: https://reviews.llvm.org/D38922 llvm-svn: 316830
* Basic: improve coverage for Darwin targets and fix ABISaleem Abdulrasool2017-10-281-0/+62
| | | | | | | | The existing coverage for the Darwin targets wasn't enough to catch all the variations. Improve the coverage a bit further and fix a few cases for Darwin targets. llvm-svn: 316826
* Never try to instantiate a deduction guide's "definition". Fixes bogus ↵Richard Smith2017-10-281-2/+2
| | | | | | warning when there inevitably isn't one. llvm-svn: 316820
* ARM: centralise SizeType, PtrDiffType, and IntPtrTypeSaleem Abdulrasool2017-10-271-0/+5
| | | | | | | | | Centralise the definitions of these compiler vended types to aid inspection to ensure that they are defined similarly. The one case that stands out is the Darwin case where the types do not match up. This fixes the API conformance for APCS-GNU as well. llvm-svn: 316810
* [MS] Allow access to ambiguous, inaccessible direct basesReid Kleckner2017-10-272-2/+50
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang typically warns that in the following class hierarchy, 'A' is inaccessible because there is no series of casts that the user can write to access it unambiguously: struct A { }; struct B : A { }; struct C : A, B { }; MSVC allows the user to convert from C* to A*, though, and we've encountered this issue in the latest Windows SDK headers. This patch allows this conversion when -fms-compatibility is set and adds a warning for it under -Wmicrosoft-inaccessible-base. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39389 llvm-svn: 316807
* Filter out invalid 'target' items from being passed to LLVMErich Keane2017-10-271-8/+8
| | | | | | | | | | | | | | | | | Craig noticed that CodeGen wasn't properly ignoring the values sent to the target attribute. This patch ignores them. This patch also sets the 'default' for this checking to 'supported', since only X86 has implemented the support for checking valid CPU names and Feature Names. One test was changed to i686, since it uses a lakemont, which would otherwise be prohibited in x86_64. Differential Revision: https://reviews.llvm.org/D39357 llvm-svn: 316783
* [Sema] Fix an assert-on-invalid by avoiding function template specialisationAlex Lorenz2017-10-272-8/+21
| | | | | | | | | | | | | deduction for invalid functions The fabricated template parameters cause an assertion because their depth is invalid. rdar://34109988 Differential Revision: https://reviews.llvm.org/D37341 llvm-svn: 316778
* [WebAssembly] Add crt1.o with calling lldSam Clegg2017-10-271-2/+2
| | | | | | | | | Also, for OS unknown targets like wasm, don't include 'unknown' in the library path. This is a fix for rL316719. Differential Revision: https://reviews.llvm.org/D39354 llvm-svn: 316777
* Fix test/Driver/wasm-toolchain.c on windowsSam Clegg2017-10-271-2/+2
| | | | llvm-svn: 316725
* [CodeGen] Add support for IncompleteArrayType in Obj-C ivars.Volodymyr Sapsai2017-10-271-0/+28
| | | | | | | | | | | | | | | | | Fixes an assertion failure when ivar is a struct containing incomplete array. Also completes support for direct flexible array members. rdar://problem/21054495 Reviewers: rjmccall, theraven Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38774 llvm-svn: 316723
* [WebAssembly] Include libclang_rt.builtins in the standard waySam Clegg2017-10-271-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D39218 llvm-svn: 316719
* Use -fuse-init-array if no gcc installation is found.Nico Weber2017-10-261-0/+6
| | | | | | | | | | | | | | | | clang currently uses .init_array instead of .ctors on Linux if it detects gcc 4.7+. Make it so that it also uses .init_array if no gcc installation is found at all – if there's no old gcc, there's nothing we need to be compatible with. icecc for example runs clang in a very small chroot, so before this change clang would use .ctors if run under icecc. And lld currently silently mislinks inputs with .ctors sections, so before this clang + icecc + lld would produce broken binaries. (But this seems like a good change independent of that lld bug.) https://reviews.llvm.org/D39317 llvm-svn: 316713
* [X86] Make -march=i686 an alias of -march=pentiumproCraig Topper2017-10-261-0/+2
| | | | | | | | I think the only reason they are different is because we don't set tune_i686 for -march=i686 to match GCC. But GCC 4.9.0 seems to have changed this behavior and they do set it now. So I think they can aliases now. Differential Revision: https://reviews.llvm.org/D39349 llvm-svn: 316712
* [CGBlocks] Improve line info in backtraces containing *_helper_blockVedant Kumar2017-10-261-8/+13
| | | | | | | | | | | | | | | | | | Instead of only setting a non-zero debug location on the return instruction in *_helper_block functions, set a proper location on all instructions within these functions. Pick the start location of the block literal expr for maximum clarity. The debugger does not step into *_helper_block functions during normal single-stepping because we mark their parameters as artificial. This is what we want (the functions are implicitly generated and uninteresting to most users). The stepping behavior is unchanged by this patch. rdar://32907581 Differential Revision: https://reviews.llvm.org/D39310 llvm-svn: 316704
* Fix C++ testcase I forgot to add to r316689.Adrian Prantl2017-10-261-1/+0
| | | | llvm-svn: 316695
OpenPOWER on IntegriCloud