summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Harden/relax clang/test/CodeGen/opt-record-MIR.c testRoman Lebedev2018-07-171-2/+3
| | | | | | | | | | | | | | | | | | Summary: If the build path is short, `Line` field can end up fitting on the same line as `File`, but the `{{.*}}` would consume it. Keeping in mind rL293149, i think we can fix it, while keeping it working when there are and there are not any quotations. At least this fixes this test for me. Reviewers: anemet, aaron.ballman, hfinkel Reviewed By: anemet Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D49348 llvm-svn: 337249
* [Driver] Add -fno-digraphsJacob Bandes-Storch2018-07-171-2/+21
| | | | | | | | | | | | | | Summary: Add a flag `-fno-digraphs` to disable digraphs in the lexer, similar to `-fno-operator-names` which disables alternative names for C++ operators. Reviewers: rsmith Reviewed By: rsmith Subscribers: rsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D48266 llvm-svn: 337232
* [analyzer] Fix size_t in tests.Artem Dergachev2018-07-171-1/+2
| | | | | | Should fix a buildbot. No functional change intended. llvm-svn: 337231
* [CFG] [analyzer] Allow elidable copies to have more than one arguments.Artem Dergachev2018-07-171-0/+23
| | | | | | | | | | Copy-constructors and move-constructors may have default arguments. It is incorrect to assert that they only have one argument, i.e. the reference to the object being copied or moved. Remove the assertion. Differential Revision: https://reviews.llvm.org/D49215 llvm-svn: 337229
* [analyzer] pr37802: Fix symbolic-pointer-to-boolean casts during load.Artem Dergachev2018-07-172-0/+112
| | | | | | | | | The canonical representation of pointer &SymRegion{$x} casted to boolean is "$x != 0", not "$x". Assertion added in r337227 catches that. Differential Revision: https://reviews.llvm.org/D48232 llvm-svn: 337228
* Restructure checking for, and warning on, lifetime extension.Richard Smith2018-07-1715-108/+147
| | | | | | | | | | This change implements C++ DR1696, which makes initialization of a reference member of a class from a temporary object ill-formed. The standard wording here is imprecise, but we interpret it as meaning that any time a mem-initializer would result in lifetime extension, the program is ill-formed. llvm-svn: 337226
* [analyzer] Bugfix for an overly eager suppression for null pointer return ↵George Karpenkov2018-07-161-0/+23
| | | | | | | | | | | | | from macros. Only suppress those cases where the null which came from the macro is relevant to the bug, and was not overwritten in between. rdar://41497323 Differential Revision: https://reviews.llvm.org/D48856 llvm-svn: 337213
* [analyzer] Fix GCDAntipatternChecker to only fire when the semaphore is ↵George Karpenkov2018-07-161-0/+10
| | | | | | | | | | | | initialized to zero Initializing a semaphore with a different constant most likely signals a different intent rdar://41802552 Differential Revision: https://reviews.llvm.org/D48911 llvm-svn: 337212
* [OPENMP] Fix checks for declare target link entries.Alexey Bataev2018-07-161-3/+4
| | | | | | | | If the declare target link entries are created but not used, the compiler will produce an error message. Patch improves handling of such situations + improves checks for possibly lost declare target variables. llvm-svn: 337207
* [OPENMP] Fix syntactic errors in error messages.Alexey Bataev2018-07-161-1/+1
| | | | | | Fixed spelling of the offloading error messages. llvm-svn: 337196
* [OPENMP, NVPTX] Globalize only captured variables.Alexey Bataev2018-07-161-18/+20
| | | | | | | Sometimes we can try to globalize non-variable declarations, which may lead to compiler crash. llvm-svn: 337191
* [analyzer] Fix constraint being dropped when analyzing a program without ↵Mikhail R. Gadelha2018-07-164-24/+22
| | | | | | | | | | | | | | | | | | | | | | | taint tracking enabled Summary: This patch removes the constraint dropping when taint tracking is disabled. It also voids the crash reported in D28953 by treating a SymSymExpr with non pointer symbols as an opaque expression. Updated the regressions and verifying the big projects now; I'll update here when they're done. Based on the discussion on the mailing list and the patches by @ddcc. Reviewers: george.karpenkov, NoQ, ddcc, baloghadamsoftware Reviewed By: george.karpenkov Subscribers: delcypher, llvm-commits, rnkovacs, xazax.hun, szepet, a.sidorin, ddcc Differential Revision: https://reviews.llvm.org/D48650 llvm-svn: 337167
* [Sema] Reword warning for constant captures that are not requiredBenjamin Kramer2018-07-161-6/+6
| | | | | | | | | This is one of the darker corners of C++, make it clear that this is about constants and rephrase it a bit. Before: lambda capture 'i' is not required to be captured for this use After: lambda capture of constant 'i' is not required for this use llvm-svn: 337152
* [Sema] Add fixit for unused lambda capturesAlexander Shaposhnikov2018-07-161-0/+94
| | | | | | | | | | | | | This diff adds a fixit to suggest removing unused lambda captures in the appropriate diagnostic. Patch by Andrew Comminos! Test plan: make check-all Differential revision: https://reviews.llvm.org/D48845 llvm-svn: 337148
* [MinGW] Automatically mangle Windows-specific entry points as CMartin Storsjo2018-07-161-0/+19
| | | | | | | | | | | | | | This mangles entry points wmain, WinMain, wWinMain or DllMain as C functions, to match the ABI for these functions. We already did the same for these functions in MSVC mode, but we also should do the same in the Itanium ABI. This fixes PR38124. Differential Revision: https://reviews.llvm.org/D49354 llvm-svn: 337146
* Run thread safety tests with both lock and capability attributes; NFC to the ↵Aaron Ballman2018-07-151-57/+59
| | | | | | | | analysis behavior. Patch thanks to Aaron Puchert. llvm-svn: 337125
* [Hexagon] Fix hvx-length feature name in testcasesKrzysztof Parzyszek2018-07-132-2/+2
| | | | llvm-svn: 337049
* Use external layout information to layout bit-fields for MS ABI.Richard Smith2018-07-132-0/+36
| | | | | | | | Patch by Aleksandr Urakov! Differential Revision: https://reviews.llvm.org/D49227 llvm-svn: 337047
* CodeGen: specify alignment + inbounds for automatic variable initializationJF Bastien2018-07-132-30/+30
| | | | | | | | | | Summary: Automatic variable initialization was generating default-aligned stores (which are deprecated) instead of using the known alignment from the alloca. Further, they didn't specify inbounds. Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49209 llvm-svn: 337041
* [X86] Change the rounding mode used when testing the sqrt_round intrinsics.Craig Topper2018-07-131-42/+12
| | | | | | Using CUR_DIRECTION is not a realistic scenario. That is equivalent to the intrinsic without rounding. llvm-svn: 337040
* PR15730/PR16986 Allow dependently typed vector_size types.Erich Keane2018-07-131-0/+43
| | | | | | | | | | | | | | | | | As listed in the above PRs, vector_size doesn't allow dependent types/values. This patch introduces a new DependentVectorType to handle a VectorType that has a dependent size or type. In the future, ALL the vector-types should be able to create one of these to handle dependent types/sizes as well. For example, DependentSizedExtVectorType could likely be switched to just use this instead, though that is left as an exercise for the future. Differential Revision: https://reviews.llvm.org/D49045 llvm-svn: 337036
* Fix PR34668 - P0704R1 implementation is too permissiveNicolas Lesser2018-07-131-0/+3
| | | | | | | | | | | | | | | | | | | Summary: https://bugs.llvm.org/show_bug.cgi?id=34668 Pretty straightforward. Reviewers: rsmith, Rakete1111 Reviewed By: Rakete1111 Subscribers: Rakete1111, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38075 llvm-svn: 337017
* [OpenMP] Initialize data sharing stack for SPMD caseGheorghe-Teodor Bercea2018-07-137-3/+20
| | | | | | | | | | | | | | Summary: In the SPMD case, we need to initialize the data sharing and globalization infrastructure. This covers the case when an SPMD region calls a function in a different compilation unit. Reviewers: ABataev, carlo.bertolli, caomhin Reviewed By: ABataev Subscribers: Hahnfeld, jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D49188 llvm-svn: 337015
* [Analyzer] alpha.unix.cstring.OutOfBounds checker enable/disable fixAdam Balogh2018-07-133-17/+53
| | | | | | | | | | | | | | | | | | It was not possible to disable alpha.unix.cstring.OutOfBounds checker's reports since unix.Malloc checker always implicitly enabled the filter. Moreover if the checker was disabled from command line (-analyzer-disable-checker ..) the out of bounds warnings were nevertheless emitted under different checker names such as unix.cstring.NullArg, or unix.Malloc. This patch fixes the case sot that Malloc checker only enables implicitly the underlying modeling of strcpy, memcpy etc. but not the warning messages that would have been emmitted by alpha.unix.cstring.OutOfBounds Patch by: Dániel Krupp Differential Revision: https://reviews.llvm.org/D48831 llvm-svn: 337000
* [analyzer][UninitializedObjectChecker] Fixed captured lambda variable nameKristof Umann2018-07-131-3/+48
| | | | | | Differential Revision: https://reviews.llvm.org/D48291 llvm-svn: 336995
* [analyzer][UninitializedObjectChecker] Support for MemberPointerTypesKristof Umann2018-07-131-8/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D48325 llvm-svn: 336994
* PR38136: improve handling of template argument deduction of non-trailingRichard Smith2018-07-122-2/+54
| | | | | | | | | | | | | | | | | | | | | function parameter packs. This makes our handling of non-trailing function parameter packs consistent between the case of deduction at the top level in a function call and other cases where deduction encounters a non-trailing function parameter pack. Instead of treating a non-trailing pack and all later parameters as being non-deduced, we treat a non-trailing pack as exactly matching any explicitly-specified template arguments (or being an empty pack if there are no such arguments). This corresponds to the "never deduced" rule in [temp.deduct.call]p1, but generalized to all deduction contexts. Non-trailing template argument packs still result in the entire template argument list being treated as non-deduced, as specified in [temp.deduct.type]p9. llvm-svn: 336962
* Support linking static PIE binaries on NetBSDJoerg Sonnenberger2018-07-121-0/+13
| | | | llvm-svn: 336947
* PR38141: check whether noexcept-specifications are equivalent in redeclarationsRichard Smith2018-07-122-1/+11
| | | | llvm-svn: 336946
* [Driver] Conform warn_drv_object_size_disabled_O0 to DefaultWarnNoErrorVedant Kumar2018-07-121-2/+3
| | | | | | | | | | | | | | | This diagnostic triggers when -fsanitize=object-size is explicitly specified but will be a no-op (i.e, at -O0). This diagnostic should not fail a -Werror build because it's just an explanatory note to the user. It's not always actionable. For example, a user may not be able to simply disable object-size, because they want it enabled in optimized builds. rdar://42128447 llvm-svn: 336937
* [Hexagon] Fix testcases failing after r336933Krzysztof Parzyszek2018-07-123-1589/+1605
| | | | llvm-svn: 336936
* [Hexagon] Diagnose intrinsics not supported by selected CPU/HVXKrzysztof Parzyszek2018-07-128-0/+161
| | | | llvm-svn: 336933
* Add tests for function conversions in conversion function templateRichard Smith2018-07-121-0/+17
| | | | | | deduction. llvm-svn: 336931
* [C++17] Disallow lambdas in template parameters (PR33696).Nicolas Lesser2018-07-121-0/+7
| | | | | | | | | | | | | | Summary: This revision disallows lambdas in template parameters, as reported in PR33696. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37442 llvm-svn: 336930
* [C++11] Fix warning when dropping cv-qualifiers when assigning to a ↵Nicolas Lesser2018-07-121-0/+19
| | | | | | reference with a braced initializer list llvm-svn: 336922
* Revert "[modules] Fix 37878; Autoload subdirectory modulemaps with specific ↵Bruno Cardoso Lopes2018-07-126-33/+0
| | | | | | | | | | | | | | | LangOpts" This reverts commit f40124d4f05ecf4f880cf4e8f26922d861f705f3 / r336660. This change shouldn't be affecting `@import` behavior, but turns out it is: https://ci.swift.org/view/swift-master-next/job/oss-swift-incremental-RA-osx-master-next/2800/consoleFull#-12570166563122a513-f36a-4c87-8ed7-cbc36a1ec144 Working on a reduced testcase for this, reverting in the meantime. rdar://problem/42102222 llvm-svn: 336920
* Fix deduction for conversion function templates converting to referenceRichard Smith2018-07-111-0/+68
| | | | | | | | | | | | | | | | | | | types. We previously tried to use the "parameter is a reference" logic here, but that doesn't work because it gets P and A backwards. Instead, add a separate implementation of the "deduced A can be less qualified than A" rule. This also exposes that we incorrectly stripped cv-qualifiers from the referent of A if it was a reference. However, if we don't do that, we get the wrong results when P is a reference. In an attempt to match what sanity dictates and what other implementations are doing, we now remove cv-qualifiers from A and P unless both are reference types. I've brought this up on the core reflector too, to try to get the standard fixed. llvm-svn: 336867
* os_log: When there are multiple privacy annotations in the formatAkira Hatanaka2018-07-111-2/+2
| | | | | | | | | | | string, choose the strictest one instead of the last. Also fix an undefined behavior. Move the pointer update to a later point to avoid adding StringRef::npos to the pointer. rdar://problem/40706280 llvm-svn: 336863
* Fix determination of whether one set of cvr-qualifiers is compatibleRichard Smith2018-07-111-0/+10
| | | | | | | | | | with another in template argument deduction. We happened to typically get away with getting this wrong, because the cases where we'd produce a bogus deduction were caught by the final "deduced A is compatible with A" check. llvm-svn: 336852
* [FileCheck] Add -allow-deprecated-dag-overlap to failing clang testsJoel E. Denny2018-07-1143-625/+625
| | | | | | | | | | See https://reviews.llvm.org/D47106 for details. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D47172 llvm-svn: 336844
* Fix setting of empty implicit-section-name attributePetr Pavlu2018-07-111-0/+76
| | | | | | | | | | | | | | | | | | | Code in `CodeGenModule::SetFunctionAttributes()` could set an empty attribute `implicit-section-name` on a function that is affected by `#pragma clang text="section"`. This is incorrect because the attribute should contain a valid section name. If the function additionally also used `__attribute__((section("section")))` then this could result in emitting the function in a section with an empty name. The patch fixes the issue by removing the problematic code that sets empty `implicit-section-name` from `CodeGenModule::SetFunctionAttributes()` because it is sufficient to set this attribute only from a similar code in `setNonAliasAttributes()` when the function is emitted. Differential Revision: https://reviews.llvm.org/D48916 llvm-svn: 336842
* [analyzer] Track multiple raw pointer symbols in DanglingInternalBufferChecker.Reka Kovacs2018-07-111-0/+24
| | | | | | | | | | | | Previously, the checker only tracked one raw pointer symbol for each container object. But member functions returning a pointer to the object's inner buffer may be called on the object several times. These pointer symbols are now collected in a set inside the program state map and thus all of them is checked for use-after-free problems. Differential Revision: https://reviews.llvm.org/D49057 llvm-svn: 336835
* [mips] Add '-mvirt', '-mno-virt', '-mginv', '-mno-ginv' optionsVladimir Stefanovic2018-07-111-0/+24
| | | | | | | | | '-mvirt'/'-mno-virt' enables/disables Virtualization ASE. '-mginv'/'-mno-ginv' enables/disables GINV (Global Invalidate) ASE. Differential revision: https://reviews.llvm.org/D48982 llvm-svn: 336798
* [analyzer] Fix bots by changing the analyzer-config tests.George Karpenkov2018-07-112-4/+2
| | | | | | To be investigated. llvm-svn: 336756
* [SemaCXX] Remove comment from coroutines test, NFCBrian Gesiak2018-07-111-2/+0
| | | | | | | | | Summary: The file name was accidentally included when the test file was added. Test Plan: check-clang llvm-svn: 336750
* Remove qualtype qualifier in coroutine error to prevent assert in debugBrian Gesiak2018-07-111-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A forward-declared coroutine_traits should trip an error; we need a complete type. Unfortunately, in debug mode only, we trip an assert when attempting to provide the fully qualified type for the error message. If you try to compile a program with a forward-declared coroutine_traits in debug mode, clang will crash. I've included a test for the behavior and removed the q modifier on the error message. This prevents the crash in debug mode and does not change the behavior for the error message on a forward-declaration of a coroutine_traits type. Test Plan: I've included a test for the forward-declaration. Patch by Tanoy Sinha! Reviewers: modocache, GorNishanov Reviewed By: modocache Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49099 llvm-svn: 336748
* PR38095: Allow constant-folding of loads through bitcasted pointers ifRichard Smith2018-07-111-0/+10
| | | | | | the bitcast only changed cvr-qualifications within the pointer type. llvm-svn: 336746
* DR330: look through array types when forming the cv-decomposition of a type.Richard Smith2018-07-112-2/+59
| | | | | | | | | | This allows more qualification conversions, eg. conversion from 'int *(*)[]' -> 'const int *const (*)[]' is now permitted, along with all the consequences of that: more types are similar, more cases are permitted by const_cast, and conversely, fewer "casting away constness" cases are permitted by reinterpret_cast. llvm-svn: 336745
* [X86] Also fix the test for _mm512_mullo_epi64 to test the intrinsic instead ↵Craig Topper2018-07-101-1/+1
| | | | | | | | of a copy of the intrinsic implementation. This had the same issue I just fixed in r336739. Apparently I copy pasted _mm512_mullo_epi64 when I added _mm512_mullox_epi64. llvm-svn: 336740
* [X86] Fix the test for _mm512_mullox_epi64 to test the intrinsic instead of ↵Craig Topper2018-07-101-1/+1
| | | | | | a copy of the intrinsic implementation. llvm-svn: 336739
OpenPOWER on IntegriCloud