summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [AArch64] Define the macro __ARM_FP16_ARGSKeith Walker2015-08-241-0/+1
| | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 defines that the predefined macro __ARM_FP16_ARGS should be defined if __fp16 can be used as an argument and result. The support for __fp16 to be used as an argument and result is already implemented for AArch64 so this change is just adding the missing macro. Differential Revision: http://reviews.llvm.org/D12240 llvm-svn: 245833
* [modules] Stop updating all identifiers when writing a module. This isRichard Smith2015-08-241-1/+7
| | | | | | | unnecessary in C++ modules (where we don't need the identifiers for their Decls) and expensive. llvm-svn: 245821
* [test] Fix typos in a few tests (NFC)Vedant Kumar2015-08-233-4/+4
| | | | | | Patch by Kai Zhao! llvm-svn: 245817
* Added missing tests for SSE41 pmovsx/pmovzx extension intrinsicsSimon Pilgrim2015-08-231-0/+72
| | | | llvm-svn: 245815
* Instantiate function declarations in instantiated functions.Serge Pavlov2015-08-233-5/+23
| | | | | | | | | | | | | | | | | If a function declaration is found inside a template function as in: template<class T> void f() { void g(int x = T::v) except(T::w); } it must be instantiated along with the enclosing template function, including default arguments and exception specification. Together with the patch committed in r240974 this implements DR1484. Differential Revision: http://reviews.llvm.org/D11194 llvm-svn: 245810
* [CUDA] Change initializer for CUDA device code based on CUDA documentation.Jingyue Wu2015-08-222-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: According to CUDA documentation, global variables declared with __device__, __constant__ can be initialized from host code, so mark them as externally initialized. Because __shared__ variables cannot have an initialization as part of their declaration and since the value maybe kept across different kernel invocation, the value of __shared__ is effectively undefined instead of zero initialized. Wrongly using zero initializer may cause illegitimate optimization, e.g. removing unused __constant__ variable because it's not updated in the device code and the value is initialized with zero. Test Plan: test/CodeGenCUDA/address-spaces.cu Patch by Xuetian Weng Reviewers: jholewinski, eliben, tra, jingyue Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12241 llvm-svn: 245786
* [modules] Rearrange how redeclaration chains are loaded, to remove a walk overRichard Smith2015-08-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | all modules and reduce the number of declarations we load when loading a redeclaration chain. The new approach is: * when loading the first declaration of an entity within a module file, we first load all declarations of the entity that were imported into that module file, and then load all the other declarations of that entity from that module file and build a suitable decl chain from them * when loading any other declaration of an entity, we first load the first declaration from the same module file As before, we complete redecl chains through name lookup where necessary. To make this work, I also had to change the way that template specializations are stored -- it no longer suffices to track only canonical specializations; we now emit all "first local" declarations when emitting a list of specializations for a template. On one testcase with several thousand imported module files, this reduces the total runtime by 72%. llvm-svn: 245779
* When building a pseudo-object assignment, and the RHS isJohn McCall2015-08-221-1/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | a contextually-typed expression that semantic analysis will probably need to invasively rewrite, don't include the RHS OVE as a separate semantic expression, and check the operation with the original RHS expression. There are two contextually-typed expressions that can survive to here: overloaded function references, which are at least safe to double-emit, and C++11 initializer list expressions, which are not at all safe to double-emit and which often don't update the original syntactic InitListExpr with implicit conversions to member types, etc. This means that the original RHS may appear, undecorated by an OVE, in the semantic expressions. Fortunately, it will only ever be used in a single place there, and I don't believe there are clients that rely on being able to pick out the original RHS from the semantic expressions. But this could be problematic if there are clients that do visit the entire tree and rely on not seeing the same expression multiple times, once in the syntactic and once in the semantic expressions. This is a very fiddly part of the compiler. rdar://21801088 llvm-svn: 245771
* [SemaObjC] Remove unused code from test.Alex Denisov2015-08-211-42/+6
| | | | | | Patch by modocache (Brian Gesiak). llvm-svn: 245731
* Revert "Generating assumption loads of vptr after ctor call (fixed)"Piotr Padlewski2015-08-217-208/+19
| | | | | | | | Reverting because of 245721 This reverts commit 552658e2b60543c928030b09cc9b5dfcb40c3f28. llvm-svn: 245727
* Generating assumption loads of vptr after ctor call (fixed)Piotr Padlewski2015-08-217-19/+208
| | | | | | | | | | | | | | | Generating call assume(icmp %vtable, %global_vtable) after constructor call for devirtualization purposes. For more info go to: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html Edit: Fixed version because of PR24479. http://reviews.llvm.org/D11859 llvm-svn: 245721
* Properly provide alignment of 'byval' arguments down to llvm.James Y Knight2015-08-213-8/+35
| | | | | | | | | This is important in the case that the LLVM-inferred llvm-struct alignment is not the same as the clang-known C-struct alignment. Differential Revision: http://reviews.llvm.org/D12243 llvm-svn: 245719
* [OPENMP 4.1] Add codegen for 'simdlen' clause.Alexey Bataev2015-08-211-0/+64
| | | | | | | | | Add emission of metadata for simd loops in presence of 'simdlen' clause. If 'simdlen' clause is provided without 'safelen' clause, the vectorizer width for the loop is set to value of 'simdlen' clause + all read/write ops in loop are marked with '!llvm.mem.parallel_loop_access' metadata. If 'simdlen' clause is provided along with 'safelen' clause, the vectorizer width for the loop is set to value of 'simdlen' clause + all read/write ops in loop are not marked with '!llvm.mem.parallel_loop_access' metadata. If 'safelen' clause is provided without 'simdlen' clause, the vectorizer width for the loop is set to value of 'safelen' clause + all read/write ops in loop are not marked with '!llvm.mem.parallel_loop_access' metadata. llvm-svn: 245697
* [OPENMP 4.1] Add ast-print tests for 'val', 'uval' and 'ref' modifiers.Alexey Bataev2015-08-211-6/+10
| | | | llvm-svn: 245693
* [OPENMP 4.1] Initial support for 'simdlen' clause.Alexey Bataev2015-08-219-24/+552
| | | | | | Add parsing/sema analysis for 'simdlen' clause in simd directives. Also add check that if both 'safelen' and 'simdlen' clauses are specified, the value of 'simdlen' parameter is less than the value of 'safelen' parameter. llvm-svn: 245692
* Expand mingw-long-double.c to test for long double alignment.Yaron Keren2015-08-211-1/+7
| | | | llvm-svn: 245679
* [Sema] Don't crash when diagnosing hack in libstdc++David Majnemer2015-08-211-2/+3
| | | | | | | | | | | | While working around a bug in certain standard library implementations, we would try to diagnose the issue so that library implementors would fix their code. However, we assumed an entity being initialized was a non-static data member subobject when other circumstances are possible. This fixes PR24526. llvm-svn: 245675
* [OPENMP 4.1] Improved codegen for 'uval' qualifier of 'linear' clause.Alexey Bataev2015-08-211-0/+129
| | | | | | According to standard the 'uval' modifier declares the address of the original list item to have an invariant value for all iterations of the associated loop(s). Patch improves codegen for this qualifier by removing usage of the original reference variable and replacing by referenced l-value. llvm-svn: 245674
* Stop treating -static as overriding -fPIC: they are distinct.James Y Knight2015-08-211-2/+10
| | | | | | | | | | | | | | | | | For some reason, clang had been treating a command like: clang -static -fPIC foo.c as if it should be compiled without the PIC relocation model. This was incorrect: -static should be affecting only the linking model, and -fPIC only the compilation. This new behavior also matches GCC. This is a follow-up from a review comment on r245447. Differential Revision: http://reviews.llvm.org/D12208 llvm-svn: 245667
* [Static Analyzer] Add checker to catch lightweight generics related type ↵Gabor Horvath2015-08-211-0/+5265
| | | | | | | | errors in Objective-C. Differential Revision: http://reviews.llvm.org/D11427 llvm-svn: 245646
* Revert r245344.Evgeniy Stepanov2015-08-201-7/+0
| | | | | | | | That change is causing strange test failures on Fedora 22 (PR24503), and it does not have any effect with Gold linker anyway (PR15823, https://sourceware.org/bugzilla/show_bug.cgi?id=18859). llvm-svn: 245619
* Do not crash when static analysis encounters a FunctionDecl that has a ↵Aaron Ballman2015-08-201-0/+11
| | | | | | delayed template parse of its body. llvm-svn: 245616
* PR24483: Delete some dead/incorrect code that triggered assertions.Richard Smith2015-08-201-0/+6
| | | | llvm-svn: 245609
* Fix test on Windows to accept both gcc and gcc.exe.Yaron Keren2015-08-201-1/+1
| | | | llvm-svn: 245607
* [Headers][X86] Use __builtin_shufflevector in AVX2 broadcasts.Ahmed Bougacha2015-08-201-11/+33
| | | | | | | | | | This lets us optimize them better. We agreed to remove the intrinsics, instead of combining them later, as, at -O0, we generate the expected instructions. Plus, it's a nice cleanup. Differential Revision: http://reviews.llvm.org/D10556 llvm-svn: 245605
* [Sparc] Add '-EL' when invoking gcc to link little-endian binaries.Douglas Katzman2015-08-201-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D12201 llvm-svn: 245595
* Revert r245496 "[CUDA] Add appropriate host/device attribute to builtins."Artem Belevich2015-08-202-38/+3
| | | | | | It's breaking internal test. llvm-svn: 245592
* Fix crash with two typos in the arguments of a functionOlivier Goffart2015-08-201-0/+6
| | | | | | | | The problem is that the arguments are of TheCall are reset later to the ones in Args, making TypoExpr put back. Some TypoExpr that have already been diagnosed and will assert later in Sema::getTypoExprState llvm-svn: 245560
* [OPENMP 4.1] Allow to use 'uval' and 'ref' modifiers for reference types only.Alexey Bataev2015-08-201-6/+8
| | | | | | Standard allows to use 'uval' and 'ref' modifiers in 'linear' clause for variables with reference types only. Added check for it and modified test. llvm-svn: 245556
* [OPENMP 4.1] Initial support for modifiers in 'linear' clause.Alexey Bataev2015-08-202-8/+52
| | | | | | | | | | | | | | | | | | | | | | OpenMP 4.1 adds 3 optional modifiers to 'linear' clause. Format of 'linear' clause has changed to: ``` linear(linear-list[ : linear-step]) ``` where linear-list is one of the following ``` list modifier(list) ``` where modifier is one of the following: ``` ref (C++) val (C/C++) uval (C++) ``` Patch adds parsing and sema analysis for these modifiers. llvm-svn: 245550
* Fix the layout of bitfields in ms_struct unions: theirJohn McCall2015-08-1912-242/+272
| | | | | | | | | | | | | | | alignment is ignored, and they always allocate a complete storage unit. Also, change the dumping of AST record layouts: use the more readable C++-style dumping even in C, include bitfield offset information in the dump, and don't print sizeof/alignof information for fields of record type, since we don't do so for bases or other kinds of field. rdar://22275433 llvm-svn: 245514
* Fix -Wlogical-not-parentheses to work better with C code.Richard Trieu2015-08-193-2/+206
| | | | | | | Remove the assumption of a Boolean type by checking if an expression is known to have a boolean value. Disable warning in two other tests. llvm-svn: 245507
* Internal-linkage variables with constant-evaluatable initializers do not ↵Richard Smith2015-08-196-7/+26
| | | | | | need to be emitted. (Also reduces the set of variables that need to be eagerly deserialized when using PCH / modules.) llvm-svn: 245497
* [CUDA] Add appropriate host/device attribute to builtins.Artem Belevich2015-08-192-3/+38
| | | | | | Differential Revision: http://reviews.llvm.org/D12122 llvm-svn: 245496
* Generating available_externally vtables bugfixPiotr Padlewski2015-08-191-0/+77
| | | | | | | | Bugfix revealed in r245264. http://reviews.llvm.org/D12128 llvm-svn: 245489
* Add REQUIRES: x86-registered-target to test since it's required.Yaron Keren2015-08-191-0/+1
| | | | llvm-svn: 245462
* According to i686 ABI, long double size on x86 is 12 bytes not 16 bytes.Yaron Keren2015-08-191-0/+5
| | | | | | | See https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/i386-and-x86-64-Options.html llvm-svn: 245459
* Properly pass through the PIC mode to the integrated assembler whenJames Y Knight2015-08-191-3/+3
| | | | | | | | | | | | | | | | | | doing assembly-only, and unify the Driver's PIC argument parsing. On a few architectures, parsing of assembly files annoyingly depends on whether PIC is enabled or not. This was handled for external 'as' already (passing -KPIC), but was missed for calls to the standalone internal assembler. The integrated-as.s test needed to be modified to not expect -fsanitize=address to be unused, as now fsanitize *IS* used for assembly, since -fsanitize=memory can sometimes imply -fPIE, which the assembler needs to know (gack!!). Differential Revision: http://reviews.llvm.org/D11845 llvm-svn: 245447
* [ARM] Proper generic cpus handlingVladimir Sukharev2015-08-191-0/+19
| | | | | | | | | | | | | | "generic" cpu was wrongly handled as exact real CPU name of ARMv8.1A architecture. This has been fixed, now it is abstract name, suitable for any arch. Reviewers: rengolin Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11640 llvm-svn: 245445
* [OPENMP] Link libomp.lib on WindowsAlexey Bataev2015-08-191-0/+18
| | | | | | | Adds libomp.lib for -fopenmp=libomp and libiomp5md.lib for -fopenmp=libiomp5 on Windows Differential Revision: http://reviews.llvm.org/D11932 llvm-svn: 245414
* Make __builtin_object_size always answer correctlyGeorge Burgess IV2015-08-192-4/+134
| | | | | | | | | | | | | | | | | | __builtin_object_size would return incorrect answers for many uses where type=3. This fixes the inaccuracy by making us emit 0 instead of LLVM's objectsize intrinsic. Additionally, there are many cases where we would emit suboptimal (but correct) answers, such as when arrays are involved. This patch fixes some of these cases (please see new tests in test/CodeGen/object-size.c for specifics on which cases are improved) Resubmit of r245323 with PR24493 fixed. Patch mostly by Richard Smith. Differential Revision: http://reviews.llvm.org/D12000 This fixes PR15212. llvm-svn: 245403
* [modules] Tests for r245390.Richard Smith2015-08-185-0/+21
| | | | llvm-svn: 245391
* Initialize the AST consumer as soon as we have both an ASTConsumer and anRichard Smith2015-08-182-2/+5
| | | | | | | ASTContext. Fixes some cases where we could previously initialize the AST consumer more than once. llvm-svn: 245346
* [sanitizer] Add -lutil to static runtime link flags.Evgeniy Stepanov2015-08-181-0/+7
| | | | | | | This is needed to prevent breakage of -Wl,-as-needed link when interceptors for functions in libutil are added. See PR15823. llvm-svn: 245344
* Revert r245323, it caused PR24493.Nico Weber2015-08-182-93/+4
| | | | llvm-svn: 245342
* Make __builtin_object_size always answer correctlyGeorge Burgess IV2015-08-182-4/+93
| | | | | | | | | | | | | | | | | __builtin_object_size would return incorrect answers for many uses where type=3. This fixes the inaccuracy by making us emit 0 instead of LLVM's objectsize intrinsic. Additionally, there are many cases where we would emit suboptimal (but correct) answers, such as when arrays are involved. This patch fixes some of these cases (please see new tests in test/CodeGen/object-size.c for specifics on which cases are improved) Patch mostly by Richard Smith. Differential Revision: http://reviews.llvm.org/D12000 This fixes PR15212. llvm-svn: 245323
* [OPENMP 4.1] Allow variables with reference types in private clauses.Alexey Bataev2015-08-1838-143/+135
| | | | | | OpenMP 4.1 allows to use variables with reference types in all private clauses (private, firstprivate, lastprivate, linear etc.). Patch allows to use such variables and fixes codegen for linear variables with reference types. llvm-svn: 245268
* Revert "Generating assumption loads of vptr after ctor call (fixed)"Justin Bogner2015-08-187-208/+19
| | | | | | | | | | | Bootstrap bots were failing: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/6382/ http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/2969 This reverts r245264. llvm-svn: 245267
* Generating assumption loads of vptr after ctor call (fixed)Piotr Padlewski2015-08-187-19/+208
| | | | | | | | | | | | | | | Generating call assume(icmp %vtable, %global_vtable) after constructor call for devirtualization purposes. For more info go to: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html Edit: Fixed version because of PR24479. http://reviews.llvm.org/D11859 llvm-svn: 245264
* Revert r245257 "Generating assumption loads of vptr after ctor call"Hans Wennborg2015-08-187-209/+19
| | | | | | It caused PR24479 llvm-svn: 245260
OpenPOWER on IntegriCloud