summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Restore allowing of braced initializers in the declare reductionAlexey Bataev2020-01-021-0/+2
| | | | | | init. Braced initializers were not accepted after the last fix in the initialier.Restored previous functionality.
* build: reduce CMake handling for zlibSaleem Abdulrasool2020-01-022-11/+2
| | | | | | | | | | | | | Rather than handling zlib handling manually, use `find_package` from CMake to find zlib properly. Use this to normalize the `LLVM_ENABLE_ZLIB`, `HAVE_ZLIB`, `HAVE_ZLIB_H`. Furthermore, require zlib if `LLVM_ENABLE_ZLIB` is set to `YES`, which requires the distributor to explicitly select whether zlib is enabled or not. This simplifies the CMake handling and usage in the rest of the tooling. This restores 68a235d07f9e7049c7eb0c8091f37e385327ac28, e6c7ed6d2164a0659fd9f6ee44f1375d301e3cad. The problem with the windows bot is a need for clearing the cache.
* [SystemZ] Use FNeg in s390x clang builtinsKevin P. Neal2020-01-024-22/+22
| | | | The s390x builtins are still using FSub instead of FNeg. Correct that.
* Revert "build: reduce CMake handling for zlib"James Henderson2020-01-022-2/+11
| | | | | | | This reverts commit 68a235d07f9e7049c7eb0c8091f37e385327ac28. This commit broke the clang-x64-windows-msvc build bot and a follow-up commit did not fix it. Reverting to fix the bot.
* [OpenMP] Fix formatting of OpenMP error message, by Wang Tianqing.Alexey Bataev2020-01-0210-0/+35
| | | | | | | | | | | | | | Summary: `getListOfPossibleValues()` formatted incorrectly when there is only one value, emitting something like `expected 'conditional' or in OpenMP clause 'lastprivate'`. Reviewers: jdoerfert, ABataev Reviewed By: jdoerfert Subscribers: guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71884
* build: reduce CMake handling for zlibSaleem Abdulrasool2020-01-012-11/+2
| | | | | | | | | Rather than handling zlib handling manually, use `find_package` from CMake to find zlib properly. Use this to normalize the `LLVM_ENABLE_ZLIB`, `HAVE_ZLIB`, `HAVE_ZLIB_H`. Furthermore, require zlib if `LLVM_ENABLE_ZLIB` is set to `YES`, which requires the distributor to explicitly select whether zlib is enabled or not. This simplifies the CMake handling and usage in the rest of the tooling.
* Revert "Adds -Wrange-loop-analysis to -Wall"Mark de Wever2020-01-012-4/+1
| | | | | | The sanitizer-x86_64-linux buildbot failed to build lld with -Werror. This reverts commit d8117542ac57f6051674ca70ea14c0e0d7d9b046.
* Adds -Wrange-loop-analysis to -WallMark de Wever2020-01-012-1/+4
| | | | | | | | This makes the range loop warnings part of -Wall. Fixes PR32823: Warn about accidental coping of data in range based for Differential Revision: https://reviews.llvm.org/D68912
* Improve Wrange-loop-analyses for rvalue referenceMark de Wever2020-01-011-2/+110
| | | | | | | | | | The Wrange-loop-analyses warns if a copy is made. Suppress this warning when a temporary is bound to a rvalue reference. While fixing this issue also found a copy-paste error in test6, which is also fixed. Differential Revision: https://reviews.llvm.org/D71806
* Adds fixit hints to the -Wrange-loop-analysisMark de Wever2020-01-011-0/+44
| | | | Differential Revision: https://reviews.llvm.org/D68913
* Revert "[Diagnostic] Add ftabstop to -Wmisleading-indentation"Martin Storsjö2019-12-311-81/+2
| | | | | | | | | This reverts commit b47b35ff51b355a446483777155290541ab64fae. This caused failed asserts (Assertion `FIDAndOffset.second > ColNo && "Column number smaller than file offset?"' failed.) on a source file with a single line containing "int main (void) { for( int i = 0; i < 9; i++ ); return 0; }".
* [OPENMP]Emit artificial threprivate vars as threadlocal, if possible.Alexey Bataev2019-12-316-24/+19
| | | | It may improve performance for declare reduction constructs.
* [CodeGen] Emit conj/conjf/confjl libcalls as fneg instructions if possible.Craig Topper2019-12-312-7/+25
| | | | | | | We already recognize the __builtin versions of these, might as well recognize the libcall version. Differential Revision: https://reviews.llvm.org/D72028
* Fix external-names.c test when separator is \\Michael Platings2019-12-311-3/+3
| | | | | | | | | | | | | This fixes the following failure: C:\[...]\llvm\tools\clang\test\VFS\external-names.c:34:26: error: CHECK-DEBUG-EXTERNAL: expected string not found in input // CHECK-DEBUG-EXTERNAL: ![[Num]] = !DIFile(filename: "{{[^"]*}}Inputs{{.}}external-names.h" ^ [...] <stdin>:42:54: note: possible intended match here !10 = !DIFile(filename: "C:/[...]\\llvm\\tools\\clang\\test\\VFS\\Inputs\\external-names.h", directory: "") Differential Revision: https://reviews.llvm.org/D71991
* [CodeGen] Use IRBuilder::CreateFNeg for __builtin_conjCraig Topper2019-12-301-0/+20
| | | | | | This replaces the fsub -0.0 idiom with an fneg instruction. We didn't see to have a test that showed the current codegen. Just some tests for constant folding and a test that was only checking the declare lines for libcalls. The latter just checked that we did not have a declare for @conj when using __builtin_conj. Differential Revision: https://reviews.llvm.org/D72012
* [CodeGen] Use CreateFNeg in buildFMulAddCraig Topper2019-12-301-0/+15
| | | | | | We have an fneg instruction now and should use it instead of the fsub -0.0 idiom. Looks like we had no test that showed that we handled the negation cases here so I've added new tests. Differential Revision: https://reviews.llvm.org/D72010
* [OpenMP][FIX] Generalize a test check lineJohannes Doerfert2019-12-301-2/+2
| | | | | | | The new check line is compatible with the clang code generation check line as it allows a 64 and 32 bit value. I hope this makes the llvm-clang-win-x-armv7l buildbot happy.
* [OpenMP] Use the OpenMPIRBuilder for `omp parallel`Johannes Doerfert2019-12-302-94/+142
| | | | | | | | | | | | This allows to use the OpenMPIRBuilder for parallel regions. Code was extracted from D61953 and adapted to work with the new version (D70109). All but one feature should be supported. An update of this patch will provide test coverage and privatization other than shared. Reviewed By: fghanim Differential Revision: https://reviews.llvm.org/D70290
* [X86][AsmParser] re-introduce 'offset' operatorEric Astor2019-12-304-6/+17
| | | | | | | | | | | | | | | | | | | | | | | Summary: Amend MS offset operator implementation, to more closely fit with its MS counterpart: 1. InlineAsm: evaluate non-local source entities to their (address) location 2. Provide a mean with which one may acquire the address of an assembly label via MS syntax, rather than yielding a memory reference (i.e. "offset asm_label" and "$asm_label" should be synonymous 3. address PR32530 Based on http://llvm.org/D37461 Fix broken test where the break appears unrelated. - Set up appropriate memory-input rewrites for variable references. - Intel-dialect assembly printing now correctly handles addresses by adding "offset". - Pass offsets as immediate operands (using "r" constraint for offsets of locals). Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71436
* [Diagnostic] Add ftabstop to -Wmisleading-indentationTyker2019-12-301-2/+81
| | | | | | | | | | | | | | | Summary: this allow much better support of codebases like the linux kernel that mix tabs and spaces. -ftabstop=//Width// allow specifying how large tabs are considered to be. Reviewers: xbolva00, aaron.ballman, rsmith Reviewed By: aaron.ballman Subscribers: jyknight, riccibruno, rsmith, nathanchance Differential Revision: https://reviews.llvm.org/D71037
* Allow redeclaration of __declspec(uuid)Zachary Henkel2019-12-281-0/+6
| | | | | | | | | msvc allows a subsequent declaration of a uuid attribute on a struct/class. Mirror this behavior in clang-cl. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71439
* Revert "CWG2352: Allow qualification conversions during reference binding."David Blaikie2019-12-274-80/+12
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit de21704ba96fa80d3e9402f12c6505917a3885f4. Regressed/causes this to error due to ambiguity: void f(const int * const &); void f(int *); int main() { int * x; f(x); } (in case it's important - the original case where this turned up was a member function overload in a class template with, essentially: f(const T1&) f(T2*) (where T1 == X const *, T2 == X)) It's not super clear to me if this ^ is expected behavior, in which case I'm sorry about the revert & happy to look into ways to fix the original code.
* [VFS] Don't run symlink test on Windows, it may pass or failReid Kleckner2019-12-271-1/+1
| | | | | | | | | | | | | This test was XFAILed because of symlinks, but some versions of ln -s seem to work on Windows, so the test was unexpectedly passing on our bot: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/13233 Unexpected Passing Tests (1): Clang :: VFS/subframework-symlink.m I don't know how or why, but it seems dependent on system configuration, and is not something worth debugging. Avoid the problem by marking the test UNSUPPORTED: system-windows instead of XFAIL: system-windows.
* [OpenCL] Fixed printing of __private in AMDGPU testAnastasia Stulova2019-12-271-2/+2
| | | | Tags: #clang
* [OpenCL] Fix inconsistency between opencl and c11 atomic fetch max/minYaxun (Sam) Liu2019-12-271-2/+2
| | | | | | | | | | | | There is some inconsistency between opencl and c11 atomic fetch max/min after https://reviews.llvm.org/D46386 https://reviews.llvm.org/D55562 It is not reasonable to have such inconsistencies. This patch fixes that. Differential Revision: https://reviews.llvm.org/D71725
* [OpenCL] Pretty print __private addr spaceAnastasia Stulova2019-12-2734-333/+333
| | | | | | | | | | Add printing of __private address space to TypePrinter to allow it appears in diagnostics and AST dumps as all other language addr spaces. Tags: #clang Differential Revision: https://reviews.llvm.org/D71272
* [clang][test] Minor fixes in testcase absolute-paths-symlinks.cKarl-Johan Karlsson2019-12-261-3/+5
| | | | This is a follow up commit to address post-commit comment in D70527.
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-241-1/+1
| | | | as cleanups after D56351
* [OPENMP50]Basic support for conditional lastprivate.Alexey Bataev2019-12-2434-85/+244
| | | | Added parsing/sema checks for conditional lastprivates.
* [Sema][X86] Consider target attribute into the checks in validateOutputSize ↵Craig Topper2019-12-231-0/+32
| | | | | | | | | | | | | and validateInputSize. The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in. This patch moves some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Differential Revision: https://reviews.llvm.org/D68627
* [OPENMP50]Codegen for nontemporal clause.Alexey Bataev2019-12-238-92/+164
| | | | | | | | | | | | | | | | Summary: Basic codegen for the declarations marked as nontemporal. Also, if the base declaration in the member expression is marked as nontemporal, lvalue for member decl access inherits nonteporal flag from the base lvalue. Reviewers: rjmccall, hfinkel, jdoerfert Subscribers: guansong, arphaman, caomhin, kkwli0, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71708
* [OpenCL] Add atomic builtin functionsSven van Haastregt2019-12-231-2/+8
| | | | | | Add atomic builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt.
* [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windowsMartin Storsjö2019-12-231-0/+9
| | | | | | | | | Since 6bf108d77a3c, we try to not mark extern_weak symbols as dso_local, to allow using COFF stubs for references to those symbols (as the symbol may be missing, resolving to an absolute address zero, outside of the current DSO). Differential Revision: https://reviews.llvm.org/D71716
* [Concepts] Constrained partial specializations and function overloads.Saar Raz2019-12-235-5/+220
| | | | | | | Added support for constraint satisfaction checking and partial ordering of constraints in constrained partial specialization and function template overloads. Re-commit after fixing another crash (added regression test). Differential Revision: https://reviews.llvm.org/D41910
* reland "[DebugInfo] Support to emit debugInfo for extern variables"Yonghong Song2019-12-224-0/+84
| | | | | | | | | | | | | Commit d77ae1552fc21a9f3877f3ed7e13d631f517c825 ("[DebugInfo] Support to emit debugInfo for extern variables") added deebugInfo for extern variables for BPF target. The commit is reverted by 891e25b02d760d0de18c7d46947913b3166047e7 as the committed tests using %clang instead of %clang_cc1 causing test failed in certain scenarios as reported by Reid Kleckner. This patch fixed the tests by using %clang_cc1. Differential Revision: https://reviews.llvm.org/D71818
* Revert "[DebugInfo] Support to emit debugInfo for extern variables"Reid Kleckner2019-12-224-88/+0
| | | | | | | This reverts commit d77ae1552fc21a9f3877f3ed7e13d631f517c825. The tests committed along with this change do not pass, and should be changed to use %clang_cc1.
* Revert "[Concepts] Constrained partial specializations and function overloads."Reid Kleckner2019-12-225-213/+5
| | | | | | This reverts commit d3f5769d5e93b30d4a8b4696381d5e4a304992fa. Causes crashes on Chromium. Have reproducer, will reduce and send along.
* [ms] [X86] Use "P" modifier on operands to call instructions in inline X86 ↵Eric Astor2019-12-223-4/+4
| | | | | | | | | | | | | | | | | | | | assembly. Summary: This is documented as the appropriate template modifier for call operands. Fixes PR44272, and adds a regression test. Also adds support for operand modifiers in Intel-style inline assembly. Reviewers: rnk Reviewed By: rnk Subscribers: merge_guards_bot, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71677
* [Sema] SequenceChecker: C++17 sequencing rules for built-in operators <<, ↵Bruno Ricci2019-12-223-23/+81
| | | | | | | | | | | >>, .*, ->*, =, op= Implement the C++17 sequencing rules for the built-in operators <<, >>, .*, ->*, = and op=. Differential Revision: https://reviews.llvm.org/D58297 Reviewed By: rsmith
* [Sema] SequenceChecker: Fix handling of operator ||, && and ?:Bruno Ricci2019-12-222-15/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | The current handling of the operators ||, && and ?: has a number of false positive and false negative. The issues for operator || and && are: 1. We need to add sequencing regions for the LHS and RHS as is done for the comma operator. Not doing so causes false positives in expressions like `((a++, false) || (a++, false))` (from PR39779, see PR22197 for another example). 2. In the current implementation when the evaluation of the LHS fails, the RHS is added to a worklist to be processed later. This results in false negatives in expressions like `(a && a++) + a`. Fix these issues by introducing sequencing regions for the LHS and RHS, and by not deferring the visitation of the RHS. The issues with the ternary operator ?: are similar, with the added twist that we should not warn on expressions like `(x ? y += 1 : y += 2)` since exactly one of the 2nd and 3rd expression is going to be evaluated, but we should still warn on expressions like `(x ? y += 1 : y += 2) = y`. Differential Revision: https://reviews.llvm.org/D57747 Reviewed By: rsmith
* [Concepts] Constrained partial specializations and function overloads.Saar Raz2019-12-225-5/+213
| | | | | | | Added support for constraint satisfaction checking and partial ordering of constraints in constrained partial specialization and function template overloads. Re-commit after fixing some crashes and warnings. Differential Revision: https://reviews.llvm.org/D41910
* [Driver] Allow -mnop-mcount for SystemZ and -mfentry for X86 and SystemZFangrui Song2019-12-222-3/+16
| | | | | | | | | | | | | | | | | | | | | | | gcc/config/{i386,s390} support -mnop-mcount. We currently only support -mnop-mcount for SystemZ. The function attribute "mnop-mcount" is ignored on other targets. gcc/config/{i386,s390} support -mfentry. We currently only support -mfentry for X86 and SystemZ. TargetOpcode::FENTRY_CALL is not handled on other targets. % clang -target aarch64 -pg -mfentry a.c -c fatal error: error in backend: Not supported instr: <MCInst 21> -mfentry, -mrecord-mcount, and -mnop-mcount were invented for Linux ftrace. Linux uses $(call cc-option-yn,-mrecord-mcount) to detect if the specific feature is available. Reject unsupported features so that Linux build system will not wrongly consider them available and cause build/runtime failures. Note, GCC has stricter checks that we do not implement, e.g. -fpic/-fpie -fnop-mcount is not allowed on x86, -fpic/-fpie -mfentry is not allowed on x86-32.
* [Driver] Verify -mrecord-mcount in Driver, instead of CodeGen after D71627Fangrui Song2019-12-213-6/+8
| | | | | | | | | | | GCC's x86 and s390 ports support -mrecord-mcount. Other ports reject the option. aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mrecord-mcount’ Allowing this option can cause failures when building Linux kernel for aarch64, powerpc64, etc, which will think the feature is available if the clang command returns 0.
* [Wdocumentation] Implement \anchorMark de Wever2019-12-215-0/+33
| | | | Differential revision: https://reviews.llvm.org/D69223
* Add missing `REQUIRES: hexagon-registered-target`David Zarzycki2019-12-211-0/+1
| | | | | After d567b0ba841d4b6f4b0d906da350a3bb2b2f769f, the test suite no longer passes if hexagon is disabled.
* Rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysrootAdrian Prantl2019-12-201-1/+1
| | | | | | | | | | | | This is a purely cosmetic change that is NFC in terms of the binary output. I bugs me that I called the attribute DW_AT_LLVM_isysroot since the "i" is an artifact of GCC command line option syntax (-isysroot is in the category of -i options) and doesn't carry any useful information otherwise. This attribute only appears in Clang module debug info. Differential Revision: https://reviews.llvm.org/D71722
* [analyzer] Add path notes to FuchsiaHandleCheck.Gabor Horvath2019-12-201-8/+52
| | | | Differential Revision: https://reviews.llvm.org/D70725
* [analyzer] Add Fuchsia Handle checkerGabor Horvath2019-12-201-0/+285
| | | | | | | The checker can diagnose handle use after releases, double releases, and handle leaks. Differential Revision: https://reviews.llvm.org/D70470
* Avoid unsupported LLD optionsSid Manning2019-12-202-0/+22
| | | | Differential Revision: https://reviews.llvm.org/D70919
* [attributes][analyzer] Add annotations for handles.Gabor Horvath2019-12-202-0/+25
| | | | | | | These annotations will be used in an upcomming static analyzer check that finds handle leaks, use after releases, and double releases. Differential Revision: https://reviews.llvm.org/D70469
OpenPOWER on IntegriCloud