summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Don't enable PIE on i686-unknown-cloudabi.Ed Schouten2016-08-112-5/+17
| | | | | | | | We're only going to provide support for using PIE on architectures that provide PC-relative addressing. i686 is not one of those, so add the necessary bits for only passing in -pie -zrelro conditionally. llvm-svn: 278395
* Pass in frame pointer omitting compiler flags for CloudABI as well.Ed Schouten2016-08-111-0/+9
| | | | | | | | | On Linux we pass in -fomit-frame-pointer flags (and similar) automatically if optimization is enabled. Let's do the same thing on CloudABI. Without this, Clang seems to run out of registers quite quickly while trying to build code with inline assembly. llvm-svn: 278393
* [analyzer] Teach RetainCountChecker about CVFooRetainDevin Coughlin2016-08-111-0/+20
| | | | | | | | | | | | Change the retain count checker to treat CoreFoundation-style "CV"-prefixed reference types from CoreVideo similarly to CoreGraphics types. With this change, we treat CVFooRetain() on a CVFooRef type as a retain. CVFooRelease() APIs are annotated as consuming their parameter, so this change prevents false positives about incorrect decrements of reference counts. <rdar://problem/27116090> llvm-svn: 278382
* Reapply [Sema] Add sizeof diagnostics for bzeroBruno Cardoso Lopes2016-08-101-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | Reapply r277787. For memset (and others) we can get diagnostics like: struct stat { int x; }; void foo(struct stat *stamps) { bzero(stamps, sizeof(stamps)); memset(stamps, 0, sizeof(stamps)); } t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess] memset(stamps, 0, sizeof(stamps)); ~~~~~~ ^~~~~~ t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(stamps, 0, sizeof(stamps)); ^~~~~~ This patch implements the same class of warnings for bzero. Differential Revision: https://reviews.llvm.org/D22525 rdar://problem/18963514 llvm-svn: 278264
* [analyzer] Fix a crash in CloneDetector when calling functions by pointers.Artem Dergachev2016-08-101-0/+12
| | | | | | | | | | | CallExpr may have a null direct callee when the callee function is not known in compile-time. Do not try to take callee name in this case. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23320 llvm-svn: 278238
* [OpenCL] Fix typo in test that I accidentally introduced in my previous commit.Joey Gouly2016-08-101-1/+1
| | | | llvm-svn: 278235
* [OpenCL] Change block descriptor address space to constant.Joey Gouly2016-08-101-7/+7
| | | | | | | The block descriptor is a GlobalVariable in the LLVM IR, so it shouldn't be in the private address space. llvm-svn: 278234
* [X86][AVX512] lower __mm512_andnot_ps/__mm512_andnot_pd to IRLama Saba2016-08-101-2/+4
| | | | | | | Differential revision: https://reviews.llvm.org/D23262 llvm-svn: 278209
* [X86][AVX] Ensure we only match against 1-byte alignmentSimon Pilgrim2016-08-101-2/+2
| | | | llvm-svn: 278208
* Make clang-format remove duplicate headers when sorting #includes.Eric Liu2016-08-101-0/+14
| | | | | | | | | | | | Summary: When sorting #includes, #include directives that have the same text will be deduplicated when sorting #includes, and only the first #include in the duplicate #includes remains. If the `Cursor` is provided and put on a deleted #include, it will be put on the remaining #include in the duplicate #includes. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D23274 llvm-svn: 278206
* [x86] Fix a really nasty bug introduced in r276417 where alignmentChandler Carruth2016-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | constraints were added to _mm256_broadcast_{pd,ps} intel intrinsics. The spec for these intrinics is ... pretty much silent on alignment. This is especially frustrating considering the amount of discussion of alignment in the load and store instrinsics. So I was forced to rely on the specification for the VBROADCASTF128 instruction. That instruction's spec is *also* completely silent on alignment. Fortunately, when it comes to the instruction's spec, silence is enough. There is no #GP fault option for an underaligned address so this instruction, and by inference the intrinsic, can read any alignment. As it happens, the old code worked exactly this way and in fact we have plenty of code that hands pointers with less than 16-byte alignment to these intrinsics. This code broke pretty spectacularly with this commit. Fortunately, the fix is super simple! Change a 16 to a 1, and ta da! Anyways, a lot of debugging for a really boring fix. =] llvm-svn: 278202
* [CUDA] Reject calls to __device__ functions from host variable global ↵Justin Lebar2016-08-101-0/+32
| | | | | | | | | | | | initializers. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23335 llvm-svn: 278196
* [CUDA] Print a "previous-decl" note when calling an illegal member fn.Justin Lebar2016-08-101-3/+3
| | | | | | | | | | | | | | | Summary: When we emit err_ref_bad_target, we should emit a "'method' declared here" note. We already do so in most places, just not in BuildCallToMemberFunction. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23240 llvm-svn: 278195
* [OpenCL] Handle -cl-fp32-correctly-rounded-divide-sqrtYaxun Liu2016-08-092-4/+18
| | | | | | | | Let the driver pass the option to frontend. Do not set precision metadata for division instructions when this option is set. Set function attribute "correctly-rounded-divide-sqrt-fp-math" based on this option. Differential Revision: https://reviews.llvm.org/D22940 llvm-svn: 278155
* [OpenCL][AMDGPU] Add support for -cl-denorms-are-zeroYaxun Liu2016-08-091-1/+9
| | | | | | | | | | | | Adjust target features for amdgcn target when -cl-denorms-are-zero is set. Denormal support is controlled by feature strings fp32-denormals fp64-denormals in amdgcn target. If -cl-denorms-are-zero is not set and the command line does not set fp32/64-denormals feature string, +fp32-denormals +fp64-denormals will be on for GPU's supporting them. A new virtual function virtual void TargetInfo::adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const is introduced to allow adjusting target option by codegen option. Differential Revision: https://reviews.llvm.org/D22815 llvm-svn: 278151
* Add a missing -no-canonical-prefixes.Benjamin Kramer2016-08-091-1/+1
| | | | llvm-svn: 278148
* [CUDA] Regression test to make sure C++ include path are forwarded to host ↵Samuel Antao2016-08-091-0/+10
| | | | | | | | | | | | | | and device frontends. Summary: Add test to detect the C++ include paths are passed to both CUDA host and device frontends. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22946 llvm-svn: 278140
* [clang-cl] Make -gline-tables-only imply -gcodeviewReid Kleckner2016-08-091-0/+4
| | | | | | | | | It's surprising that you have to pass /Z7 in addition to -gcodeview to get debug info. The sanitizer runtime, for example, expects that if the compiler supports the -gline-tables-only flag, then it will emit debug info. llvm-svn: 278139
* Revert "[Attr] Add support for the `ms_hook_prologue` attribute."Charles Davis2016-08-083-35/+0
| | | | | | | This reverts commit r278050. It depends on r278048, which will be reverted. llvm-svn: 278052
* [Attr] Add support for the `ms_hook_prologue` attribute.Charles Davis2016-08-083-0/+35
| | | | | | | | | | | | | | | | | | | | | | | Summary: Based on a patch by Michael Mueller. This attribute specifies that a function can be hooked or patched. This mechanism was originally devised by Microsoft for hotpatching their binaries (which they're constantly updating to stay ahead of crackers, script kiddies, and other ne'er-do-wells on the Internet), but it's now commonly abused by Windows programs that want to hook API functions. It is for this reason that this attribute was added to GCC--hence the name, `ms_hook_prologue`. Depends on D19908. Reviewers: rnk, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D19909 llvm-svn: 278050
* [analyzer] Change -analyze-function to accept qualified names.Artem Dergachev2016-08-084-27/+61
| | | | | | | | | | | | | | | Both -analyze-function and -analyzer-display-progress now share the same convention for naming functions, which allows discriminating between methods with the same name in different classes, C++ overloads, and also presents Objective-C instance and class methods in the convenient notation. This also allows looking up the name for the particular function you're trying to restrict analysis to in the -analyzer-display-progress output, in case it was not instantly obvious. Differential Revision: https://reviews.llvm.org/D22856 llvm-svn: 278018
* [ARM] Command-line options for embedded position-independent codeOliver Stannard2016-08-081-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (with the corresponding ARM backend patch) adds support for some new relocation models: * Read-only position independence (ROPI): Code and read-only data is accessed PC-relative. The offsets between all code and RO data sections are known at static link time. * Read-write position independence (RWPI): Read-write data is accessed relative to a static base register. The offsets between all writeable data sections are known at static link time. These two modes are independent (they specify how different objects should be addressed), so they can be used individually or together. These modes are intended for bare-metal systems or systems with small real-time operating systems. They are designed to avoid the need for a dynamic linker, the only initialisation required is setting the static base register to an appropriate value for RWPI code. There is one C construct not currently supported by these modes: global variables initialised to the address of another global variable or function, where that address is not known at static-link time. There are a few possible ways to solve this: * Disallow this, and require the user to write their own initialisation function if they need variables like this. * Emit dynamic initialisers for these variables in the compiler, called from the .init_array section (as is currently done for C++ dynamic initialisers). We have a patch to do this, described in my original RFC email (http://lists.llvm.org/pipermail/llvm-dev/2015-December/093022.html), but the feedback from that RFC thread was that this is not something that belongs in clang. * Use a small dynamic loader to fix up these variables, by adding the difference between the load and execution address of the relevant section. This would require linker co-operation to generate a table of addresses that need fixing up. Differential Revision: https://reviews.llvm.org/D23196 llvm-svn: 278016
* [analyzer] Command line option to show enabled checker list.Gabor Horvath2016-08-081-0/+20
| | | | | | | | | | | | This patch adds a command line option to list the checkers that were enabled by analyzer-checker and not disabled by -analyzer-disable-checker. It can be very useful to debug long command lines when it is not immediately apparent which checkers are turned on and which checkers are turned off. Differential Revision: https://reviews.llvm.org/D23060 llvm-svn: 278006
* [analyzer] Model base to derived casts more precisely.Gabor Horvath2016-08-081-0/+16
| | | | | | | | | | | | | | Dynamic casts are handled relatively well by the static analyzer. BaseToDerived casts however are treated conservatively. This can cause some false positives with the NewDeleteLeaks checker. This patch alters the behavior of BaseToDerived casts. In case a dynamic cast would succeed use the same semantics. Otherwise fall back to the conservative approach. Differential Revision: https://reviews.llvm.org/D23014 llvm-svn: 277989
* Fix two bugs for musl-libc on ARMDiana Picus2016-08-081-0/+12
| | | | | | | | | | | | | | | Bug 1: triples like armv7-pc-linux-musl use the wrong linker name ld-musl-armv7.so.1; the right name should be ld-musl-arm.so.1, disregarding the subarch field. Bug 2: when compiler option -mhard-float is used, we should use the "hardfloat" linker, no matter whether the triple itself mentions "hardfloat". Patch by Lei Zhang! Differential Revision: https://reviews.llvm.org/D22904 llvm-svn: 277985
* [AVX512] integer comparisions enumeration.Asaf Badouh2016-08-072-39/+39
| | | | | | | | | | fix Bug 28842 https://llvm.org/bugs/show_bug.cgi?id=28842 Differential Revision: https://reviews.llvm.org/D22212 llvm-svn: 277955
* Update clang tests for LLVM r277950David Majnemer2016-08-071-2/+2
| | | | | | | We infer inbounds on GEPs of allocas leading to minor perturbations in tests. llvm-svn: 277953
* Headers: Add ARM support to intrin.h for MSVC compatibilitySaleem Abdulrasool2016-08-061-0/+4
| | | | | | | | | | | | | | | | | This fixes compiling with headers from the Windows SDK for ARM, where the YieldProcessor function (in winnt.h) refers to _ARM_BARRIER_ISHST. The actual MSVC armintr.h contains a lot more definitions, but this is enough to build code that uses the Windows SDK but doesn't use ARM intrinsics directly. An alternative would to just keep the addition to intrin.h (to include armintr.h), but not actually ship armintr.h, instead having clang's intrin.h include armintr.h from MSVC's include directory. (That one works fine with clang, at least for building code that uses the Windows SDK.) Patch by Martin Storsjö! llvm-svn: 277928
* Fix typos from r277797 and unused variable from r277889.Richard Trieu2016-08-061-3/+0
| | | | llvm-svn: 277900
* Fix two false positives in -Wreturn-stack-addressRichard Trieu2016-08-051-1/+63
| | | | | | | | | | | If the return type is a pointer and the function returns the reference to a pointer, don't warn since only the value is returned, not the reference. If a reference function parameter appears in the reference chain, don't warn since binding happens at the caller scope, so addresses returned are not to local stack. This includes default arguments as well. llvm-svn: 277889
* Fix false positive in -Wunsequenced and templates.Richard Trieu2016-08-051-0/+55
| | | | | | | | | | | | | | For builtin logical operators, there is a well-defined ordering of argument evaluation. For overloaded operator of the same type, there is no argument evaluation order, similar to other function calls. When both are present, uninstantiated templates with an operator&& is treated as an unresolved function call. Unresolved function calls are treated as normal function calls, and may result in false positives when the builtin logical operator is used. Have the unsequenced checker ignore dependent expressions to avoid this false positive. The check also happens in template instantiations to catch when the overloaded operator is used. llvm-svn: 277866
* PR26423: Assert on valid use of using declaration of a function with an ↵David Blaikie2016-08-051-4/+22
| | | | | | | | | | | | undeduced auto return type For now just disregard the using declaration in this case. Suboptimal, but wiring up the ability to have declarations of functions that are separate from their definition (we currently only do that for member functions) and have differing return types (we don't have any support for that) is more work than seems reasonable to at least fix this crash. llvm-svn: 277852
* Revert "[Sema] Add sizeof diagnostics for bzero"Bruno Cardoso Lopes2016-08-051-43/+0
| | | | | | This reverts commit r277787, which caused PR28870. llvm-svn: 277830
* AMDGPU : Add Clang builtin intrinsics for compare with the fullWei Ding2016-08-052-0/+75
| | | | | | | | wavefront result. Differential Revision: http://reviews.llvm.org/D22934 llvm-svn: 277824
* [OpenMP] Sema and parsing for 'teams distribute' pragmaKelvin Li2016-08-0513-0/+3165
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D23189 llvm-svn: 277818
* Fix crash in template type diffing.Richard Trieu2016-08-051-0/+30
| | | | | | | | | When the type being diffed is a type alias, and the orginal type is not a templated type, then there will be no unsugared TemplateSpecializationType. When this happens, exit early from the constructor. Also add assertions to the other iterator accessor to prevent the iterator from being used. llvm-svn: 277797
* Allow -1 to assign max value to unsigned bitfields.Richard Trieu2016-08-052-1/+13
| | | | | | | | Silence the -Wbitfield-constant-conversion warning for when -1 or other negative values are assigned to unsigned bitfields, provided that the bitfield is wider than the minimum number of bits needed to encode the negative value. llvm-svn: 277796
* [Sema] Add sizeof diagnostics for bzeroBruno Cardoso Lopes2016-08-041-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | For memset (and others) we can get diagnostics like: struct stat { int x; }; void foo(struct stat *stamps) { bzero(stamps, sizeof(stamps)); memset(stamps, 0, sizeof(stamps)); } t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess] memset(stamps, 0, sizeof(stamps)); ~~~~~~ ^~~~~~ t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(stamps, 0, sizeof(stamps)); ^~~~~~ This patch implements the same class of warnings for bzero. Differential Revision: https://reviews.llvm.org/D22525 rdar://problem/18963514 llvm-svn: 277787
* [analyzer] Make CloneDetector recognize different variable patterns.Artem Dergachev2016-08-042-22/+9
| | | | | | | | | | | | | | | | | CloneDetector should be able to detect clones with renamed variables. However, if variables are referenced multiple times around the code sample, the usage patterns need to be recognized. For example, (x < y ? y : x) and (y < x ? y : x) are no longer clones, however (a < b ? b : a) is still a clone of the former. Variable patterns are computed and compared during a separate filtering pass. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D22982 llvm-svn: 277757
* [OpenCL] Add the lit test for image size which was omitted by r277647.Yaxun Liu2016-08-041-0/+18
| | | | llvm-svn: 277756
* [OpenCL] Added underscores to the names of 'to_addr' OpenCL built-ins.Alexey Bader2016-08-041-14/+14
| | | | | | | | | | | | | | | Summary: In order to re-define OpenCL built-in functions 'to_{private,local,global}' in OpenCL run-time library LLVM names must be different from the clang built-in function names. Reviewers: yaxunl, Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23120 llvm-svn: 277743
* After PR28761 use -Wall with -Werror in builtins tests to identifyEric Christopher2016-08-0433-61/+61
| | | | | | possible problems in headers. llvm-svn: 277696
* [clang/test] Fix a flaky unittest on windowsEtienne Bergeron2016-08-031-4/+10
| | | | | | | | | | | | | | | | | | | | Summary: The append operator on a shell command for quick command-line is causing trouble on windows. [NFC] The easiest way to fix them is to avoid using them. This patch is an attempt to fix this broken build bot: clang-x86-win2008-selfhost http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9523 Reviewers: rnk Subscribers: cfe-commits, chrisha Differential Revision: https://reviews.llvm.org/D23105 llvm-svn: 277576
* [index] Fix crash with indexing designated init expressions inside templates.Argyrios Kyrtzidis2016-08-031-0/+12
| | | | | | rdar://27452869 llvm-svn: 277570
* [CUDA] Updated CUDA tests that must run w/o CUDA installation.Artem Belevich2016-08-024-11/+11
| | | | | | | Fixes test failures after r277542 on systems that don't have CUDA installed. llvm-svn: 277552
* [CUDA] Fix libdevice selection.Artem Belevich2016-08-022-10/+40
| | | | | | | | | | | This makes clang's libdevice selection match that of NVCC as described in http://docs.nvidia.com/cuda/libdevice-users-guide/basic-usage.html#version-selection If required libdevice variant is not found, driver now fails with an error. Differential Revision: https://reviews.llvm.org/D23037 llvm-svn: 277542
* [CUDA] Do not allow using NVPTX target for host compilation.Artem Belevich2016-08-022-6/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D23042 llvm-svn: 277537
* [CFG] Fix crash finding destructor of lifetime-extended temporary.Devin Coughlin2016-08-021-0/+15
| | | | | | | | | | | Fix a crash under -Wthread-safety when finding the destructor for a lifetime-extending reference. A patch by Nandor Licker! Differential Revision: https://reviews.llvm.org/D22419 llvm-svn: 277522
* Update Clang Parser test error message to match new parser errorsNirav Dave2016-08-021-1/+1
| | | | | | Update clang tests in light of r277489. llvm-svn: 277490
* [analyzer] Hotfix for buildbot failure due to unspecified triple in r277449Artem Dergachev2016-08-021-1/+1
| | | | | | | | | If a target triple is not specified, the default host triple is used, which is not good for compiling inline assembler code. Patch by Raphael Isemann! llvm-svn: 277473
OpenPOWER on IntegriCloud