summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [Analyzer] Revert r318750 because incorrect files were added for commit.Aleksei Sidorin2017-11-211-96/+0
| | | | | | Sorry for the noise. llvm-svn: 318753
* [Analyzer] Non-determinism: stable iteration on indirect goto LabelDecl'sAleksei Sidorin2017-11-211-0/+96
| | | | | | | | | | | | | | | | | | CFG wass built in non-deterministic order due to the fact that indirect goto labels' declarations (LabelDecl's) are stored in the llvm::SmallSet container. LabelDecl's are pointers, whose order is not deterministic, and llvm::SmallSet sorts them by their non-deterministic addresses after "small" container is exceeded. This leads to non-deterministic processing of the elements of the container. The fix is to use llvm::SmallSetVector that was designed to have deterministic iteration order. Patch by Ilya Palachev! Differential Revision: https://reviews.llvm.org/D40073 llvm-svn: 318750
* [Modules TS] Added module re-export support.Hamza Sood2017-11-212-4/+40
| | | | | | | This implements [dcl.modules.export] from the C++ Modules TS, which lets a module re-export another module with the "export import" syntax. Differential Revision: https://reviews.llvm.org/D40270 llvm-svn: 318744
* [x86][inline-asm] allow recognition of MPX regs inside ms inline-asm blobCoby Tayree2017-11-211-0/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D38445 llvm-svn: 318739
* [MS] add an init test for thumbv7-windows-msvcMartell Malone2017-11-211-0/+5
| | | | llvm-svn: 318736
* [MS] Increase default new alignment for win64 and test itReid Kleckner2017-11-212-3/+21
| | | | | | | | | | | | | | | | | | Summary: This raises __STDCPP_DEFAULT_NEW_ALIGNMENT__ from 8 to 16 on Win64. This matches platforms that follow the usual `2 * sizeof(void*)` alignment requirement for malloc. We might want to consider making that the default rather than relying on long double alignment. Fixes PR35356 Reviewers: STL_MSFT, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40277 llvm-svn: 318723
* Re-revert "Refactor debuginfo-tests."Zachary Turner2017-11-212-8/+2
| | | | | | | | | | This is still breaking greendragon. At this point I give up until someone can fix the greendragon bots, and I will probably abandon this effort in favor of using a private github repository. llvm-svn: 318722
* [analyzer] Diagnose stack leaks via block capturesAlexander Shaposhnikov2017-11-202-0/+212
| | | | | | | | | | | This diff extends StackAddrEscapeChecker to catch stack addresses leaks via block captures if the block is executed asynchronously or returned from a function. Differential revision: https://reviews.llvm.org/D39438 llvm-svn: 318705
* Revert r318669/318694Erich Keane2017-11-2015-109/+55
| | | | | | Broke some libclang tests, so reverting for now. llvm-svn: 318698
* Resubmit "Refactor debuginfo-tests" again.Zachary Turner2017-11-202-2/+8
| | | | | | | | | | | | This was reverted due to the tests being run twice on some build bots. Each run had a slightly different configuration due to the way in which it was being invoked. This fixes the problem (albeit in a somewhat hacky way). Hopefully in the future we can get rid of the workflow of running debuginfo-tests as part of clang, and then this hack can go away. llvm-svn: 318697
* Include test files for rL318668Erich Keane2017-11-203-0/+53
| | | | | | Forgotten when doing my SVN commit. llvm-svn: 318694
* [OpenMP] Initial implementation of code generation for pragma 'teams ↵Carlo Bertolli2017-11-2012-0/+3389
| | | | | | | | | | distribute parallel for' on host https://reviews.llvm.org/D40187 This patch implements code gen for 'teams distribute parallel for' on the host, including all its clauses and related regression tests. llvm-svn: 318692
* For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is availableErich Keane2017-11-2012-55/+56
| | | | | | | | | | | | | | | | | | | | | | As reported in llvm bugzilla 32377. Here’s a patch to add preinclude of stdc-predef.h. The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html; The preinclude is inhibited with –ffreestanding. Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior. I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here Patch By: mibintc Differential Revision: https://reviews.llvm.org/D34158 llvm-svn: 318669
* Revert r318456 "Issue -Wempty-body warnings for else blocks"Hans Wennborg2017-11-201-20/+0
| | | | | | | | | | | | | | This caused warnings also when the if or else comes from macros. There was an attempt to fix this in r318556, but that introduced new problems and was reverted. Reverting this too until the whole issue is sorted. > This looks like it was just an oversight. > > Fixes http://llvm.org/pr35319 > > git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318456 91177308-0d34-0410-b5e6-96231b3b80d8 llvm-svn: 318667
* Revert r318556 "Loosen -Wempty-body warning"Hans Wennborg2017-11-201-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems this somehow made -Wempty-body fire in some macro cases where it didn't before, e.g. ../../third_party/ffmpeg/libavcodec/bitstream.c(169,5): error: if statement has empty body [-Werror,-Wempty-body] ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size); ^ ../../third_party/ffmpeg\libavutil/internal.h(276,80): note: expanded from macro 'ff_dlog' # define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) ^ ../../third_party/ffmpeg/libavcodec/bitstream.c(169,5): note: put the semicolon on a separate line to silence this warning Reverting until this can be figured out. > Do not show it when `if` or `else` come from macros. > E.g., > > #define USED(A) if (A); else > #define SOME_IF(A) if (A) > > void test() { > // No warnings are shown in those cases now. > USED(0); > SOME_IF(0); > } > > Patch by Ilya Biryukov! > > Differential Revision: https://reviews.llvm.org/D40185 llvm-svn: 318665
* [ARM] For assembler files recognize -Xassembler or -Wa, -mthumbPeter Smith2017-11-201-0/+17
| | | | | | | | | | | | | | | | | | | | | | The Unified Arm Assembler Language is designed so that the majority of assembler files can be assembled for both Arm and Thumb with the choice made as a compilation option. The way this is done in gcc is to pass -mthumb to the assembler with either -Wa,-mthumb or -Xassembler -mthumb. This change adds support for these options to clang. There is no assembler equivalent of -mno-thumb, -marm or -mno-arm so we don't need to recognize these. Ideally we would do all of the processing in CollectArgsForIntegratedAssembler(). Unfortunately we need to change the triple and at that point it is too late. Instead we look for the option earlier in ComputeLLVMTriple(). Fixes PR34519 Differential Revision: https://reviews.llvm.org/D40127 llvm-svn: 318647
* [X86] Make sure 'knm' is accepted by -target-cpuCraig Topper2017-11-191-0/+1
| | | | llvm-svn: 318620
* [X86] Make sure 'knm' and 'cannonlake' are accepted by builtin_cpu_isCraig Topper2017-11-191-0/+2
| | | | llvm-svn: 318619
* [X86] Add icelake CPU support for -march.Craig Topper2017-11-193-0/+94
| | | | llvm-svn: 318617
* [X86] Set __corei7__ preprocessor defines for skylake server and cannonlake.Craig Topper2017-11-191-6/+12
| | | | | | This is the resolution we came to in D38824. llvm-svn: 318616
* [Driver] add initial support for alpine linuxMartell Malone2017-11-191-0/+16
| | | | | | | | | | | | set -pie as default for musl linux targets add detection of alpine linux append appropriate compile flags for alpine Reviewers: rnk Differential Revision: https://reviews.llvm.org/D39588 llvm-svn: 318608
* [OpenMP] Show error if VLAs are not supportedJonas Hahnfeld2017-11-181-0/+201
| | | | | | | | | | | | | | Some target devices (e.g. Nvidia GPUs) don't support dynamic stack allocation and hence no VLAs. Print errors with description instead of failing in the backend or generating code that doesn't work. This patch handles explicit uses of VLAs (local variable in target or declare target region) or implicitly generated (private) VLAs for reductions on VLAs or on array sections with non-constant size. Differential Revision: https://reviews.llvm.org/D39505 llvm-svn: 318601
* [CodeGen] change const-ness of complex callsSanjay Patel2017-11-183-116/+116
| | | | | | | | | | | | | | | | | After clarification about the C standard, POSIX, and implementations: The C standard allows errno-setting, and it's (unfortunately for optimization) even more clearly stated in the newer additions to the standards. We can leave these functions as always constant ('c') because they don't actually do any math and therefore won't set errno: cimag ( http://en.cppreference.com/w/c/numeric/complex/cimag ) creal ( http://en.cppreference.com/w/c/numeric/complex/creal ) cproj ( http://en.cppreference.com/w/c/numeric/complex/cproj ) conj (http://en.cppreference.com/w/c/numeric/complex/conj ) Differential Revision: https://reviews.llvm.org/D39611 llvm-svn: 318598
* Fix coverage test on Windows botReid Kleckner2017-11-171-1/+1
| | | | llvm-svn: 318559
* Loosen -Wempty-body warningReid Kleckner2017-11-171-0/+11
| | | | | | | | | | | | | | | | | | | | Do not show it when `if` or `else` come from macros. E.g., #define USED(A) if (A); else #define SOME_IF(A) if (A) void test() { // No warnings are shown in those cases now. USED(0); SOME_IF(0); } Patch by Ilya Biryukov! Differential Revision: https://reviews.llvm.org/D40185 llvm-svn: 318556
* [ObjC][ARC] Honor noescape attribute for -Warc-retain-cyclesAlex Lorenz2017-11-171-0/+12
| | | | | | | | rdar://35409566 Differential Revision: https://reviews.llvm.org/D40141 llvm-svn: 318552
* [CodeGen] Compute the objc EH vtable address point using inbounds GEP.Ahmed Bougacha2017-11-171-4/+4
| | | | | | | | | | | | | | | | The object is provided by the objc runtime and is never visible in the module itself, but even so, the address point we compute points into it, and "+16" is guaranteed not to overflow. This matches the c++ vtable IRGen. Note that I'm not entirely convinced the 'i8*' type is correct here: at the IR level, we're accessing memory that's outside the global object. But we don't control the allocation, so it's not obviously wrong either. But either way, this is only in a global initializer, so I don't think it's going to be mucked with. Filed PR35352 to discuss that. llvm-svn: 318545
* [OPENMP] Codegen for `target simd` construct.Alexey Bataev2017-11-173-0/+1194
| | | | | | Added codegen support for `target simd` directive. llvm-svn: 318536
* [MinGW] Define __ARM_DWARF_EH__ for MinGW/ARMMartin Storsjo2017-11-171-0/+4
| | | | | | | | | Since SVN r318510, the MinGW/ARM configuration defaults to dwarf exception handling. Differential Revision: https://reviews.llvm.org/D39533 llvm-svn: 318511
* Change path used in a test from r318503 to work on windowsBruno Cardoso Lopes2017-11-171-1/+1
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13565 llvm-svn: 318507
* [PCH+Modules] Improve diagnosticts to help out users pass an extra header ↵Bruno Cardoso Lopes2017-11-171-0/+17
| | | | | | | | | | | | | | | search path When mixing PCH and Implicit Modules, missing a header search path can lead to the implicit built PCM to complaint about not finding its matching module map. Instead of adding more magic to implicit modules engine, add a note to help the user add the appropriate path. rdar://problem/33388847 llvm-svn: 318503
* Re-revert "Refactor debuginfo-tests"Zachary Turner2017-11-172-7/+2
| | | | | | | | | | | | | | | | | | | | | | This is still broken because it causes certain tests to be run twice with slightly different configurations, which is wrong in some cases. You can observe this by running: ninja -nv check-all | grep debuginfo-tests And seeing that it passes clang/test and clang/test/debuginfo-tests to lit, which causes it to run debuginfo-tests twice. The fix is going to involve either: a) figuring out that we're running in this "deprecated" configuration, and then deleting the clang/test/debuginfo-tests path, which should cause it to behave identically to before, or: b) make lit smart enough that it doesn't descend into a sub-suite if that sub-suite already has a lit.cfg file. llvm-svn: 318486
* PR22763: if a defaulted (non-user-provided) special member function isRichard Smith2017-11-162-1/+22
| | | | | | | | | | | | | | | | explicitly instantiated, still emit it with each use. We don't emit a definition of the member with an explicit instantiation definition (and indeed it appears that we're not allowed to, since an explicit instantiation definition does not constitute an odr-use and only odr-use permits definition for defaulted special members). So we still need to emit a weak definition with each use. This also makes defaulted-in-class declarations behave more like implicitly-declared special members, which matches their design intent. And it matches the way this problem was solved in GCC. llvm-svn: 318474
* Issue -Wempty-body warnings for else blocksReid Kleckner2017-11-161-0/+20
| | | | | | | | This looks like it was just an oversight. Fixes http://llvm.org/pr35319 llvm-svn: 318456
* [MS] Apply adjustments after storing 'this'Reid Kleckner2017-11-164-43/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The MS ABI convention is that the 'this' pointer on entry is the address of the vfptr that was used to make the virtual method call. In other words, the pointer on entry always points to the base subobject that introduced the virtual method. Consider this hierarchy: struct A { virtual void f() = 0; }; struct B { virtual void g() = 0; }; struct C : A, B { void f() override; void g() override; }; On entry to C::g, [ER]CX will contain the address of C's B subobject, and C::g will have to subtract sizeof(A) to recover a pointer to C. Before this change, we applied this adjustment in the prologue and stored the new value into the "this" local variable alloca used for debug info. However, MSVC does not do this, presumably because it is often profitable to fold the adjustment into later field accesses. This creates a problem, because the debugger expects the variable to be unadjusted. Unfortunately, CodeView doesn't have anything like DWARF expressions for computing variables that aren't in the program anymore, so we have to declare 'this' to be the unadjusted value if we want the debugger to see the right value. This has the side benefit that, in optimized builds, the 'this' pointer will usually be available on function entry because it doesn't require any adjustment. Reviewers: hans Subscribers: aprantl, cfe-commits Differential Revision: https://reviews.llvm.org/D40109 llvm-svn: 318440
* Resubmit "Refactor debuginfo-tests"Zachary Turner2017-11-162-2/+7
| | | | | | | | | | This was reverted due to some failures on specific darwin buildbots, the issue being that the new lit configuration was not setting the SDKROOT environment variable. We've tested a fix locally and confirmed that it works, so this patch resubmits everything with the fix applied. llvm-svn: 318435
* [OPENMP] Add support for cancelling inside target parallel forAlexey Bataev2017-11-161-1/+3
| | | | | | | | directive. Added missed support for cancelling of target parallel for construct. llvm-svn: 318434
* Update tests for llvm.invariant.group.barrier becoming mangledYaxun Liu2017-11-162-30/+30
| | | | | | Differential Revision: https://reviews.llvm.org/D40062 llvm-svn: 318414
* [DeclPrinter] Honor TerseOutput for constructorsAlex Lorenz2017-11-161-1/+1
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D39957 llvm-svn: 318365
* Try to fix test/SemaCXX/deleted-operator.cpp after r318309Hans Wennborg2017-11-151-2/+2
| | | | | | | The number of 'built-in candidate' notes now varies since __float128 may or may not be a candidate depending on the target. llvm-svn: 318314
* BuiltinOperatorOverloadBuilder: Don't consider types that are unavailable on ↵Hans Wennborg2017-11-151-0/+34
| | | | | | | | | | | | | the target (PR35174) In the PR, Clang ended up in a situation where it tried to mangle the __float128 type, which isn't supported when targetingt MSVC, because Clang instantiated a variable template with that type when searching for a conversion to use in an arithmetic expression. Differential revision: https://reviews.llvm.org/D39579 llvm-svn: 318309
* [libclang] Fix cursors for in-class initializer of field declarationsBenjamin Kramer2017-11-151-0/+8
| | | | | | | | | | Fixes PR33745. Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40027 llvm-svn: 318292
* [OpenCL] Fix code generation of function-scope constant samplers.Alexey Bader2017-11-152-26/+19
| | | | | | | | | | | | | | | | | Summary: Constant samplers are handled as static variables and clang's code generation library, which leads to llvm::unreachable. We bypass emitting sampler variable as static since it's translated to a function call later. Reviewers: yaxunl, Anastasia Reviewed By: yaxunl, Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34342 llvm-svn: 318290
* PR35214: don't crash if we see an array of unknown bound added to an empty ↵Richard Smith2017-11-151-0/+8
| | | | | | but invalid designator. llvm-svn: 318258
* [PGO] Detect more structural changes with the stable hashVedant Kumar2017-11-1418-51/+496
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lifting from Bob Wilson's notes: The hash value that we compute and store in PGO profile data to detect out-of-date profiles does not include enough information. This means that many significant changes to the source will not cause compiler warnings about the profile being out of date, and worse, we may continue to use the outdated profile data to make bad optimization decisions. There is some tension here because some source changes won't affect PGO and we don't want to invalidate the profile unnecessarily. This patch adds a new hashing scheme which is more sensitive to loop nesting, conditions, and out-of-order control flow. Here are examples which show snippets which get the same hash under the current scheme, and different hashes under the new scheme: Loop Nesting Example -------------------- // Snippet 1 while (foo()) { while (bar()) {} } // Snippet 2 while (foo()) {} while (bar()) {} Condition Example ----------------- // Snippet 1 if (foo()) bar(); baz(); // Snippet 2 if (foo()) bar(); else baz(); Out-of-order Control Flow Example --------------------------------- // Snippet 1 while (foo()) { if (bar()) {} baz(); } // Snippet 2 while (foo()) { if (bar()) continue; baz(); } In each of these cases, it's useful to differentiate between the snippets because swapping their profiles gives bad optimization hints. The new hashing scheme considers some logical operators in an effort to detect more changes in conditions. This isn't a perfect scheme. E.g, it does not produce the same hash for these equivalent snippets: // Snippet 1 bool c = !a || b; if (d && e) {} // Snippet 2 bool f = d && e; bool c = !a || b; if (f) {} This would require an expensive data flow analysis. Short of that, the new hashing scheme looks reasonably complete, based on a scan over the statements we place counters on. Profiles which use the old version of the PGO hash remain valid and can be used without issue (there are tests in tree which check this). rdar://17068282 Differential Revision: https://reviews.llvm.org/D39446 llvm-svn: 318229
* Try to fix the instrument-functions testsHans Wennborg2017-11-142-4/+4
| | | | | | | | | On e.g. PPC the return value and argument were marked 'signext'. This makes the test expectations a bit more flexible. Follow-up to r318199. llvm-svn: 318214
* Switch -mcount and -finstrument-functions to emit EnterExitInstrumenter ↵Hans Wennborg2017-11-145-50/+95
| | | | | | | | | | | | | | | | attributes This updates -mcount to use the new attribute names (LLVM r318195), and switches over -finstrument-functions to also use these attributes rather than inserting instrumentation in the frontend. It also adds a new flag, -finstrument-functions-after-inlining, which makes the cygprofile instrumentation get inserted after inlining rather than before. Differential Revision: https://reviews.llvm.org/D39331 llvm-svn: 318199
* [OPENMP] Fix DSA analysis for threadprivates after deserialization.Alexey Bataev2017-11-141-4/+7
| | | | | | | If threadprivate vaible is deserialized, it is not marked as threadprivate in DSAStack. llvm-svn: 318194
* [refactor][extract] avoid extracting expressions from types in functionsAlex Lorenz2017-11-141-2/+16
| | | | llvm-svn: 318169
* [tooling] Make compile_flags.txt negative test more hermeticSam McCall2017-11-141-1/+2
| | | | llvm-svn: 318154
OpenPOWER on IntegriCloud