summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [Sema] Handle errors during rewriteBuiltinFunctionDeclDavid Majnemer2016-07-211-1/+4
| | | | | | | | | | rewriteBuiltinFunctionDecl can encounter errors when performing DefaultFunctionArrayLvalueConversion. These errors were not handled which led to a null pointer dereference. This fixes PR28651. llvm-svn: 276352
* [CodeGen] Fix a crash when constant folding switch statementErik Pilkington2016-07-211-0/+9
| | | | | | Differential revision: https://reviews.llvm.org/D22542 llvm-svn: 276350
* Disable a flaky test on Windows that uses "echo >>"Reid Kleckner2016-07-211-0/+5
| | | | llvm-svn: 276335
* Reroll "Include unreferenced nested types in member list only for CodeView"Adrian McCarthy2016-07-213-9/+12
| | | | | | Another attempt at r276271, hopefully without breaking ModuleDebugInfo test. llvm-svn: 276317
* Revert "Include unreferenced nested types in member list only for CodeView"Adrian McCarthy2016-07-213-16/+9
| | | | | | | | | | Patch broke ModuleDebugInfo test on the build bots (but not locally). Again. svn revision: r276271 This reverts commit 9da8a1b05362bc96f2855fb32b5588b89407685d. llvm-svn: 276279
* Include unreferenced nested types in member list only for CodeViewAdrian McCarthy2016-07-213-9/+16
| | | | | | Unreferenced nested structs and classes were omitted from the debug info. In DWARF, this was intentional, to avoid bloat. But for CodeView, we want this information to be consistent with what Microsoft tools would produce and expect. llvm-svn: 276271
* Provide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu ↵Yaron Keren2016-07-211-0/+11
| | | | | | | | | language extensions. These are used by libstdc++ <type_traits> for is_integral<__int128>. Addresses http://llvm.org/pr23156. llvm-svn: 276252
* [Sema,X86] Add explicit check to ensure that builtins that require x86-64 ↵Craig Topper2016-07-211-0/+22
| | | | | | | | | | target throw an error if used on 32-bit target. If these builtins are allowed to go through on a 32-bit target they will fire assertions in the backend. Fixes PR28635. llvm-svn: 276250
* [X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume ↵Craig Topper2016-07-212-0/+38
| | | | | | | | 64-bit GPRs are available. Usages of these intrinsics in a 32-bit build results in assertions in the backend. llvm-svn: 276249
* [Sema] Fix PR28623.George Burgess IV2016-07-211-0/+9
| | | | | | | | | | | | | | | In atomic builtins, we assumed that the LValue conversion on the first argument would succeed. So, we would crash given code like: ``` void ovl(char); void ovl(int); __atomic_store_n(ovl, 0, 0); ``` This patch makes us not assume that said conversion is successful. :) llvm-svn: 276232
* [OpenMP] Sema and parsing for 'target simd' pragmaKelvin Li2016-07-2021-0/+4892
| | | | | | | | This patch is to implement sema and parsing for 'target simd' pragma. Differential Revision: https://reviews.llvm.org/D22479 llvm-svn: 276203
* When copying an array into a lambda, destroy temporaries fromJohn McCall2016-07-201-2/+52
| | | | | | | | | the copy-constructor immediately and enter a partial array cleanup for previously-copied elements. Fixes PR28595. llvm-svn: 276180
* [OpenMP] Allow negative lower bound in array sections based on pointersKelvin Li2016-07-2012-11/+39
| | | | | | | | | | | | OpenMP 4.5 removed the restriction that array section lower bound must be non negative. This change is to allow negative values for array section based on pointers. For array section based on array type there is still a restriction: "The array section must be a subset of the original array." Patch by David S. Differential Revision: https://reviews.llvm.org/D22481 llvm-svn: 276177
* [OpenMP] Ignore parens in atomic captureKelvin Li2016-07-202-0/+8
| | | | | | | | | | | | | | | Clang misdiagnoses atomic captures cases that contains parens. i.e. int v, int *p; #pragma omp atomic capture { v = (*p); (*p)++; } Patch by David S. Differential Revision: https://reviews.llvm.org/D22487 llvm-svn: 276167
* [OpenCL] AMDGCN target will generate images in constant address spaceYaxun Liu2016-07-201-15/+24
| | | | | | | | | | | | | Allows AMDGCN target to generate images (such as %opencl.image2d_t) in constant address space. Images will still be generated in global address space by default. Added tests to existing opencl-types.cl in test\CodeGenOpenCL. Patch by Aaron En Ye Shi. Differential Revision: https://reviews.llvm.org/D22523 llvm-svn: 276161
* [modules] Don't emit initializers for VarDecls within a module eagerly wheneverRichard Smith2016-07-208-8/+53
| | | | | | | | | | | | we first touch any part of that module. Instead, defer them until the first time that module is (transitively) imported. The initializer step for a module then recursively initializes modules that its own headers imported. For example, this avoids running the <iostream> global initializer in programs that don't actually use iostreams, but do use other parts of the standard library. llvm-svn: 276159
* [X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using ↵Simon Pilgrim2016-07-204-14/+17
| | | | | | | | | | | | | | | | generic IR D20859 and D20860 attempted to replace the SSE (V)CVTTPS2DQ and VCVTTPD2DQ truncating conversions with generic IR instead. It turns out that the behaviour of these intrinsics is different enough from generic IR that this will cause problems, INF/NAN/out of range values are guaranteed to result in a 0x80000000 value - which plays havoc with constant folding which converts them to either zero or UNDEF. This is also an issue with the scalar implementations (which were already generic IR and what I was trying to match). This patch changes both scalar and packed versions back to using x86-specific builtins. It also deals with the other scalar conversion cases that are runtime rounding mode dependent and can have similar issues with constant folding. Differential Revision: https://reviews.llvm.org/D22105 llvm-svn: 276102
* [Sema] Compute the nullability of a conditional expression based on theAkira Hatanaka2016-07-202-0/+87
| | | | | | | | | | | | | | nullabilities of its operands. This patch defines a function to compute the nullability of conditional expressions, which enables Sema to precisely detect implicit conversions of nullable conditional expressions to nonnull pointers. rdar://problem/25166556 Differential Revision: https://reviews.llvm.org/D22392 llvm-svn: 276076
* [SemaObjC] Improve ObjCDictionaryLiteral and ObjCArryLiteral diagnosticsBruno Cardoso Lopes2016-07-192-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Sema actions on ObjCDictionaryLiteral and ObjCArryLiteral are currently done as a side-effect of Sema upon parent expressions, which incurs of delayed typo corrections for such literals to be performed by TypoTransforms upon the ObjCDictionaryLiteral and ObjCArryLiteral themselves instead of its elements individually. This is specially bad because it was not designed to act on several elements; searching through all possible combinations of corrections for several elements is very expensive. Additionally, when one of the elements has no correction candidate, we still explore all options and at the end emit no typo corrections whatsoever. Do the proper sema actions by acting on each element alone during appropriate literal parsing time to get proper diagonistics and decent compile time behavior. Differential Revision: http://reviews.llvm.org/D22183 rdar://problem/21046678 llvm-svn: 276020
* Let FuncAttrs infer the 'returned' argument attributeDavid Majnemer2016-07-193-4/+4
| | | | | | This reverts commit r275756. llvm-svn: 276014
* [OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN targetYaxun Liu2016-07-191-17/+30
| | | | | | | | | | | | Added the opencl.ocl.version metadata to be emitted with amdgcn. Created a static function emitOCLVerMD which is shared between triple spir and target amdgcn. Also added new testcases to existing test file, spir_version.cl inside test/CodeGenOpenCL. Patch by Aaron En Ye Shi. Differential Revision: https://reviews.llvm.org/D22424 llvm-svn: 276010
* Deprecated (legacy) string literal conversion to 'char *' causes strange ↵Dmitry Polukhin2016-07-191-0/+11
| | | | | | | | | | | | | | overloading resolution It's a patch for PR28050. Seems like overloading resolution wipes out the first standard conversion sequence (before user-defined conversion) in case of deprecated string literal conversion. Differential revision: https://reviews.llvm.org/D21228 Patch by Alexander Makarov llvm-svn: 275970
* [mips] Correct label prefixes for N32 and N64.Daniel Sanders2016-07-191-4/+4
| | | | | | | | | | | | | | | | | Summary: N32 and N64 follow the standard ELF conventions (.L) whereas O32 uses its own ($). This fixes the majority of object differences between -fintegrated-as and -fno-integrated-as. Reviewers: sdardis Subscribers: dsanders, sdardis, llvm-commits Differential Revision: https://reviews.llvm.org/D22412 llvm-svn: 275967
* [driver][mips] Support MIPS targets in modern Android NDKSimon Atanasyan2016-07-1928-24/+40
| | | | | | Initial patch provided by Duane Sand. llvm-svn: 275949
* [OpenMP] Fix incorrect diagnostics in map clauseKelvin Li2016-07-184-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Having the following code pattern will result in incorrect diagnostic int main() { int arr[10]; #pragma omp target data map(arr[:]) #pragma omp target map(arr) {} } t.cpp:4:24: error: original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage #pragma omp target map(arr) ^~~ t.cpp:3:29: note: used here #pragma omp target data map(arr[:]) ^~~~~~ 1 error generated. Patch by David S. Differential Revision: https://reviews.llvm.org/D22075 llvm-svn: 275926
* [Coverage] Remove '..' from filenames *after* getting an absolute pathVedant Kumar2016-07-181-4/+15
| | | | | | | | Failure to do this breaks relative paths which begin with '..'. This issue was caught by the (still nascent) coverage bot. llvm-svn: 275924
* [Coverage] Normalize '..' out of filename stringsVedant Kumar2016-07-181-0/+7
| | | | | | | | This fixes the issue of having duplicate entries for the same file in a coverage report s.t none of the entries actually displayed the correct coverage information. llvm-svn: 275913
* [Sema] Create a separate group for incompatible function pointer warningBruno Cardoso Lopes2016-07-183-2/+16
| | | | | | | | | | | | | Give incompatible function pointer warning its own diagnostic group but still leave it as a subgroup of incompatible-pointer-types. This is in preparation to promote -Wincompatible-function-pointer-types to error on darwin. Differential Revision: https://reviews.llvm.org/D22248 rdar://problem/12907612 llvm-svn: 275907
* Allow iOS and tvOS version numbers with 2-digit major version numbers.Bob Wilson2016-07-181-0/+4
| | | | | | rdar://problem/26921601 llvm-svn: 275905
* Revert "[analyzer] Add checker modeling potential C++ self-assignment"Devin Coughlin2016-07-181-89/+0
| | | | | | This reverts commit r275820. It is failing on the bots. llvm-svn: 275880
* Support -masm= flag for x86 assembly targets.Yunzhong Gao2016-07-181-0/+11
| | | | | | | | | | | | | | | | | | | For assembly files without .intel_syntax or .att_syntax directives, allow the -masm= flag to supply a default assembly dialect. For example, C:\TMP> type intel.s .text mov al,0 C:\TMP> clang -masm=intel -c intel.s Without this patch, one would need to pass an "-mllvm -x86-asm-syntax=" flag directly to the backend. C:\TMP> clang -mllvm --x86-asm-syntax=intel -c intel.s Differentials Review: http://reviews.llvm.org/D22285 llvm-svn: 275877
* [analyzer] Add checker modeling potential C++ self-assignmentDevin Coughlin2016-07-181-0/+89
| | | | | | | | | | | | | | | | | | This checker checks copy and move assignment operators whether they are protected against self-assignment. Since C++ core guidelines discourages explicit checking for `&rhs==this` in general we take a different approach: in top-frame analysis we branch the exploded graph for two cases, where &rhs==this and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the work. It is important that we check all copy and move assignment operator in top frame even if we checked them already since self-assignments may happen undetected even in the same translation unit (e.g. using random indices for an array what may or may not be the same). A patch by Ádám Balogh! Differential Revision: https://reviews.llvm.org/D19311 llvm-svn: 275820
* [OpenMP] update test cases for -std=c++11 compileKelvin Li2016-07-182-6/+42
| | | | | | | | target_parallel_for_simd_collapse_messages.cpp and target_parallel_for_simd_ordered_messages.cpp give different diagnostic messages in compiling with -std=c++11. The test cases are updated to make it compatible. Differential Revision: https://reviews.llvm.org/D22417 llvm-svn: 275805
* Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' ↵NAKAMURA Takumi2016-07-183-4/+4
| | | | | | | | | | argument attribute"" This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute" It broke LTO build. Seems miscompilation. llvm-svn: 275756
* test: add missing triple to testSaleem Abdulrasool2016-07-171-1/+1
| | | | | | | The test was relying on the default triple which may not be correct. Explicitly provide it a triple. Should repair the windows on Linux builder. llvm-svn: 275738
* CodeGen: honour dllstorage on ObjC typesSaleem Abdulrasool2016-07-171-0/+151
| | | | | | | | Add support for ObjC types to respect the DLLImport/DLLExport storage annotations. This only effects COFF output. This would allow usage with clang/C2, but not with clang/LLVM due to hard coded section names. llvm-svn: 275737
* Revert "Revert r275029 - Update Clang tests after adding inference for the ↵Hal Finkel2016-07-163-4/+4
| | | | | | | | returned argument attribute" This reverts commit r275043 after reapplying the underlying LLVM commit. llvm-svn: 275679
* [Driver] Add flags for enabling both types of PGO InstrumentationSean Silva2016-07-162-6/+9
| | | | | | | | | | | | The flags: Enable IR-level instrumentation -fprofile-generate or -fprofile-generate= When applying profile data: -fprofile-use=/path/to/profdata Patch by Jake VanAdrighem! Differential Revision: https://reviews.llvm.org/D21823 llvm-svn: 275668
* [ObjC] Implement @available in the Parser and ASTErik Pilkington2016-07-161-0/+24
| | | | | | | | | | | | | | | | This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the Parser and Sema to generate it. This node represents an availability check of the form: @available(macos 10.10, *); Which will eventually compile to a runtime check of the host's OS version. This is the first patch of the feature I proposed here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html Differential Revision: https://reviews.llvm.org/D22171 llvm-svn: 275654
* [CUDA][OpenMP] Create generic offload actionSamuel Antao2016-07-151-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs. This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture. This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures) ``` 0: input, "cudatests.cu", cuda, (host-cuda) 1: preprocessor, {0}, cuda-cpp-output, (host-cuda) 2: compiler, {1}, ir, (host-cuda) 3: input, "cudatests.cu", cuda, (device-cuda, sm_35) 4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35) 5: compiler, {4}, ir, (device-cuda, sm_35) 6: backend, {5}, assembler, (device-cuda, sm_35) 7: assembler, {6}, object, (device-cuda, sm_35) 8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object 9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler 10: input, "cudatests.cu", cuda, (device-cuda, sm_37) 11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37) 12: compiler, {11}, ir, (device-cuda, sm_37) 13: backend, {12}, assembler, (device-cuda, sm_37) 14: assembler, {13}, object, (device-cuda, sm_37) 15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object 16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler 17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda) 18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir 19: backend, {18}, assembler 20: assembler, {19}, object 21: input, "cuda", object 22: input, "cudart", object 23: linker, {20, 21, 22}, image ``` The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine. Reviewers: echristo, hfinkel, jlebar, ABataev, tra Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D18171 llvm-svn: 275645
* [index] Create different USR if a property is a class property.Argyrios Kyrtzidis2016-07-151-0/+2
| | | | | | Avoids USR conflicts between class & instance properties of the same name. llvm-svn: 275630
* Revert r275481, r275490. This broke modules bootstrap.Richard Smith2016-07-156-44/+0
| | | | llvm-svn: 275624
* AMDGPU: Remove legacy ldexp builtinMatt Arsenault2016-07-152-32/+0
| | | | llvm-svn: 275623
* AMDGPU: Update for rsq intrinsic changesMatt Arsenault2016-07-152-22/+8
| | | | llvm-svn: 275622
* Push alias-declarations and alias-template declarations into scope even ifRichard Smith2016-07-156-7/+20
| | | | | | | | they're redeclarations. This is necessary in order for name lookup to correctly find the most recent declaration of the name (which affects default template argument lookup and cross-module merging, among other things). llvm-svn: 275612
* Sema: support __declspec(dll*) on ObjC interfacesSaleem Abdulrasool2016-07-158-24/+173
| | | | | | | | | | | Extend the __declspec(dll*) attribute to cover ObjC interfaces. This was requested by Microsoft for their ObjC support. Cover both import and export. This only adds the semantic analysis portion of the support, code-generation still remains outstanding. Add some basic initial documentation on the attributes that were previously empty. Tweak the previous tests to use the relative expected-warnings to make the tests easier to read. llvm-svn: 275610
* [test/objcmt] Add a follow-up test case for r275600.Argyrios Kyrtzidis2016-07-155-2/+12
| | | | llvm-svn: 275609
* [objcmt] Fix a buffer overflow crash than can occur while modernizing enums.Argyrios Kyrtzidis2016-07-153-1/+29
| | | | | | | | Note that due to the nature of the crash it requires libgmalloc or asan for it to crash consistently. rdar://19932927 llvm-svn: 275600
* [objcmt] Don't add an #import of Foundation unnecessarily, if the NS_ENUM ↵Argyrios Kyrtzidis2016-07-151-3/+0
| | | | | | macro is already defined. llvm-svn: 275589
* AMDGPU: Add Clang Builtin for v_lerp_u8Wei Ding2016-07-151-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D22380 llvm-svn: 275577
OpenPOWER on IntegriCloud