summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported fileAlexey Bataev2018-09-253-5/+2
| | | | | | | | | types." It reverts commit r342991 + several other commits intended to fix the tests. Still have some failed tests, need to investigate it. llvm-svn: 343002
* [OPENMP] Fix the test, NFC.Alexey Bataev2018-09-251-3/+2
| | | | | | Fixed test to pacify buildbot. llvm-svn: 342996
* [OPENMP] Fix failed test, NFC.Alexey Bataev2018-09-251-1/+0
| | | | llvm-svn: 342995
* [DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.Alexey Bataev2018-09-253-3/+8
| | | | | | | | | clang-offload-bundler should not be invoked with the unbundling action when the input file type does not match the action type. For example, .so files should be unbundled during linking phase and should be linked only with the host code. llvm-svn: 342991
* [AArch64] Support adding X[8-15,18] registers as CSRs.Tri Vo2018-09-252-0/+66
| | | | | | | | | | | | | | | | | | Summary: Making X[8-15,18] registers call-saved is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. Signed-off-by: Tri Vo <trong@android.com> Reviewers: srhines, nickdesaulniers, javed.absar Reviewed By: nickdesaulniers Subscribers: kristof.beyls, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52399 llvm-svn: 342990
* [clang-cl] Provide separate flags for all the /O variantsHans Wennborg2018-09-251-6/+6
| | | | | | | | | | | | | | | This provides better help text in "clang-cl /?". Also it cleans things up a bit: previously "/Od" could be handled either as a separate flag aliased to "-O0", or by the main optimization flag processing in TranslateOptArg. With this patch, all the flags get aliased back to /O so they're handled by TranslateOptArg. Thanks to Nico for the idea! Differential revision: https://reviews.llvm.org/D52266 llvm-svn: 342977
* [OpenCL] Allow zero assignment and comparisons between queue_t type variablesSven van Haastregt2018-09-251-4/+22
| | | | | | | | | | | This change allows for zero assignment and comparison of queue_t type variables, and extends null_queue.cl to test this. Patch by Alistair Davies. Differential Revision: https://reviews.llvm.org/D51727 llvm-svn: 342968
* Driver: render arguments for the embedded bitcode correctlySaleem Abdulrasool2018-09-241-0/+28
| | | | | | | | | | When embedding bitcode, only a subset of the arguments should be recorded into the bitcode compilation commandline. The frontend job is split into two jobs, one which will generate the bitcode. Ensure that the arguments for the compilation to bitcode is properly stripped so that the embedded arguments are the permitted subset. llvm-svn: 342929
* P0962R1: only use the member form of 'begin' and 'end' in a range-basedRichard Smith2018-09-242-5/+60
| | | | | | | | | | for loop if both members exist. This resolves a DR whereby an errant 'begin' or 'end' member in a base class could result in a derived class not being usable as a range with non-member 'begin' and 'end'. llvm-svn: 342925
* [analyzer] Prevent crashes in FindLastStoreBRVisitorGeorge Karpenkov2018-09-241-0/+17
| | | | | | | | | | This patch is a band-aid. A proper solution would be too change trackNullOrUndefValue to only try to dereference the pointer when it is relevant to the problem. Differential Revision: https://reviews.llvm.org/D52435 llvm-svn: 342920
* [CodeGen] Revert commit https://reviews.llvm.org/rL342717Calixte Denizet2018-09-245-9/+10
| | | | llvm-svn: 342912
* [Power9] [CLANG] Add __float128 exponent GET and SET builtinsStefan Pintilie2018-09-241-0/+12
| | | | | | | | | | | | | Added __builtin_vsx_scalar_extract_expq __builtin_vsx_scalar_insert_exp_qp Builtins should behave the same way as in GCC. Differential Revision: https://reviews.llvm.org/D48184 llvm-svn: 342911
* Revert "rL342883: [Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with ↵Kristina Brooks2018-09-242-36/+2
| | | | | | | | `-fconstant-cfstrings`." Seems to be causing buildbot failures, need to look into it. llvm-svn: 342893
* [CFString][ELF] Fix a missed test causing buildbot failures from 342883.Kristina Brooks2018-09-241-2/+2
| | | | | | Accidetanlly forgot to update it, big sorry. llvm-svn: 342890
* Revert "We allow implicit function declarations as an extension in all C ↵Anastasia Stulova2018-09-242-2/+2
| | | | | | | | | | dialects. Remove OpenCL special case." Discussed on cfe-commits (Week-of-Mon-20180820), this change leads to the generation of invalid IR for OpenCL without giving an error. Therefore, the conclusion was to revert. llvm-svn: 342885
* [Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fconstant-cfstrings`.Kristina Brooks2018-09-241-0/+34
| | | | | | | | | | | | | | | | | | | [Clang][CodeGen][ObjC]: Fix non-bridged CoreFoundation builds on ELF targets that use `-fconstant-cfstrings`. The original changes from differential for a similar patch to PE/COFF (https://reviews.llvm.org/D44491) did not check for an edge case where the global could be a constant which surfaced as an issue when building for ELF because of different linkage semantics. This patch addresses several issues with crashes related to CF builds on ELF as well as improves data layout by ensuring string literals that back the actual CFConstStrings end up in .rodata in line with Mach-O. Change itself tested with CoreFoundation on Linux x86_64 but should be valid for BSD-like systems as well that use ELF as the native object format. Differential Revision: https://reviews.llvm.org/D52344 llvm-svn: 342883
* [ARM][AArch64] Add feature +fp16fmlSjoerd Meijer2018-09-244-25/+272
| | | | | | | | | | | | | | | | | | | | | Armv8.4-A adds a few FP16 instructions that can optionally be implemented in CPUs of Armv8.2-A and above. This patch adds a feature to clang to permit selection of these instructions. This interacts with the +fp16 option as follows: Prior to Armv8.4-A: *) +fp16fml implies +fp16 *) +nofp16 implies +nofp16fml From Armv8.4-A: *) The above conditions apply, additionally: +fp16 implies +fp16fml Patch by Bernard Ogden. Differential Revision: https://reviews.llvm.org/D50229 llvm-svn: 342862
* Add inherited attributes before parsed attributes.Michael Kruse2018-09-244-8/+29
| | | | | | | | | | | | | | | | | Currently, attributes from previous declarations ('inherited attributes') are added to the end of a declaration's list of attributes. Before r338800, the attribute list was in reverse. r338800 changed the order of non-inherited (parsed from the current declaration) attributes, but inherited attributes are still appended to the end of the list. This patch appends inherited attributes after other inherited attributes, but before any non-inherited attribute. This is to make the order of attributes in the AST correspond to the order in the source code. Differential Revision: https://reviews.llvm.org/D50214 llvm-svn: 342861
* [CStringSyntaxChecker] Check strlcat sizeof checkDavid Carlier2018-09-231-3/+22
| | | | | | | | | | | | | Assuming strlcat is used with strlcpy we check as we can if the last argument does not equal os not larger than the buffer. Advising the proper usual pattern. Reviewers: george.karpenkov, NoQ, MaskRay Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D49722 llvm-svn: 342832
* [Index] Report specialization bases as references when ↵Fangrui Song2018-09-231-0/+10
| | | | | | | | | | | | | | | | | | | | IndexImplicitInstantiation is true Summary: template <typename T> struct B {}; template <typename T> struct D : B<T> {}; // `B` was not reported as a reference This patch fixes this. Reviewers: akyrtzi, arphaman, devnexen Reviewed By: devnexen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52331 llvm-svn: 342831
* Fix codemodels.c test case (only test mcmodel=medium on X86).Caroline Tice2018-09-221-1/+1
| | | | | | | | | aarch64 testing is broken because "medium" is not a valid code-model on aarch64, and codemodels.c tests that. This fixes that problem by adding "-triple x86_64-unknown-linux-gnu" to the test with "-mcode-model moedium". llvm-svn: 342812
* Update smart pointer detection for thread safety analysis.Richard Trieu2018-09-221-0/+95
| | | | | | | | | Objects are determined to be smart pointers if they have both a star and arrow operator. Some implementations of smart pointers have these overloaded operators in a base class, while the check only searched the derived class. This fix will also look for the operators in the base class. llvm-svn: 342794
* [Lexer] Add udefined_behavior_sanitizer featureLeonard Chan2018-09-221-0/+13
| | | | | | | | | This can be used to detect whether the code is being built with UBSan using the __has_feature(undefined_behavior_sanitizer) predicate. Differential Revision: https://reviews.llvm.org/D52386 llvm-svn: 342793
* Fix codemodels.c test case (only test mcmodel-kernel on x86)Caroline Tice2018-09-211-1/+1
| | | | | | | | | | | | A recent commit I made broke aarch64 testing, because "kernel" apparently is not a valid code-model on aarch64, and one of my tests tested that. This fixes the problem (hopefully) by adding "-triple x86_64-unknown-linux-gnu" to the test build with "-mcodel-model kernel". Differential Revision: https://reviews.llvm.org/D52383 llvm-svn: 342789
* [analyzer] Process state in checkEndFunction in RetainCountCheckerGeorge Karpenkov2018-09-213-255/+8
| | | | | | | | | | | | | | Modify the RetainCountChecker to perform state "adjustments" in checkEndFunction, as performing work in PreStmt<ReturnStmt> does not work with destructors. The previous version made an implicit assumption that no code runs after the return statement is executed. rdar://43945028 Differential Revision: https://reviews.llvm.org/D52338 llvm-svn: 342770
* [analyzer] Associate diagnostics created in checkEndFunction with a return ↵George Karpenkov2018-09-212-4/+5
| | | | | | | | | | statement, if possible If not possible, use the last line of the declaration, as before. Differential Revision: https://reviews.llvm.org/D52326 llvm-svn: 342768
* Add necessary support for storing code-model to module IR.Caroline Tice2018-09-211-0/+18
| | | | | | | | | | | | Currently the code-model does not get saved in the module IR, so if a code model is specified when compiling with LTO, it gets lost and is not propagated properly to LTO. This patch does what is necessary in the front end to pass the code-model to the module, so that the back end can store it in the Module . Differential Revision: https://reviews.llvm.org/D52323 llvm-svn: 342758
* [CUDA] Fixed parsing of optional template-argument-list.Artem Belevich2018-09-212-2/+8
| | | | | | | | | We need to consider all tokens that start with '>' when we're checking for the end of an empty template argument list. Differential Revision: https://reviews.llvm.org/D52321 llvm-svn: 342752
* [CUDA] Ignore uncallable functions when we check for usual deallocators.Artem Belevich2018-09-213-3/+231
| | | | | | | | | Previously clang considered function variants from both sides of compilation and that resulted in picking up wrong deallocation function. Differential Revision: https://reviews.llvm.org/D51808 llvm-svn: 342749
* [OPENMP] Disable emission of the class with vptr if they are not used inAlexey Bataev2018-09-211-0/+10
| | | | | | | | | target constructs. Prevent compilation of the classes with the virtual tables when compiling for the device. llvm-svn: 342741
* [OPENMP][NVPTX] Enable support for lastprivates in SPMD constructs.Alexey Bataev2018-09-214-32/+30
| | | | | | | Previously we could not use lastprivates in SPMD constructs, patch allows supporting lastprivates in SPMD with uninitialized runtime. llvm-svn: 342738
* [CodeComplete] Generate completion fix-its for C code as wellIvan Donchevskii2018-09-211-0/+19
| | | | | | | | | Current completion fix-its approach does not provide OtherOpBase for C code. But we can easily proceed in this case taking the original Base type. Differential Revision: https://reviews.llvm.org/D52261 llvm-svn: 342721
* [CodeGen] Add to emitted DebugLoc information about coverage when it's requiredCalixte Denizet2018-09-215-10/+9
| | | | | | | | | | | | | | | | | | | | Summary: Some lines have a hit counter where they should not have one. Cleanup stuff is located to the last line of the body which is most of the time a '}'. And Exception stuff is added at the beginning of a function and at the end (represented by '{' and '}'). So in such cases, the DebugLoc used in GCOVProfiling.cpp must be marked as not covered. This patch is a followup of https://reviews.llvm.org/D49915. Tests in projects/compiler_rt are fixed by: https://reviews.llvm.org/D49917 Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: dblaikie, cfe-commits, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D49916 llvm-svn: 342717
* [XRay][clang] Propagate -fxray-instrumentation-bundle to -cc1Dean Michael Berris2018-09-211-0/+11
| | | | | | | | | | | | | | | Summary: Add a test and ensure that we propagate the -fxray-instrumentation-bundle flag from the driver invocation to the -cc1 options. Reviewers: mboerger, tejohnson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52342 llvm-svn: 342715
* Remove failing test.Zachary Turner2018-09-201-3/+0
| | | | | | | | | | Removing on behalf of Jorge Moya. This test is broken on Windows due to it actually being able to resolve the path. There is an actual Windows-specific bug somewhere, but we already have sufficient test coverage of this with a different test, so removing this was the approach suggested by Jorge. llvm-svn: 342693
* Fix an assert in -Wquoted-include-in-framework-headerErik Pilkington2018-09-203-0/+5
| | | | | | | | Fixes rdar://43692300 Differential revision: https://reviews.llvm.org/D52253 llvm-svn: 342679
* [Sema] Retain __restrict qualifiers when substituting a reference type.Erik Pilkington2018-09-201-0/+18
| | | | | | | | Fixes rdar://43760099 Differential revision: https://reviews.llvm.org/D52271 llvm-svn: 342672
* Add testcases for r342667.Eric Christopher2018-09-202-0/+6
| | | | llvm-svn: 342668
* [OPENMP] Add support for mapping memory pointed by member pointer.Alexey Bataev2018-09-202-2/+157
| | | | | | Added support for map(s, s.ptr[0:1]) kind of mapping. llvm-svn: 342648
* [OpenCL] Diagnose redundant address space conversionSven van Haastregt2018-09-201-1/+3
| | | | | | | | | | | | | | | | Add a warning if a parameter with a named address space is passed to a to_addr builtin. For example: int i; to_private(&i); // generate warning as conversion from private to private is redundant. Patch by Alistair Davies. Differential Revision: https://reviews.llvm.org/D51411 llvm-svn: 342638
* FileCheckify test/Driver/Xarch.cHans Wennborg2018-09-201-8/+11
| | | | llvm-svn: 342636
* [PowerPC] [Clang] Add vector int128 pack/unpack builtinsQingShan Zhang2018-09-203-0/+43
| | | | | | | | | | | | unsigned long long builtin_unpack_vector_int128 (vector int128_t, int); vector int128_t builtin_pack_vector_int128 (unsigned long long, unsigned long long); Builtins should behave the same way as in GCC. Patch By: wuzish (Zixuan Wu) Differential Revision: https://reviews.llvm.org/D52074 llvm-svn: 342614
* Thread Safety Analysis: warnings for attributes without argumentsAaron Puchert2018-09-202-21/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When thread safety annotations are used without capability arguments, they are assumed to apply to `this` instead. So we warn when either `this` doesn't exist, or the class is not a capability type. This is based on earlier work by Josh Gao that was committed in r310403, but reverted in r310698 because it didn't properly work in template classes. See also D36237. The solution is not to go via the QualType of `this`, which is then a template type, hence the attributes are not known because it could be specialized. Instead we look directly at the class in which we are contained. Additionally I grouped two of the warnings together. There are two issues here: the existence of `this`, which requires us to be a non-static member function, and the appropriate annotation on the class we are contained in. So we don't distinguish between not being in a class and being static, because in both cases we don't have `this`. Fixes PR38399. Reviewers: aaron.ballman, delesley, jmgao, rtrieu Reviewed By: delesley Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51901 llvm-svn: 342605
* Thread safety analysis: Handle ObjCIvarRefExpr in SExprBuilder::translateAaron Puchert2018-09-191-0/+44
| | | | | | | | | | | | | | | | | Summary: This imitates the code for MemberExpr. Fixes PR38896. Reviewers: aaron.ballman, delesley, lukasza, rjmccall Reviewed By: delesley Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52200 llvm-svn: 342600
* test: actually fix the condition properlySaleem Abdulrasool2018-09-191-1/+1
| | | | | | | | I had locally changed the test to add an explicit triple to figure out the issue with the SCEI buildbots, and that hid the error. This now works with and without the explicit triple. llvm-svn: 342581
* test: improve condition for the checkSaleem Abdulrasool2018-09-191-1/+1
| | | | | | | When the type of `wint_t` is `int`, the promotion will allow this to pass. Check this explicitly rather than using the size. llvm-svn: 342569
* Sema: handle `wint_t` more carefully for printf checkingSaleem Abdulrasool2018-09-192-2/+5
| | | | | | | | | In the case that `win_t` is an `unsigned short` (e.g. on Windows), we would previously incorrectly diagnose the conversion because we would immediately promote the argument type from `wint_t` (aka `unsigned short`) to `int` before checking if the type matched. This should repair the Windows hosted bots. llvm-svn: 342565
* Basic: correct `__WINT_TYPE__` on WindowsSaleem Abdulrasool2018-09-193-6/+7
| | | | | | | | | Windows uses `unsigned short` for `wint_t`. Correct the type definition as vended by the compiler. This type is defined in corecrt.h and is unconditionally typedef'ed. cl does not have an equivalent to `__WINT_TYPE__` which is why this was never detected. llvm-svn: 342557
* [Sema] Do not load macros from preamble when LoadExternal is false.Eric Liu2018-09-191-1/+8
| | | | | | | | | | | | Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52079 llvm-svn: 342528
* Thread safety analysis: Fix crash for function pointersAaron Puchert2018-09-191-0/+5
| | | | | | | | For function pointers, the FunctionDecl of the callee is unknown, so getDirectCallee will return nullptr. We have to catch that case to avoid crashing. We assume there is no attribute then. llvm-svn: 342519
OpenPOWER on IntegriCloud