summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* When performing an implicit from float to bool, the floating point value ↵Aaron Ballman2015-12-301-0/+11
| | | | | | | | must be *exactly* zero in order for the conversion to result in 0. This does not involve a conversion through an integer value, and so truncation of the value is not performed. This patch address PR25876. llvm-svn: 256643
* Disable generating movt on FreeBSD.Davide Italiano2015-12-301-0/+5
| | | | | | | | | | It's sort of an hack, but we have no choice. The linker in the base system doesn't handle that correctly (yet). Once FreeBSD will import lld, this can be backed out. Patch by: Andrew Turner! llvm-svn: 256641
* [OPENMP 4.5] Allow 'ordered' clause on 'loop simd' constructs.Alexey Bataev2015-12-307-12/+50
| | | | | | OpenMP 4.5 allows to use 'ordered' clause without parameter on 'loop simd' constructs. llvm-svn: 256639
* [MS ABI] Add variable templates to the NameBackReferencesDavid Majnemer2015-12-301-0/+6
| | | | | | | | Only function template specializations are exempt from being added to the NameBackReferences. Redundant variable template specializations should be appropriately substituted. llvm-svn: 256623
* [MS ABI] Improve our mangling of pass_object_sizeDavid Majnemer2015-12-301-0/+4
| | | | | | | | | | | | | | We didn't add the artificial pass_object_size arguments to the backreference map which bloated the size of manglings which involved pass_object_size with duplicate types. This lets us go from: ?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@0W4__pass_object_size1@3@@Z to: ?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@01@Z llvm-svn: 256622
* [analyzer] Handle another Android assert function.Devin Coughlin2015-12-301-0/+12
| | | | | | | | | | | Android's assert can call both the __assert and __assert2 functions under the cover, but the NoReturnFunctionChecker does not handle the latter. This commit fixes that. A patch by Yury Gribov! Differential Revision: http://reviews.llvm.org/D15810 llvm-svn: 256605
* [analyzer] Suppress nullability warning for _Nonnull locals zero-initialized ↵Devin Coughlin2015-12-291-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | by ObjC ARC. Prevent the analyzer from warning when a _Nonnnull local variable is implicitly zero-initialized because of Objective-C automated reference counting. This avoids false positives in cases where a _Nonnull local variable cannot be initialized with an initialization expression, such as: NSString * _Nonnull s; // no-warning @autoreleasepool { s = ...; } The nullability checker will still warn when a _Nonnull local variable is explicitly initialized with nil. This suppression introduces the potential for false negatives if the local variable is used before it is assigned a _Nonnull value. Based on a discussion with Anna Zaks, Jordan Rose, and John McCall, I've added a FIXME to treat implicitly zero-initialized _Nonnull locals as uninitialized in Sema's UninitializedValues analysis to avoid these false negatives. rdar://problem/23522311 llvm-svn: 256603
* When a namespace alias redeclares a using declaration, point the diagnostic atRichard Smith2015-12-291-0/+11
| | | | | | the using declaration not at the thing it's using. llvm-svn: 256602
* Model NamespaceAliasDecls as having their nominated namespace as an underlyingRichard Smith2015-12-292-3/+25
| | | | | | | | | | | | | declaration. This fixes an issue where we would reject (due to a claimed ambiguity) a case where lookup finds multiple NamespaceAliasDecls from different scopes that nominate the same namespace. The C++ standard doesn't make it clear that such a case is in fact valid (which I'm working on fixing), but there are no relevant rules that distinguish using declarations and namespace alias declarations here, so it makes sense to treat them the same way. llvm-svn: 256601
* Fix test from r256596Nico Weber2015-12-291-1/+1
| | | | llvm-svn: 256599
* Emit a -Wmicrosoft warning when treating ^Z as EOF in MS mode.Nico Weber2015-12-291-2/+2
| | | | llvm-svn: 256596
* Emit a -Wmicrosoft warning when pasting /##/ into a comment token in MS mode.Nico Weber2015-12-291-2/+5
| | | | llvm-svn: 256595
* [MS ABI] Invent a mangling for reference temporariesDavid Majnemer2015-12-291-0/+4
| | | | | | | | | MSVC is non-conforming and doesn't have a mangling for these. Invent our own to unblock folks using clang. This fixes PR25795. llvm-svn: 256589
* [MS ABI] Add a mangling for _ComplexDavid Majnemer2015-12-291-0/+4
| | | | | | | | | | | | | MSVC doesn't implement a mangling for C99's _Complex so we must invent our own. For now, treating it like a class type called _Complex in the __clang namespace. This means that 'void f(__Complex int))' will demangle as: 'void f(struct __clang::_Complex<int>)' llvm-svn: 256583
* Teach typo correction to properly handle mapping declarations to theirRichard Smith2015-12-291-1/+8
| | | | | | | | | | underlying decls. Preserve the found declaration throughout, and only map to the underlying declaration when we want to check whether it's the right kind. This allows us to provide the right source location for the found declaration, and prepares for the possibility of underlying decls with a different name from the found decl. llvm-svn: 256575
* [analyzer] Nullability: allow cast to _Nonnull to suppress warning about ↵Devin Coughlin2015-12-291-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | returning nil. The nullability checker currently allows casts to suppress warnings when a nil literal is passed as an argument to a parameter annotated as _Nonnull: foo((NSString * _Nonnull)nil); // no-warning It does so by suppressing the diagnostic when the *type* of the argument expression is _Nonnull -- even when the symbolic value returned is known to be nil. This commit updates the nullability checker to similarly honor such casts in the analogous scenario when nil is returned from a function with a _Nonnull return type: return (NSString * _Nonnull)nil; // no-warning This commit also normalizes variable naming between the parameter and return cases and adds several tests demonstrating the limitations of this suppression mechanism (such as when nil is cast to _Nonnull and then stored into a local variable without a nullability qualifier). These tests are marked with FIXMEs. rdar://problem/23176782 llvm-svn: 256567
* [MS ABI] Implement a mangling for _Atomic typesDavid Majnemer2015-12-291-0/+5
| | | | | | | | | | | | | MSVC doesn't implement a mangling for C11's _Atomic so we must invent our own. For now, treating it like a class type called _Atomic in the __clang namespace. This means that 'void f(__Atomic(int))' will demangle as: 'void f(struct __clang::_Atomic<int>)' llvm-svn: 256557
* [MS ABI] Cleanup our mangling of vector typesDavid Majnemer2015-12-291-2/+2
| | | | | | | | | | | | | | We used to produce a type which demangled to: union __clang_vec8_F That 'F' is the mangling for 'short' but it is present in the mangled name in an inappropriate place, leading to it not getting demangled. Instead, create a synthetic class type in a synthetic namespace called __clang. With this, it now demangles to: union __clang::__vector<short,8> llvm-svn: 256556
* [ms inline asm] Add support for label names with '$' charsMarina Yatsina2015-12-291-0/+9
| | | | | | | | | In MS inline asm syntax a label with '$' char produces an error, while in AT&T it does not. In AT&T inline asm syntax Clang escapes the '$' char and replaces it with "$$". Adopted same approach for MS syntax. Differential Revision: http://reviews.llvm.org/D15795 llvm-svn: 256545
* We check for dwarf 5 in the backend, so go ahead and pass it along viaEric Christopher2015-12-281-0/+2
| | | | | | | | | | the front end as well. Note that DWARF5 isn't finalized and any feature support is subject to change and accepting of the option doesn't mean we're supporting the full range of the current standard. llvm-svn: 256516
* Do not crash if class is defined in wrong scope.Serge Pavlov2015-12-281-0/+16
| | | | | | | | | | | This patch fixes PR16677. The latter represents the case when due to misprinted character class definition occurs in the scope of template arguments. Base class of this class depends on the template parameter in the same scope and cannot be resolved, it causes crash. Right behavior is to make semantic processing even if the definition is wrong, as the code that emits appropriate message is called after the processing. llvm-svn: 256511
* [X86] Better support for the MCU psABI (clang part)Michael Kuperstein2015-12-281-18/+25
| | | | | | | | | | | | | | | | This adds support for the MCU psABI in a way different from r251223 and r251224, basically reverting most of these two patches. The problem with the approach taken in r251223/4 is that it only handled libcalls that originated from the backend. However, the mid-end also inserts quite a few libcalls and assumes these use the platform's default calling convention. The previous patch tried to insert inregs when necessary both in the FE and, somewhat hackily, in the CG. Instead, we now define a new default calling convention for the MCU, which doesn't use inreg marking at all, similarly to what x86-64 does. Differential Revision: http://reviews.llvm.org/D15055 llvm-svn: 256495
* [OPENMP 4.5] Sema/parsing support for extended format of 'schedule' clause.Alexey Bataev2015-12-284-24/+52
| | | | | | | | | OpenMP 4.0-3.1 supports the next format of ‘schedule’ clause: schedule(kind[, chunk_size]) Where kind can be one of ‘static’, ‘dynamic’, ‘guided’, ‘auto’ or ‘runtime’. OpenMP 4.5 defines the format: schedule([modifier [, modifier]:]kind[, chunk_size]) Modifier can be one of ‘monotonic’, ‘nonmonotonic’ or ‘simd’. llvm-svn: 256487
* [OPENMP 4.5] Do not allow 'linear' clause along with 'ordered(expr)' clause.Alexey Bataev2015-12-283-4/+8
| | | | | | According to OpenMP 4.5 "A linear clause or an ordered clause with a parameter can be specified on a loop directive but not both."" llvm-svn: 256485
* On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to ↵Dimitry Andric2015-12-271-0/+6
| | | | | | | | | | | | | | | | the assembler. Summary: See also: https://sourceware.org/binutils/docs/as/MIPS-Options.html#index-g_t_0040code_007b_002dG_007d-option-_0028MIPS_0029-1392 Reviewers: theraven, atanasyan, brooks, emaste Subscribers: rnk, emaste, cfe-commits, seanbruno, dim Differential Revision: http://reviews.llvm.org/D10137 llvm-svn: 256468
* Fix C++ support on recent DragonFly BSD releasesDimitry Andric2015-12-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [ Copied from https://llvm.org/bugs/show_bug.cgi?id=25597 ] Clang support for DragonFly BSD is lagging a bit, resulting in poor support for c++. DragonFlyBSD is unique in that it has two base compilers. At the time of the last Clang update for DragonFly, these compilers were GCC 4.4 and GCC 4.7 (default). With DragonFly Release 4.2, GCC 4.4 was replaced with GCC 5.0, partially because the C++11 support of GCC 4.7 was incomplete. The DragonFly project will Release version 4.4 soon. This patch updates the Clang driver to use libstdc++ from GCC 5.2 The support for falling back to the alternate compiler was removed for two reasons: 1) The last release to use GCC 4.7 is DF 4.0 which has already reached EOL 2) GCC 4.7 libstdc++ is insufficient for many "ports" Therefore, I think it is reasonable that the development version of clang expects GCC 5.2 to be in place and not try to fall back to another compiler. The attached patch will do this. The Tools.cpp file was signficantly modified to fix the linking which had been changed somewhere along the line. The rest of the changes should be self-explanatory. Reviewers: joerg, rsmith, davide Subscribers: jrmarino, davide, cfe-commits Differential Revision: http://reviews.llvm.org/D15166 llvm-svn: 256467
* For FreeBSD on mips, pass -G options to the linkerDimitry Andric2015-12-271-0/+5
| | | | | | | | | | | | | | | | | Summary: On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to the linker. See also: https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-G-2007 This has been adapted from https://reviews.freebsd.org/D1190, with an added test case. Reviewers: theraven, atanasyan, emaste Subscribers: brooks, tomatabacu, cfe-commits, seanbruno, emaste Differential Revision: http://reviews.llvm.org/D9114 llvm-svn: 256461
* Prune the feature "tls". No one is using it since TLS is enabled for Cygwin.NAKAMURA Takumi2015-12-271-4/+0
| | | | llvm-svn: 256457
* [OPENMP] Do not allow to use threadprivate or thread local variables as loop ↵Alexey Bataev2015-12-257-0/+14
| | | | | | | | iteration variables. According to OpenMP the loop iteration variable may not appear in a threadprivate directive. llvm-svn: 256417
* fix test that depends on LLVM optimizationsSanjay Patel2015-12-241-1/+4
| | | | llvm-svn: 256395
* [X86][ms-inline asm] Test case for adding support for memory operands that ↵Marina Yatsina2015-12-241-0/+32
| | | | | | | | | | include structs Test case for commit 256381 Differential Revision: http://reviews.llvm.org/D15749 llvm-svn: 256382
* [OPENMP 4.5] Parsing/sema for 'depend(sink:vec)' clause in 'ordered' directive.Alexey Bataev2015-12-232-10/+48
| | | | | | OpenMP 4.5 adds 'depend(sink:vec)' in 'ordered' directive for doacross loop synchronization. Patch adds parsing and semantic analysis for this clause. llvm-svn: 256330
* Make wasm-toolchain.c test pass on Windows.Nico Weber2015-12-221-1/+1
| | | | llvm-svn: 256286
* [OpenCL] Fix atomic Builtins check for address spaces of non-atomic pointerAnastasia Stulova2015-12-222-3/+17
| | | | | | | | | | | If there are two pointers passed to an atomic Builtin, Clang doesn't allow the second (non-atomic) one to be qualified with an address space. Remove this restriction by recording the address space of passed pointers in atomics type diagnostics. llvm-svn: 256243
* [mips] Add _GCC_HAVE_SYNC_COMPARE_AND_SWAP macros.Daniel Sanders2015-12-221-0/+12
| | | | | | | This fixes the 'pure virtual function called' failure with ThreadPool in a clang-built clang. This fixes the llvm-mips-linux builder. llvm-svn: 256240
* [OPENMP] Revert r256238 to fix the problem with tests on Linux.Alexey Bataev2015-12-222-48/+10
| | | | llvm-svn: 256239
* [OPENMP 4.5] Parsing/sema for 'depend(sink:vec)' clause in 'ordered' directive.Alexey Bataev2015-12-222-10/+48
| | | | | | OpenMP 4.5 adds 'depend(sink:vec)' in 'ordered' directive for doacross loop synchronization. Patch adds parsing and semantic analysis for this clause. llvm-svn: 256238
* Use -no-canonical-prefixes to make sure binaries names are easier to match.Eric Christopher2015-12-221-1/+1
| | | | llvm-svn: 256228
* [WebAssembly] Remove the -target command-line flag from the ld commandline.Dan Gohman2015-12-211-0/+3
| | | | | | | | This flag isn't needed, or permitted, with the "ld" flavor of lld. Also, add a basic ld commandline test. llvm-svn: 256216
* [clang-cl] Add support for /BreproDavid Majnemer2015-12-212-0/+26
| | | | | | | | | | | | The /Brepro flag controls whether or not the compiler should embed timestamps into the object file. Object files which do not embed timestamps are not suitable for incremental linking but are suitable for hermetic build systems and staged self-hosts of clang. A normal clang spelling of this flag has been added, -mincremental-linker-compatible. llvm-svn: 256204
* Tweak myriad-toolchain test.James Y Knight2015-12-211-2/+2
| | | | | | | The test failed when run on a SPARC host, since it was finding the native gcc installation by accident. llvm-svn: 256191
* Reapply "[CodeGen] Fix assignments of inline layouts into the byref structure"Vedant Kumar2015-12-211-0/+15
| | | | | | | | | | | | | | | | | | | When using blocks, a byref structure is created to represent the closure. The "byref.layout" field of this structure is an i8*. However, some 'inline' layouts are represented as i64's, not i8*'s. Prior to r246985 we cast the i64 'inline' layout to an i8* before assigning it into the byref structure. This patch brings the cast back and adds a regression test. The original version of this patch was too invasive. This version only adds the cast to BuildByrefLayout. Differential Revision: http://reviews.llvm.org/D15674 rdar://23713871 llvm-svn: 256190
* Revert "[CodeGen] Fix assignments of inline layouts into the byref structure"Vedant Kumar2015-12-211-15/+0
| | | | | | This reverts commit r256185. It breaks CodeGenObjC/fragile-arc.m. llvm-svn: 256186
* [CodeGen] Fix assignments of inline layouts into the byref structureVedant Kumar2015-12-211-0/+15
| | | | | | | | | | | | | | When using blocks, a byref structure is created to represent the closure. The "byref.layout" field of this structure is an i8*. However, some 'inline' layouts are represented as i64's, not i8*'s. Prior to r246985 we cast the i64 'inline' layout to an i8* before assigning it into the byref structure. This patch brings the cast back and adds a regression test. rdar://23713871 llvm-svn: 256185
* [Driver] Pass -O* to the gold plugin via -plugin-optJames Molloy2015-12-211-3/+6
| | | | | | The gold plugin understands -O0..-O3, but these are not currently being passed to it. llvm-svn: 256146
* [Cygwin] Enable TLS as emutls.NAKAMURA Takumi2015-12-213-4/+0
| | | | | | | | It resolves clang selfhosting with std::once() for Cygwin. FIXME: It may be EmulatedTLS-generic also for X86-Android. FIXME: Pass EmulatedTLS to LLVM CodeGen from Clang with -femulated-tls. llvm-svn: 256134
* [X86] Add missing m64/int64 conversionsMichael Kuperstein2015-12-201-0/+12
| | | | | | | | Define the 64-bit equivalents of _m_to_int and _m_from_int. Differential Revision: http://reviews.llvm.org/D15572 llvm-svn: 256122
* [X86] Add signed aliases for popcnt intrinsicsMichael Kuperstein2015-12-201-2/+12
| | | | | | | | | The Intel manual documents both an unsigned form (_mm_popcnt_u32) and a signed form (_popcnt32) of the intrinsic. Add the missing signed form. Differential Revision: http://reviews.llvm.org/D15568 llvm-svn: 256121
* Driver part of debugger tuning.Paul Robinson2015-12-192-5/+39
| | | | | | | | | | | | | | | | Adds driver options named -glldb and -gsce to mean -g plus tuning for lldb and SCE debuggers respectively; the existing -ggdb option does the same for gdb. Existing options -ggdb0, -ggdb1 etc. unpack into -ggdb -g<N>. (There will not be -glldb<N> or -gsce<N> options.) The tuning gets a target-specific default in the driver, and is passed into cc1 with the new -debugger-tuning option. As fallout, fixes where '-gsplit-dwarf -g0' would ignore the -g0 part on Linux. Differential Revision: http://reviews.llvm.org/D15651 llvm-svn: 256104
* Test for diagnostic quality improvement in r256049.Richard Smith2015-12-191-0/+7
| | | | llvm-svn: 256083
OpenPOWER on IntegriCloud