summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [ms-inline-asm] Use the frontend size only for ambiguous instructionsReid Kleckner2017-05-046-89/+192
| | | | | | | | | | | | | | | | | | This avoids problems on code like this: char buf[16]; __asm { movups xmm0, [buf] mov [buf], eax } The frontend size in this case (1) is wrong, and the register makes the instruction matching unambiguous. There are also enough bytes available that we shouldn't complain to the user that they are potentially using an incorrectly sized instruction to access the variable. Supersedes D32636 and D26586 and fixes PR28266 llvm-svn: 302179
* Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in ↵Peter Collingbourne2017-05-041-0/+4
| | | | | | | | the module summary. NFCI." with a fix for the clang backend. llvm-svn: 302176
* DiagnosticsEngine should clear DelayedDiagID before reporting theAlex Lorenz2017-05-041-0/+29
| | | | | | | | | | | | | | | | | | | | | delayed diagnostic This fix avoids an infinite recursion that was uncovered in one of our internal tests by r301992. The testcase is the most reduced version of that auto-generated test. This is an improved version of the reverted commit r302037. The previous fix actually managed to expose another subtle bug whereby `fatal_too_many_errors` error was reported twice, with the second report setting the `FatalErrorOccurred` flag. That prevented the notes that followed the diagnostic the caused `fatal_too_many_errors` to be emitted. This commit ensures that notes that follow `fatal_too_many_errors` but that belong to the diagnostic that caused `fatal_too_many_errors` won't be emitted by setting the `FatalErrorOccurred` when emitting `fatal_too_many_errors`. rdar://31962618 llvm-svn: 302151
* [Index] The relation between the declarations in templateAlex Lorenz2017-05-041-27/+26
| | | | | | | | | | specializations that 'override' declarations in the base template should use the 'specializationOf' relation instead of 'specializationOf | overrideOf'. The indexer relations are meant to be orthogonal, so 'specializationOf' is better than the combined relation. llvm-svn: 302136
* [ARM] ACLE Chapter 9 intrinsicsSam Parker2017-05-041-4/+389
| | | | | | | | | | Implemented the remaining integer data processing intrinsics from the ARM ACLE v2.1 spec, such as parallel arithemtic and DSP style multiplications. Differential Revision: https://reviews.llvm.org/D32282 llvm-svn: 302131
* [OpenCL] Add intel_reqd_sub_group_size attribute supportXiuli Pan2017-05-043-1/+10
| | | | | | | | | | | | | | | | Summary: Add intel_reqd_sub_group_size attribute support as intel extension cl_intel_required_subgroup_size from https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_required_subgroup_size.txt Reviewers: Anastasia, bader, hfinkel, pxli168 Reviewed By: Anastasia, bader, pxli168 Subscribers: cfe-commits, yaxunl Differential Revision: https://reviews.llvm.org/D30805 llvm-svn: 302125
* Add #pragma clang module begin/end pragmas and generate them when ↵Richard Smith2017-05-044-12/+107
| | | | | | | | | | | | | | preprocessing a module. These pragmas are intended to simulate the effect of entering or leaving a file with an associated module. This is not completely implemented yet: declarations between the pragmas will not be attributed to the correct module, but macro visibility is already functional. Modules named by #pragma clang module begin must already be known to clang (in some module map that's either loaded or on the search path). llvm-svn: 302098
* [Driver] Update AArch64 testcase to match llvm r302078.Ahmed Bougacha2017-05-031-1/+1
| | | | llvm-svn: 302079
* Tests: strengthen CHECK line to avoid picking up stray path.Tim Northover2017-05-031-1/+1
| | | | | | | | A bot had "-LTO" in its working directory, which matched the regex used in this test. Since the arg is quoted, we can exploit that instead. Still broken if there's a path with a quote in, but I think that's pretty niche. llvm-svn: 302066
* Revert r302037Alex Lorenz2017-05-031-29/+0
| | | | | | | | | The commit caused the following two buildbot failures: Clang :: Misc/error-limit-multiple-notes.cpp Clang :: Misc/error-limit.c llvm-svn: 302046
* DiagnosticsEngine should clear DelayedDiagID before reporting theAlex Lorenz2017-05-031-0/+29
| | | | | | | | | | | | delayed diagnostic This avoids an infinite loop that was uncovered in one of our internal tests by r301992. The testcase is the most reduced version of that auto-generated test. rdar://31962618 llvm-svn: 302037
* [OpenMP] Extended parse for 'always' map modifierCarlo Bertolli2017-05-032-2/+63
| | | | | | | | https://reviews.llvm.org/D32807 This patch allows the map modifier 'always' to be separated by the map type (to, from, tofrom) only by a whitespace, rather than strictly by a comma as in current trunk. llvm-svn: 302031
* Reusing an existing attribute diagnosticOren Ben Simhon2017-05-031-1/+1
| | | | | | | | | In a previous patch, a new generic error diagnostic for inconsistent attributes was added. In this commit I reuse this diagnostic for ns_returns_retained attribute check. Differential Revision: https://reviews.llvm.org/D32697 llvm-svn: 302024
* [analyzer] Fix memory error bug category capitalization.Artem Dergachev2017-05-036-26/+26
| | | | | | | | | | | | It was written as "Memory Error" in most places and as "Memory error" in a few other places, however it is the latter that is more consistent with other categories (such as "Logic error"). rdar://problem/31718115 Differential Revision: https://reviews.llvm.org/D32702 llvm-svn: 302016
* Fix tests after speculatable intrinsics patchDaniel Jasper2017-05-031-541/+541
| | | | | | These were relying on the attribute group numbering llvm-svn: 302009
* Revert rL301998: "Fix a bug that -isysroot is completely ignored on Unix"Yuka Takahashi2017-05-031-4/+0
| | | | | | | | This reverts commit because it broke sanitizer-x86_64-linux-autoconf bot and clang-ppc64be-linux-multistage bot. llvm-svn: 302000
* Fix a bug that -isysroot is completely ignored on UnixYuka Takahashi2017-05-031-0/+4
| | | | | | | | | | | | -isysroot is the flag which set the system root directory. This bug report https://bugs.llvm.org//show_bug.cgi?id=11503 shows that -isysroot is not handled at all on Unix, so fixed this bug. After this diff, I could get this result https://pastebin.com/TeCmn9mj . Differential Revision: https://reviews.llvm.org/D31495 llvm-svn: 301998
* Fix tests after speculatable intrinsics patchMatt Arsenault2017-05-035-1031/+1031
| | | | | | These were relying on the attribute group numbering llvm-svn: 301996
* [sanitizer-coverage] add a deprecation warning to the old sanitizer-coverage ↵Kostya Serebryany2017-05-031-14/+12
| | | | | | flag combinations llvm-svn: 301994
* [modules] Round-trip -Werror flag through explicit module build.Richard Smith2017-05-032-10/+32
| | | | | | | | | | | | | | | The intent for an explicit module build is that the diagnostics produced within the module are those that were configured when the module was built, not those that are enabled within a user of the module. This includes diagnostics that don't actually show up until the module is used (for instance, diagnostics produced during template instantiation and weird cases like -Wpadded). We serialized and restored the diagnostic state for individual warning groups, but previously did not track the state for flags like -Werror and -Weverything, which are implemented as separate bits rather than as part of the diagnostics mapping information. llvm-svn: 301992
* [ODRHash] Add support for array and decayed types, and parameter names and ↵Richard Trieu2017-05-021-31/+177
| | | | | | types. llvm-svn: 301989
* [ubsan] Skip overflow checks on safe arithmetic (fixes PR32874)Vedant Kumar2017-05-021-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | Currently, ubsan emits overflow checks for arithmetic that is known to be safe at compile-time, e.g: 1 + 1 => CheckedAdd(1, 1) This leads to breakage when using the __builtin_prefetch intrinsic. LLVM expects the arguments to @llvm.prefetch to be constant integers, and when ubsan inserts unnecessary checks on the operands to the intrinsic, this contract is broken, leading to verifier failures (see PR32874). Instead of special-casing __builtin_prefetch for ubsan, this patch fixes the underlying problem, i.e that clang currently emits unnecessary overflow checks. Testing: I ran the check-clang and check-ubsan targets with a stage2, ubsan-enabled build of clang. I added a regression test for PR32874, and some extra checking to make sure we don't regress runtime checking for unsafe arithmetic. The existing ubsan-promoted-arithmetic.cpp test also provides coverage for this change. llvm-svn: 301988
* [NFC] Add original test that triggered crash post r301735 Faisal Vali2017-05-021-1/+13
| | | | | | - this is added just for completeness sake (though the general case should be represented by the test added in the revision to that patch: https://reviews.llvm.org/rL301972 ) llvm-svn: 301973
* Fix PR32831 (Try Again): 'this' capture while instantiating generic lambda ↵Faisal Vali2017-05-021-231/+300
| | | | | | | | | | | | | | | | | | | | | | | call operator specialization When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda. https://bugs.llvm.org/show_bug.cgi?id=32831 This patch was initially committed here: https://reviews.llvm.org/rL301735 Then reverted here: https://reviews.llvm.org/rL301916 The issue with the original patch was a failure to check that the closure type has been created within the LambdaScopeInfo before querying its DeclContext - instead of just assuming it has (silly!). A reduced example such as this highlights the problem: struct X { int data; auto foo() { return [] { return [] -> decltype(data) { return 0; }; }; } }; When 'data' within decltype(data) tries to determine the type of 'this', none of the LambdaScopeInfo's have their closure types created at that point. llvm-svn: 301972
* Simplify some va_start checking logicReid Kleckner2017-05-021-1/+1
| | | | | | | | | | | | | | | Combine the logic doing the ms_abi/sysv_abi checks into one function so that each check and its logical opposite are near each other. Now we don't need two Sema entry points for MS va_start and regular va_start. Refactor the code that checks if the va_start caller is a function, block, or obj-c method. We do this in three places, and they are all buggy for variadic lambdas (PR32737). After this change, I have one place to apply the functional fix. NFC llvm-svn: 301968
* Revert r301822 (and dependent r301825), which tried to improve theDaniel Jasper2017-05-021-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | handling of constexprs with unknown bounds. This triggers a corner case of the language where it's not yet clear whether this should be an error: struct A { static void *const a[]; static void *const b[]; }; constexpr void *A::a[] = {&b[0]}; constexpr void *A::b[] = {&a[0]}; When discovering the initializer for A::a, the bounds of A::b aren't known yet. It is unclear whether warning about errors should be deferred until the end of the translation unit, possibly resolving errors that can be resolved. In practice, the compiler can know the bounds of all arrays in this example. Credits for reproducers and explanation go to Richard Smith. Richard, please add more info in case my explanation is wrong. llvm-svn: 301963
* [CodeGen] remove/fix checks that will fail when r301923 is recommittedSanjay Patel2017-05-021-2/+6
| | | | | | Don't test the optimizer as part of front-end verification. llvm-svn: 301928
* Revert r301735 (and subsequent r301786).Daniel Jasper2017-05-021-293/+231
| | | | | | | | | | | | | | | It leads to clang crashing, e.g. on this short code fragment (added to test/SemaCXX/warn-thread-safety-parsing.cpp): class SomeClass { public: void foo() { auto l = [this] { auto l = [] EXCLUSIVE_LOCKS_REQUIRED(mu_) {}; }; } Mutex mu_; }; llvm-svn: 301916
* [analyzer] Detect bad free of function pointersDaniel Marjamaki2017-05-021-0/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D31650 llvm-svn: 301913
* Remove leftover test expectation from rL301902.Emilio Cobos Alvarez2017-05-021-1/+0
| | | | llvm-svn: 301906
* [libclang] Revert rL301328 and add tests for the regressions introduced.Emilio Cobos Alvarez2017-05-021-5/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D32566 llvm-svn: 301902
* clang/test/Modules/diag-flags.cpp: Appease targeting *-win32 with explicit ↵NAKAMURA Takumi2017-05-021-6/+6
| | | | | | | | | triple. Fixes r301846. MicrosoftRecordLayoutBuilder doesn't have ability of -Wpadded. FIXME: Would other diag be available here? llvm-svn: 301898
* Revert r301785 (and r301787) because they caused PR32864.Nick Lewycky2017-05-022-8/+4
| | | | | | The fix is that ExprEvaluatorBase::VisitInitListExpr should handle transparent exprs instead of exprs with one element. Fixing that uncovers one testcase failure because the AST for "constexpr _Complex float test2 = {1};" is wrong (the _Complex prvalue should not be const-qualified), and a number of test failures in test/OpenMP where the captured stmt contains an InitListExpr that is in syntactic form. llvm-svn: 301891
* New file missed from r301846.Richard Smith2017-05-011-0/+1
| | | | llvm-svn: 301847
* Fix initial diagnostic state setup for an explicit module with no diagnostic ↵Richard Smith2017-05-012-0/+26
| | | | | | | | | | | | pragmas. If a file has no diagnostic pragmas, we build its diagnostic state lazily, but in this case we never set up the root state to be the diagnostic state in which the module was originally built, so the diagnostic flags for files in the module with no diagnostic pragmas were incorrectly based on the user of the module rather than the diagnostic state when the module was built. llvm-svn: 301846
* Put back REQUIRES: system-darwin to fix asan bot.Richard Smith2017-05-015-5/+5
| | | | | | | | | These tests do not appear to be Darwin-specific, and this REQUIRES: appears to be hiding a real bug; this change is just restoring the prior state to get the buildbots happy again while we investigate. (The system-darwin requirement is covered by PR32851.) llvm-svn: 301840
* Improve handling of arrays of unknown bound in constant expressions.Richard Smith2017-05-011-0/+25
| | | | | | | | | | | | | | Do not spuriously reject constexpr functions that access elements of an array of unknown bound; this may later become valid once the bound is known. Permit array-to-pointer decay on such arrays, but disallow pointer arithmetic (since we do not know whether it will have defined behavior). The standard is not clear on how this should work, but this seems to be a decent answer. Patch by Robert Haberlach! llvm-svn: 301822
* Relax testcase to fix a PS4 buildbot failure.Adrian Prantl2017-05-011-1/+1
| | | | llvm-svn: 301805
* Fix test that was incorrected merged between patches.Nick Lewycky2017-05-011-1/+1
| | | | llvm-svn: 301787
* Fix line endings (dos -> unix) and clang-format while I'm hereDavid Blaikie2017-05-011-297/+293
| | | | llvm-svn: 301786
* Handle expressions with non-literal types like ignored expressions if we are ↵Nick Lewycky2017-05-012-4/+8
| | | | | | | | supposed to continue evaluating them. Also fix a crash casting a derived nullptr to a virtual base. llvm-svn: 301785
* [X86][AVX] Added support for _mm256_zext* helper intrinsics (PR32839)Simon Pilgrim2017-04-292-0/+62
| | | | llvm-svn: 301749
* Remove Sema::CheckForIntOverflow, and instead check all full-expressions.Nick Lewycky2017-04-2913-37/+31
| | | | | | | | CheckForIntOverflow used to implement a whitelist of top-level expressions to send to the constant expression evaluator, which handled many more expressions than the CheckForIntOverflow whitelist did. llvm-svn: 301742
* Fix PR32831: 'this capture while instantiating generic lambda call operator ↵Faisal Vali2017-04-291-0/+66
| | | | | | | | | | specialization When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda. https://bugs.llvm.org/show_bug.cgi?id=32831 llvm-svn: 301735
* Remove some apparently-unnecessary 'REQUIRES: system-darwin' from tests.Richard Smith2017-04-293-3/+3
| | | | | | Let's see if any buildbots actually have trouble with these. (They at least pass on Linux.) llvm-svn: 301732
* Fix "REQUIRES: system-darwin" failing tests after r301725.Richard Smith2017-04-292-4/+4
| | | | | | | Also remove the apparently-unneeded REQUIRES (the tests also pass on at least Linux, and don't appear to have anything Darwin-specific in them). llvm-svn: 301731
* PR26771: don't forget the " 2" (returning from #included file) linemarker ↵Richard Smith2017-04-292-0/+8
| | | | | | after including an empty file with -frewrite-includes. llvm-svn: 301727
* Add pragma to perform module import and use it in -E output.Richard Smith2017-04-2912-40/+97
| | | | | | | | | | | | | | | | | | | | | Many of our supported configurations support modules but do not have any first-class syntax to perform a module import. This leaves us with a problem: there is no way to represent the expansion of a #include that imports a module in the -E output for such languages. (We don't want to just leave it as a #include because that requires the consumer of the preprocessed source to have the same file system layout and include paths as the creator.) This patch adds a new pragma: #pragma clang module import MODULE.NAME.HERE that imports a module, and changes -E and -frewrite-includes to use it when rewriting a #include that maps to a module import. We don't make any attempt to use a native language syntax import if one exists, to get more consistent output. (If in the future, @import and #include have different semantics in some way, the pragma will track the #include semantics.) llvm-svn: 301725
* ObjCBoxedExpr can't be evaluated by the constant expression evaluator.Nick Lewycky2017-04-291-0/+12
| | | | | | | | A boxed expression evaluates its subexpr and then calls an objc method to transform it into another value with pointer type. The objc method can never be constexpr and therefore this expression can never be evaluated. Fixes a miscompile boxing expressions with side-effects. Also make ObjCBoxedExpr handling a normal part of the expression evaluator instead of being the only case besides full-expression where we check for integer overflow. llvm-svn: 301721
* Adapt to LLVM API change (DINamespace no longer takes line/file info).Adrian Prantl2017-04-282-8/+14
| | | | | | | rdar://problem/17484998 https://reviews.llvm.org/D32648 llvm-svn: 301707
OpenPOWER on IntegriCloud