summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Correctly handle line table entries without filenames during AST serializationHans Wennborg2017-12-042-0/+14
| | | | | | | | | | The current code would hit an assert in ASTWriter when trying to write out the filename for a line table entry that didn't have any. Fix this by allowing the -1 sentinel value to round-trip through serialization. Differential revision: https://reviews.llvm.org/D40746 llvm-svn: 319707
* Add _Float128 as alias to __float128 to enable compilations on ↵Erich Keane2017-12-042-10/+32
| | | | | | | | | | | | | | | | | Fedora27/glibc2-26 Fedora27 is using a new version of glibc that refers to the _Float128 type. This patch adds that name as an alias to float128. I also added some predefined macro values for the digits, mantissa, epilon, etc (FloatMacros). For the test case, I copied an existing float128 test. This functionality needs work long term, but it should be sufficient to tread water for a while. At Intel we have test servers running our LLVM compiler with various open source workloads, the server has been upgraded to Fedora27 so many workloads are failing due to _Float128. Patch-By: mibintc Differential Revision: https://reviews.llvm.org/D40673 llvm-svn: 319703
* [libclang] Record parsing invocation to a temporary file when requestedAlex Lorenz2017-12-041-0/+21
| | | | | | | | | | | | | | | | | | by client This patch extends libclang by allowing it to record parsing operations to a temporary JSON file. The file is deleted after parsing succeeds. When a crash happens during parsing, the file is preserved and the client will be able to use it to generate a reproducer for the crash. These files are not emitted by default, and the client has to specify the invocation emission path first. rdar://35322543 Differential Revision: https://reviews.llvm.org/D40527 llvm-svn: 319702
* [OPENMP] Fix PR35486: crash when collapsing loops with dependent iteration ↵Alexey Bataev2017-12-0427-16/+94
| | | | | | | | | | spaces. Though it is incorrect from point of view of OpenMP standard to have dependent iteration space in OpenMP loops, compiler should not crash. Patch fixes this problem. llvm-svn: 319700
* [OpenMP] Initial implementation of code generation for pragma 'teams ↵Carlo Bertolli2017-12-0412-1/+3259
| | | | | | | | | | distribute parallel for simd' on host https://reviews.llvm.org/D40795 This includes regression tests for all associated clauses. llvm-svn: 319696
* [OPENMP] Codegen for `distribute simd` directive.Alexey Bataev2017-12-046-0/+1461
| | | | | | Initial codegen support for `distribute simd` directive. llvm-svn: 319661
* [OpenCL] Define __IMAGE_SUPPORT__ macro for SPIRSven van Haastregt2017-12-041-0/+4
| | | | | | | | | | | Add #define __IMAGE_SUPPORT__ 1 for SPIR targets to indicate that SPIR supports images. Patch by Dmitry Borisenkov. Differential Revision: https://reviews.llvm.org/D40252 llvm-svn: 319658
* [analyzer] Don't treat lambda-captures float constexprs as undefinedDevin Coughlin2017-12-041-0/+10
| | | | | | | | | | | | | | RegionStore has special logic to evaluate captured constexpr variables. However, if the constexpr initializer cannot be evaluated as an integer, the value is treated as undefined. This leads to false positives when, for example, a constexpr float is captured by a lambda. To fix this, treat a constexpr capture that cannot be evaluated as unknown rather than undefined. rdar://problem/35784662 llvm-svn: 319638
* Revert "[CodeGen] Add initial support for union members in TBAA"Hal Finkel2017-12-032-108/+6
| | | | | | | | This reverts commit r319413. See PR35503. We can't use "union member" as the access type here like this. llvm-svn: 319629
* [CodeGen] fix mapping from fmod calls to frem instructionSanjay Patel2017-12-022-18/+20
| | | | | | Similar to D40044 and discussed in D40594. llvm-svn: 319619
* PR35456: Track definedness of variable template specializations separately fromRichard Smith2017-12-022-7/+7
| | | | | | | | | | whether they have an initializer. We cannot distinguish between a declaration of a variable template specialization and a definition of one that lacks an initializer without this, and would previously mistake the latter for the former. llvm-svn: 319605
* [CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsicsSanjay Patel2017-12-015-122/+121
| | | | | | | | | | | | | | | | There are 20 LLVM math intrinsics that correspond to mathlib calls according to the LangRef: http://llvm.org/docs/LangRef.html#standard-c-library-intrinsics We were only converting 3 mathlib calls (sqrt, fma, pow) and 12 builtin calls (ceil, copysign, fabs, floor, fma, fmax, fmin, nearbyint, pow, rint, round, trunc) to their intrinsic-equivalents. This patch pulls the transforms together and handles all 20 cases. The switch is guarded by a check for const-ness to make sure we're not doing the transform if errno could possibly be set by the libcall or builtin. Differential Revision: https://reviews.llvm.org/D40044 llvm-svn: 319593
* [OPENMP] Emit `__tgt_target_teams` for all teams directives.Alexey Bataev2017-12-0119-93/+93
| | | | | | | | Previously we emitted `__tgt_target_teams` only for standalone teams directives. This patch allows emit this function for all teams-based directives. llvm-svn: 319585
* [c++17] When deducing the type of a non-type template parameter from the typeRichard Smith2017-12-011-0/+4
| | | | | | | | | of its argument, perform function-to-pointer and array-to-pointer decay on the parameter type first. Otherwise deduction will fail, as the type of the argument will be decayed. llvm-svn: 319584
* Fix the second part of the broken comment from r306079Adam Nemet2017-12-011-2/+6
| | | | | | | | The driver-based test is still not identical to the front-end line, remove the hotness threshold from there and add a new front-end based test with threshold. llvm-svn: 319578
* Fix opt-remark with hotness testcase for sample-based PGOAdam Nemet2017-12-012-7/+7
| | | | | | | | | | | | 1. Require hotness on all remark lines with -verify. 3. Fix the samplePGO file to actually produce hotness on each line. The second remark has hotness 60 rather 30 which I don't quite understand but testing this is strictly better than before. It also unblocks the commit of D40678. llvm-svn: 319577
* Partially fix comment in test broken in r306079 and r306948Adam Nemet2017-12-011-6/+6
| | | | | | | | | | | A RUN line was referring to the previous RUN line but a new test was added in between them. Just reorder the lines. Note this still does not completely fix this the brokenness of the comment as the driver-based test gained a new hotness-threshold argument in r306948 but I'll fix that is a separate commit. llvm-svn: 319576
* [OPENMP] Do not allow variables to be first|last-privates inAlexey Bataev2017-12-0139-92/+155
| | | | | | | | distribute directives. OpenMP standard does not allow to mark the variables as firstprivate and lastprivate at the same time in distribute-based directives. Patch fixes this problem. llvm-svn: 319560
* Disallow a cleanup attribute from appertaining to a parameter (the attribute ↵Aaron Ballman2017-12-011-4/+6
| | | | | | only appertains to local variables and is silently a noop on parameters). This repurposes the unused (and syntactically incorrect) NormalVar attribute subject. llvm-svn: 319555
* Remove duplicate, nonsense information from an attribute diagnostic. The ↵Aaron Ballman2017-12-011-1/+1
| | | | | | NonParmVar subject does not need to mention functions, and the resulting diagnostic definitely does not need to mention functions twice. llvm-svn: 319549
* [c++2a] P0515R3: Support for overloaded operator<=>.Richard Smith2017-12-013-2/+39
| | | | | | No CodeGen support for MSABI yet, we don't know how to mangle this there. llvm-svn: 319513
* [c++2a] P0515R3: lexer support for new <=> token.Richard Smith2017-12-011-0/+73
| | | | llvm-svn: 319509
* [OpenMP] Diagnose undeclared variables on declare target clauseKelvin Li2017-11-301-0/+4
| | | | | | | | | | | | | Clang asserts on undeclared variables on the to or link clause in the declare target directive. The patch is to properly diagnose the error. // foo1 and foo2 are not declared #pragma omp declare target to(foo1) #pragma omp declare target link(foo2) Differential Revision: https://reviews.llvm.org/D40588 llvm-svn: 319458
* [OPENMP] Fix possible assert for target regions with incorrect innerAlexey Bataev2017-11-305-0/+15
| | | | | | | | | teams region. If the inner teams region is not correct, it may cause an assertion when processing outer target region. Patch fixes this problem. llvm-svn: 319450
* Fix __has_unique_object_representations implementationErich Keane2017-11-302-5/+113
| | | | | | | | | | As rsmith pointed out, the original implementation of this intrinsic missed a number of important situations. This patch fixe a bunch of shortcomings and implementation details to make it work correctly. Differential Revision: https://reviews.llvm.org/D39347 llvm-svn: 319446
* Revert [ARM] disable FPU features when using soft floating point.Keith Walker2017-11-304-392/+61
| | | | | | | This reverts r319420 It is failing the test Driver/arm-mfpu.c so reverting while I investigate the failure. llvm-svn: 319425
* [ARM] disable FPU features when using soft floating point.Keith Walker2017-11-304-61/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | To be compatible with GCC if soft floating point is in effect any FPU specified is effectively ignored, eg, -mfloat-abi=soft -fpu=neon If any floating point features which require FPU hardware are enabled they must be disable. There was some support for doing this for NEON, but it did not handle VFP, nor did it prevent the backend from emitting the build attribute Tag_FP_arch describing the generated code as using the floating point hardware if a FPU was specified (even though soft float does not use the FPU). Disabling the hardware floating point features for targets which are compiling for soft float has meant that some tests which were incorrectly checking for hardware support also needed to be updated. In such cases, where appropriate the tests have been updated to check compiling for soft float and a non-soft float variant (usually softfp). This was usually because the target specified in the test defaulted to soft float. Differential Revision: https://reviews.llvm.org/D40256 llvm-svn: 319420
* [CodeGen] Add initial support for union members in TBAAIvan A. Kosarev2017-11-302-6/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The basic idea behind this patch is that since in strict aliasing mode all accesses to union members require their outermost enclosing union objects to be specified explicitly, then for a couple given accesses to union members of the form p->a.b.c... q->x.y.z... it is known they can only alias if both p and q point to the same union type and offset ranges of members a.b.c... and x.y.z... overlap. Note that the actual types of the members do not matter. Specifically, in this patch we do the following: * Make unions to be valid TBAA base access types. This enables generation of TBAA type descriptors for unions. * Encode union types as structures with a single member of a special "union member" type. Currently we do not encode information about sizes of types, but conceptually such union members are considered to be of the size of the whole union. * Encode accesses to direct and indirect union members, including member arrays, as accesses to these special members. All accesses to members of a union thus get the same offset, which is the offset of the union they are part of. This means the existing LLVM TBAA machinery is able to handle such accesses with no changes. While this is already an improvement comparing to the current situation, that is, representing all union accesses as may-alias ones, there are further changes planned to complete the support for unions. One of them is storing information about access sizes so we can distinct accesses to non-overlapping union members, including accesses to different elements of member arrays. Another change is encoding type sizes in order to make it possible to compute offsets within constant-indexed array elements. These enhancements will be addressed with separate patches. Differential Revision: https://reviews.llvm.org/D39455 llvm-svn: 319413
* [analyzer] Fix false negative on post-increment of uninitialized variable.Roman Lebedev2017-11-303-540/+570
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently clang static analyzer does warn on: ``` int x; x+=1; x-=1; x=x+1; x=x-1; ``` But does warn on: ``` int x; x++; x--; --x; ++x; ``` This differential should fix that. Fixes https://bugs.llvm.org/show_bug.cgi?id=35419 Reviewers: dcoughlin, NoQ Reviewed By: dcoughlin Subscribers: NoQ, xazax.hun, szepet, cfe-commits, a.sidorin Tags: #clang Differential Revision: https://reviews.llvm.org/D40463 llvm-svn: 319411
* Preserve the "last diagnostic was suppressed" flag across SFINAE checks.Richard Smith2017-11-302-0/+11
| | | | | | | | | | | | Sometimes we check the validity of some construct between producing a diagnostic and producing its notes. Ideally, we wouldn't do that, but in practice running code that "cannot possibly produce a diagnostic" in such a situation should be safe, and reasonable factoring of some code requires it with our current diagnostics infrastruture. If this does happen, a diagnostic that's suppressed due to SFINAE should not cause notes connected to the prior diagnostic to be suppressed. llvm-svn: 319408
* [XRay][clang] Introduce -fxray-always-emit-customeventsDean Michael Berris2017-11-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The -fxray-always-emit-customevents flag instructs clang to always emit the LLVM IR for calls to the `__xray_customevent(...)` built-in function. The default behaviour currently respects whether the function has an `[[clang::xray_never_instrument]]` attribute, and thus not lower the appropriate IR code for the custom event built-in. This change allows users calling through to the `__xray_customevent(...)` built-in to always see those calls lowered to the corresponding LLVM IR to lay down instrumentation points for these custom event calls. Using this flag enables us to emit even just the user-provided custom events even while never instrumenting the start/end of the function where they appear. This is useful in cases where "phase markers" using __xray_customevent(...) can have very few instructions, must never be instrumented when entered/exited. Reviewers: rnk, dblaikie, kpw Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40601 llvm-svn: 319388
* MS ABI: Treat explicit instantiation definitions of dllimport function ↵Hans Wennborg2017-11-291-1/+10
| | | | | | | | | | | templates as explicit instantiation decls (PR35435) This matches MSVC's behaviour, and we already do it for class templates since r270897. Differential revision: https://reviews.llvm.org/D40621 llvm-svn: 319386
* Perform a bounds check on a function's argument list before accessing any ↵Aaron Ballman2017-11-291-0/+23
| | | | | | | | index value specified by an 'argument_with_type_tag' attribute. Fixes PR28520. Patch by Matt Davis. llvm-svn: 319383
* [Coverage] Emit gap areas in braces-optional statements (PR35387)Vedant Kumar2017-11-2912-47/+57
| | | | | | | | | | | | Emit a gap area starting after the r-paren location and ending at the start of the body for the braces-optional statements (for, for-each, while, etc). The count for the gap area equal to the body's count. This extends the fix in r317758. Fixes PR35387, rdar://35570345 Testing: stage2 coverage-enabled build of clang, check-clang llvm-svn: 319373
* [EH] Use __CxxFrameHandler3 for C++ EH in MS environmentsReid Kleckner2017-11-291-0/+20
| | | | | | | | Fixes regression introduced by r319297. MSVC environments still use SEH unwind opcodes but they should use the Microsoft C++ EH personality, not the mingw one. llvm-svn: 319363
* [OPENMP] Allow only loop control variables in distribute simdAlexey Bataev2017-11-2914-440/+174
| | | | | | | | | directives. According to the OpenMP standard, only loop control variables can be used in linear clauses of distribute-based simd directives. llvm-svn: 319362
* [analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=trueDevin Coughlin2017-11-291-0/+72
| | | | | | | | | | | | | In the original design of the analyzer, it was assumed that a BlockEntrance doesn't create a new binding on the Store, but this assumption isn't true when 'widen-loops' is set to true. Fix this by finding an appropriate location BlockEntrace program points. Patch by Henry Wong! Differential Revision: https://reviews.llvm.org/D37187 llvm-svn: 319333
* [OPENMP] Do not allow `linear` clauses on non-simd distributeAlexey Bataev2017-11-298-890/+11
| | | | | | | | directives. `linear` clause is not allowed on non-simd distribute-based directives. llvm-svn: 319332
* [Driver] Turns out the GNU assembler does support falkor/saphira.Chad Rosier2017-11-291-6/+0
| | | | llvm-svn: 319323
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-294-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a re-apply of r319294. adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 llvm-svn: 319297
* Revert "Toolchain: Normalize dwarf, sjlj and seh eh"Martell Malone2017-11-294-27/+1
| | | | | | | | This reverts rL319294. The windows sanitizer does not like seh on x86. Will re apply with None type for x86 llvm-svn: 319295
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-294-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 clang cc1 assumes dwarf is the default if none is passed and -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 llvm-svn: 319294
* Reland "Fix vtable not receiving hidden visibility when using push(visibility)"Jake Ehrlich2017-11-291-0/+20
| | | | | | | | | | I had to reland this change in order to make the test work on windows This change should resolve https://bugs.llvm.org/show_bug.cgi?id=35022 https://reviews.llvm.org/D39627 llvm-svn: 319269
* [OPENMP] Generalize capturing of clauses expressions.Alexey Bataev2017-11-281-7/+3
| | | | | | | The handling and capturing of the non-constant expressions of some of the capturable clauses in combined directives is generalized. llvm-svn: 319227
* [CUDA] Report "unsupported VLA" errors only on device side.Artem Belevich2017-11-283-4/+4
| | | | | | | | | | | | This fixes erroneously reported CUDA compilation errors in host-side code during device-side compilation. I've also restricted OpenMP-specific checks to trigger only if we're compiling with OpenMP enabled. Differential Revision: https://reviews.llvm.org/D40275 llvm-svn: 319201
* [test] Fix a typo in a test comment. NFC.Martin Storsjo2017-11-281-1/+1
| | | | llvm-svn: 319145
* [clang-cl] Alias /Wall to -WeverythingReid Kleckner2017-11-271-1/+2
| | | | | | | cl interprets this option to mean enable every supported warning, which is what Clang's -Weverything flag does. llvm-svn: 319116
* [OPENMP] Codegen for `distribute parallel for simd` directive.Alexey Bataev2017-11-277-0/+4240
| | | | | | | Initial codegen for `#pragma omp distribute parallel for simd` directive and its clauses. llvm-svn: 319079
* Switch CPU names not recognized by GNU assemblerPirama Arumuga Nainar2017-11-271-0/+17
| | | | | | | | | | | | | | | | Summary: Switch CPU names not recognized by GNU assembler to a close CPU that it does recognize. In this patch, kryo, falkor and saphira all get replaced by cortex-a57 when invoking the assembler. In addition, krait was already being replaced by cortex-a15. Reviewers: weimingz Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D40476 llvm-svn: 319077
* [analyzer] pr34766: Fix a crash on explicit std::initializer_list constructor.Artem Dergachev2017-11-271-1/+5
| | | | | | | | | | | | | | | | We didn't support the following syntax: (std::initializer_list<int>){12} which suddenly produces CompoundLiteralExpr that contains CXXStdInitializerListExpr. Lift the assertion and instead pass the value through CompoundLiteralExpr transparently, as it doesn't add much. Differential Revision: https://reviews.llvm.org/D39803 llvm-svn: 319058
OpenPOWER on IntegriCloud