summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* clang/test/Modules/ModuleDebugInfo.cpp: Add -triple %itanium to appease ↵NAKAMURA Takumi2015-09-081-2/+2
| | | | | | | | ms-targeted builds. I think DebugInfo tests may avoid MS stuff for now. llvm-svn: 247093
* Collect SEH captures in a set instead of a vector to avoidJohn McCall2015-09-081-0/+30
| | | | | | | | doing redundant work if a variable is used multiple times. Fixes PR24751. llvm-svn: 247075
* [Static Analyzer] Objective-C Generics Checker improvements.Gabor Horvath2015-09-081-319/+893
| | | | | | Differential Revision: http://reviews.llvm.org/D12701 llvm-svn: 247071
* Module Debugging: Emit debug type information into clang ObjC modules.Adrian Prantl2015-09-085-7/+44
| | | | | | | | | | When -fmodule-format is set to "obj", emit debug info for all types declared in a module or referenced by a declaration into the module's object file container. This patch adds support for Objective-C types and methods. llvm-svn: 247068
* [Shave]: add a -MT option to moviCompile if there wasn't oneDouglas Katzman2015-09-081-0/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D12622 llvm-svn: 247052
* Module Debugging: Emit debug type information into clang modules.Adrian Prantl2015-09-083-0/+97
| | | | | | | | | | When -fmodule-format is set to "obj", emit debug info for all types declared in a module or referenced by a declaration into the module's object file container. This patch adds support for C and C++ types. llvm-svn: 247049
* Failing test highlighting no poisoning if dtor undeclared.Naomi Musgrave2015-09-081-0/+15
| | | | | | | | | | | | | | | | | | | | | Summary: If class or struct has not declared a destructor, no destructor is emitted, and members are not poisoned after destruction. This case highlights bug in current implementation of use-after-dtor poisoning (detailed in https://github.com/google/sanitizers/issues/596). Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12616 Only check simplest object for existence of sanitizing callback. Rename test. llvm-svn: 247025
* clang/test/CodeGen/complex-convert.c: Appease for targeting powerpc64-*.NAKAMURA Takumi2015-09-081-0/+2
| | | | llvm-svn: 247015
* findDominatingStoreToReturn in CGCall.cpp didn't check if a candidate storeJakub Kuderski2015-09-081-0/+17
| | | | | | | | | | | | | | instruction used the ReturnValue as pointer operand or value operand. This led to wrong code gen - in later stages (load-store elision code) the found store and its operand would be erased, causing ReturnValue to become a <badref>. The patch adds a check that makes sure that ReturnValue is a pointer operand of store instruction. Regression test is also added. This fixes PR24386. Differential Revision: http://reviews.llvm.org/D12400 llvm-svn: 247003
* Fix clang/test/CodeGen/mips-varargs.c for -Asserts, possibly typo.NAKAMURA Takumi2015-09-081-1/+1
| | | | llvm-svn: 246994
* Another fix to this test, this one apparently working byJohn McCall2015-09-081-0/+1
| | | | | | coincidence on all bots. llvm-svn: 246993
* Fix clang/test/CodeGenCXX/alignment.cpp for -Asserts.NAKAMURA Takumi2015-09-081-0/+1
| | | | llvm-svn: 246992
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-0864-894/+1112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* [X86][SSE4A] Added SSE4A IR + assembly codegen builtin testsSimon Pilgrim2015-09-071-14/+25
| | | | llvm-svn: 246974
* [X86][SSSE3] Added SSSE3 IR + assembly codegen builtin testsSimon Pilgrim2015-09-062-10/+127
| | | | | | Transferred SSSE3 instructions from sse-builtins.c llvm-svn: 246948
* [X86]][SSE3] Added SSE41 IR + assembly codegen builtin testsSimon Pilgrim2015-09-062-162/+433
| | | | | | Transferred SSE41 instructions from sse-builtins.c llvm-svn: 246947
* Refactoring of how ARMTargetInfo handles default target features.Alexandros Lamprineas2015-09-061-2/+25
| | | | | | Differential Revision: http://reviews.llvm.org/D11299 llvm-svn: 246946
* [X86]][SSE3] Added SSE3 IR + assembly codegen builtin testsSimon Pilgrim2015-09-061-0/+85
| | | | llvm-svn: 246945
* [X86]][SSE42] Added SSE42 IR + assembly codegen builtin testsSimon Pilgrim2015-09-061-0/+141
| | | | llvm-svn: 246944
* Index: expose visibility attributeSaleem Abdulrasool2015-09-051-0/+13
| | | | | | | Expose the previously unexposed visibility attribute via the python and C bindings. llvm-svn: 246931
* Fix a bug in __builtin_object_size cast removalGeorge Burgess IV2015-09-041-0/+30
| | | | | | | | | | | Apparently there are many cast kinds that may cause implicit pointer arithmetic to happen. In light of this, the cast ignoring logic introduced in r246877 has been changed to only ignore a small set of cast kinds, and a test for this behavior has been added. Thanks to Richard for catching this before it became a bug report. :) llvm-svn: 246890
* Relax partial-init test case for ARMReid Kleckner2015-09-041-1/+1
| | | | llvm-svn: 246889
* Don't crash on a self-alias declarationHal Finkel2015-09-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were crashing in CodeGen given input like this: int self_alias(void) __attribute__((weak, alias("self_alias"))); such a self-alias is invalid, but instead of diagnosing the situation, we'd proceed to produce IR for both the function declaration and the alias. Because we already had a function named 'self_alias', the alias could not be named the same thing, and so LLVM would pick a different name ('self_alias1' for example) for that value. When we later called CodeGenModule::checkAliases, we'd look up the IR value corresponding to the alias name, find the function declaration instead, and then assert in a cast to llvm::GlobalAlias. The easiest way to prevent this is simply to avoid creating the wrongly-named alias value in the first place and issue the diagnostic there (instead of in checkAliases). We detect a related cycle case in CodeGenModule::EmitAliasDefinition already, so this just adds a second such check. Even though the other test cases for this 'alias definition is part of a cycle' diagnostic are in test/Sema/attr-alias-elf.c, I've added a separate regression test for this case. This is because I can't add this check to test/Sema/attr-alias-elf.c without disturbing the other test cases in that file. In order to avoid construction of the bad IR values, this diagnostic is emitted from within CodeGenModule::EmitAliasDefinition (and the relevant declaration is not added to the Aliases vector). The other cycle checks are done within the CodeGenModule::checkAliases function based on the Aliases vector, called from CodeGenModule::Release. However, if there have been errors earlier, HandleTranslationUnit does not call Release, and so checkAliases is never called, and so none of the other diagnostics would be produced. Fixes PR23509. llvm-svn: 246882
* Fix crash on invalid if we can't find a suitable PCH file in a specifiedRichard Smith2015-09-041-2/+8
| | | | | | | directory, and our frontend action cares whether the frontend setup actually succeeded. llvm-svn: 246881
* Don't use unreachable as a placeholder, it confuses EmitBlockReid Kleckner2015-09-041-0/+27
| | | | | | | | | | This fixes an issue raised in D12412, where we generated invalid IR. Thanks to Vedant Kumar for coming up with the initial work around. Differential Revision: http://reviews.llvm.org/D12412 llvm-svn: 246880
* Increase accuracy of __builtin_object_size.George Burgess IV2015-09-041-4/+115
| | | | | | | | | | | | | | | | | | | Improvements: - For all types, we would give up in a case such as: __builtin_object_size((char*)&foo, N); even if we could provide an answer to __builtin_object_size(&foo, N); We now provide the same answer for both of the above examples in all cases. - For type=1|3, we now support subobjects with unknown bases, as long as the designator is valid. Thanks to Richard Smith for the review + design planning. Review: http://reviews.llvm.org/D12169 llvm-svn: 246877
* Don't allow dllexport/import on static local variablesHans Wennborg2015-09-044-14/+13
| | | | | | | | They might technically have external linkage, but it still doesn't make sense for the user to try and export such variables. This matches MSVC's and MinGW's behaviour. llvm-svn: 246864
* Put ext_implicit_lib_function_decl in ImplicitFunctionDeclare.Ed Schouten2015-09-042-2/+2
| | | | | | | | | | | | | | If we build with -Werror=implicit-function-declaration, only implicit function declarations of non-library functions throw compiler errors. For library functions, we only produce a warning. There is no way to promote both of these cases to an error without promoting other warnings. It makes little sense to introduce an additional compiler flag just to control this specific warning. In my opinion it should just be part of the same group. llvm-svn: 246857
* [OPENMP] Fix false diagnostic on instantiation-dependent exprs for atomic ↵Alexey Bataev2015-09-042-3/+10
| | | | | | | | constructs. Some of instantiation-dependent expressions could cause false diagnostic to be emitted about unsupported atomic constructs. Relaxed rules for detection of incorrect expressions. llvm-svn: 246853
* clang/test/SemaCXX/sourceranges.cpp: Fix silly expressions. Sorry for the ↵NAKAMURA Takumi2015-09-041-3/+3
| | | | | | breakage. llvm-svn: 246850
* clang/test/SemaCXX/sourceranges.cpp: Appease win32. Class method is thiscall ↵NAKAMURA Takumi2015-09-041-2/+2
| | | | | | for targeting i686-(msvc|mingw32). llvm-svn: 246849
* [OPENMP] Fix for http://llvm.org/PR24674: assertion failed and and abort trapAlexey Bataev2015-09-048-23/+81
| | | | | | Fix processing of shared variables with reference types in OpenMP constructs. Previously, if the variable was not marked in one of the private clauses, the reference to this variable was emitted incorrectly and caused an assertion later. llvm-svn: 246846
* Fix the perentheses location when the constructor is called on a class that ↵Olivier Goffart2015-09-041-1/+14
| | | | | | has a destructor llvm-svn: 246844
* [X86-64] Allow additional register names in inline assembler.Alexey Bataev2015-09-041-0/+53
| | | | | | | Patch allows to recognize additional registers x8d, x8b, x8w - x15d, x15b, x15w in inline assembler, already recognized by backend Differential Revision: http://reviews.llvm.org/D12594 llvm-svn: 246835
* [Static Analyzer] Remove sinks from nullability checks.Gabor Horvath2015-09-031-0/+62
| | | | | | Differential Revision: http://reviews.llvm.org/D12445 llvm-svn: 246818
* Refactored dtor sanitizing into EHScopeStackNaomi Musgrave2015-09-033-0/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Dtor sanitization handled amidst other dtor cleanups, between cleaning bases and fields. Sanitizer call pushed onto stack of cleanup operations. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D12022 Refactoring dtor sanitizing emission order. - Support multiple inheritance by poisoning after member destructors are invoked, and before base class destructors are invoked. - Poison for virtual destructor and virtual bases. - Repress dtor aliasing when sanitizing in dtor. - CFE test for dtor aliasing, and repression of aliasing in dtor code generation. - Poison members on field-by-field basis, with collective poisoning of trivial members when possible. - Check msan flags and existence of fields, before dtor sanitizing, and when determining if aliasing is allowed. - Testing sanitizing bit fields. llvm-svn: 246815
* [WebAssembly] Initial WebAssembly support in clangDan Gohman2015-09-0315-3/+1219
| | | | | | | | | | This implements basic support for compiling (though not yet assembling or linking) for a WebAssembly target. Note that ABI details are not yet finalized, and may change. Differential Revision: http://reviews.llvm.org/D12002 llvm-svn: 246814
* Thread safety analysis: the NO_THREAD_SAFETY_ANALYSIS attribute will nowDeLesley Hutchins2015-09-031-0/+55
| | | | | | | disable checking of arguments to the function, which is done by -Wthread-safety-reference. llvm-svn: 246806
* Add target flag to clang-cl invocation in this test.Alexey Samsonov2015-09-031-1/+1
| | | | llvm-svn: 246804
* Add -target flag to Clang invocations in this test.Alexey Samsonov2015-09-031-9/+9
| | | | | | ASan may not be supported for the default target triple. llvm-svn: 246795
* [libclang] Return deduced type for auto type, not the one written in the source.Manuel Klimek2015-09-031-1/+26
| | | | | | | | | | | | It used to work, but was accidentally broken by r179769. The issue with decayed types was fixed by r190796. So this patch partially reverts r179769, and adds more tests. This also fixes PR 18669. Patch by Sergey Kalinichev. llvm-svn: 246778
* Implement ACLE 2.0 macros of chapters 6.4 and 6.5 for [ARM] and [Aarch64] ↵Alexandros Lamprineas2015-09-033-53/+268
| | | | | | | | | targets. Differential Revision: http://reviews.llvm.org/D12244 Change-Id: Iffd4e822c15e18668fe8868278230ff232ef50aa llvm-svn: 246768
* [mips] Added support for choosing between traps and breaks in the integrated ↵Daniel Sanders2015-09-031-0/+24
| | | | | | | | | | | | | | | | assembler macros. Summary: The command line options for these are -Wa,--trap and -Wa,--break. Patch by Scott Egerton. Reviewers: vkalintiris, dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11676 llvm-svn: 246765
* [ARM] Allow passing/returning of __fp16 argumentsOliver Stannard2015-09-033-1/+24
| | | | | | | | | | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246764
* Revert 246755 as it breaks buildbotsOliver Stannard2015-09-033-24/+1
| | | | | | | | | | | | | | | | | | | | | | | | Original commit message: [ARM] Allow passing/returning of __fp16 arguments The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246760
* [OPENMP] Fix for http://llvm.org/PR24687: ICE on compilation of R package TPmsm.Alexey Bataev2015-09-031-3/+4
| | | | | | Fixed capturing of VLAs in 'private' clause of the OpenMP directives. llvm-svn: 246757
* [ARM] Allow passing/returning of __fp16 argumentsOliver Stannard2015-09-033-1/+24
| | | | | | | | | | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246755
* [OPENMP 4.1] Codegen for extended format of 'if' clause.Alexey Bataev2015-09-039-37/+41
| | | | | | Fixed codegen for extended format of 'if' clauses with special 'directive-name-modifier' + ast-print tests for extended format of 'if' clause. llvm-svn: 246748
* [OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.Alexey Bataev2015-09-0311-12/+160
| | | | | | | | | | | | | | | | | OpenMP 4.1 added special 'directive-name-modifier' to the 'if' clause. Format of 'if' clause is as follows: ``` if([ directive-name-modifier :] scalar-logical-expression) ``` The restriction rules are also changed. 1. If any 'if' clause on the directive includes a 'directive-name-modifier' then all 'if' clauses on the directive must include a 'directive-name-modifier'. 2. At most one 'if' clause without a 'directive-name-modifier' can appear on the directive. 3. At most one 'if' clause with some particular 'directive-name-modifier' can appear on the directive. 'directive-name-modifier' is important for combined directives and allows to separate conditions in 'if' clause for simple sub-directives in combined directive. This 'directive-name-modifier' identifies the sub-directive to which this 'if' clause must be applied. llvm-svn: 246747
* [modules] Tighten up this test a bit.Sean Silva2015-09-021-5/+6
| | | | llvm-svn: 246702
OpenPOWER on IntegriCloud