summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Add _mm_prefetch and some others as MS builtinsWarren Hunt2014-02-192-0/+38
| | | | | | | | | | | | | This patch adds several built-ins that are required for ms compatibility. _mm_prefetch must be a built-in because it takes a compile-time constant argument and our prior approach of using a #define to the current built-in doesn't work in the presence of re-declaration of _mm_prefetch. The others can be obtained by including the windows system headers. If a user includes the windows system headers but not intrin.h they still need to work and therefore must be built-in because we don't get a chance to implement them in intrin.h in this case. llvm-svn: 201734
* Hook up NetBSD/sparc and NetBSD/sparc64 as and ld invocations.Joerg Sonnenberger2014-02-192-0/+84
| | | | llvm-svn: 201730
* Teach Clang to provide ::max_align_t in C11 and C++11 modes.Chandler Carruth2014-02-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This definition is not chosen idly. There is an unfortunate reality with max_align_t -- the specific nature of its definition leaks into the ABI almost immediately. Because it is part of C11 and C++11 it becomes essential for it to match with other systems on that ABI. There is an effort to discourage any further use of this construct as a consequence -- using max_align_t introduces an immediate ABI problem. We can never update it to have larger alignment even as the microarchitecture changes to necessitate higher alignment. =/ The particular definition here exactly matches the ABI of GCC's chosen ::max_align_t definition, for better or worse. This was written with the help of Richard Smith who was decoding the exact ABI implications of the selected definition in GCC. Notably, in-register arguments are impacted by the particular definition chosen. =/ No one is under the illusion that this is a "good" or "useful" definition of max_align_t, and we are working with the standards committee to specify a more useful interface to address this need. llvm-svn: 201729
* MS ABI: Let non-virtual method overloads participate in vftable orderingReid Kleckner2014-02-191-0/+27
| | | | | | | | | | | | | In the Microsoft ABI, the vftable is laid out as if all methods in every overload set were declared in reverse order of declaration at the point of declaration of the first overload in the set. Previously we only considered virtual methods in an overload set, but MSVC includes non-virtual methods for ordering purposes. Fixes PR18902. llvm-svn: 201722
* clang-cl: Pass /Z7 when we fallback to cl with debug info enabledReid Kleckner2014-02-191-1/+2
| | | | | | | Clang itself only emits CodeView line tables, so it seems more consistent to ask cl.exe for the same format. llvm-svn: 201721
* [analyzer] Extend IdenticalExprChecker to check logical and bitwise expressions.Jordan Rose2014-02-191-0/+86
| | | | | | | | | | | IdenticalExprChecker now warns if any expressions in a logical or bitwise chain (&&, ||, &, |, or ^) are the same. Unlike the previous patch, this actually checks all subexpressions against each other (an O(N^2) operation, but N is likely to be small). Patch by Daniel Fahlgren! llvm-svn: 201702
* [analyzer] Extend IdenticalExprChecker to check the two branches of an if.Jordan Rose2014-02-192-0/+152
| | | | | | | | | | | | | | | This extends the checks for identical expressions to handle identical statements, and compares the consequent and alternative ("then" and "else") branches of an if-statement to see if they are identical, treating a single statement surrounded by braces as equivalent to one without braces. This does /not/ check subsequent branches in an if/else chain, let alone branches that are not consecutive. This may improve in a future patch, but it would certainly take more work. Patch by Daniel Fahlgren! llvm-svn: 201701
* AArch64: look up EmitAArch64Scalar support before calling.Tim Northover2014-02-191-0/+14
| | | | | | | | | | | | This fixes one immediate bug where an expression with side-effects could be emitted twice during a NEON call. It also prepares the way for folding CodeGen for many of the SISD intrinsics into a table, reducing code size and hopefully increasing performance eventually ("binary search + few switch cases" should be better than "lots of switch cases"). llvm-svn: 201667
* Add FreeBSD ARM EABI hard-float supportRenato Golin2014-02-191-0/+9
| | | | | | Patch by Andrew Turner. llvm-svn: 201662
* ARM NEON: add vcvtX (with rounding mode) intrinsics to v8 ARM.Tim Northover2014-02-191-0/+99
| | | | | | | | | | These instructions (well, the f32 ones) are supported on 32-bit ARMv8, not just AArch64. Now that the arm_neon.td refactoring is complete, adding them is surprisingly simple. rdar://problem/16035743 llvm-svn: 201661
* [analyzer] Move checker alpha.osx.cocoa.MissingSuperCall out of alpha category.Ted Kremenek2014-02-191-1/+1
| | | | llvm-svn: 201640
* Implement DR577David Majnemer2014-02-193-6/+3
| | | | | | | | DR18 previously forebode typedefs to be used as parameter types if they were of type 'void'. DR577 allows 'void' to be used as a function parameter type regardless from where it came. llvm-svn: 201631
* clang-cl /fallback: turn the note into a warningHans Wennborg2014-02-191-2/+2
| | | | llvm-svn: 201626
* PR13110: Add a -Wignored-qualifiers warning when ignoring a const, volatile, orRichard Smith2014-02-195-10/+19
| | | | | | _Atomic qualifier applied to a reference type. llvm-svn: 201620
* Add missing test file for r201615Reid Kleckner2014-02-181-0/+3
| | | | llvm-svn: 201617
* Fix false positives in -Wmsvc-include by continuing header searchReid Kleckner2014-02-182-1/+5
| | | | | | | | | | | This makes Clang and LLVM -Wmsvc-include clean. I believe the correct behavior here is to avoid updating the cache when we find the header via MSVC's search rules. Differential Revision: http://llvm-reviews.chandlerc.com/D2733 llvm-svn: 201615
* Fix the Driver/cl-fallback.c testHans Wennborg2014-02-181-1/+1
| | | | | | On machines that have cl.exe on PATH, the note will print the full path. llvm-svn: 201613
* MS ABI: Remove nv adjustment from direct vdtor calls and prologuesReid Kleckner2014-02-181-0/+75
| | | | | | | | | | | | | | | | | | | | Summary: Generally the vector deleting dtor, which we model as a vtable thunk, takes care of non-virtual adjustment and delegates to the other destructor variants. The other non-complete destructor variants assume that 'this' on entry points to the virtual base subobject that first declared the virtual destructor. We need to change the adjustment in both the prologue and the vdtor call setup. Reviewers: timurrrr CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2821 llvm-svn: 201612
* More tests for r201536.Richard Smith2014-02-181-0/+14
| | | | llvm-svn: 201610
* clang-cl /fallback: emit a note when falling backHans Wennborg2014-02-181-0/+6
| | | | | | This makes it a lot easier to see what's going on from the output. llvm-svn: 201604
* Fix testcase to actually check what it was supposed to, and make it a bit ↵Richard Smith2014-02-181-3/+2
| | | | | | more robust. llvm-svn: 201591
* Attempting to fix the build bot due to some missing text in the ast dump.Aaron Ballman2014-02-181-1/+1
| | | | llvm-svn: 201590
* clang-cl: Parse the /d2Zi+ flag (PR18728)Hans Wennborg2014-02-181-0/+1
| | | | | | | This is an undocumented, but reportedly widely used flag. We don't support it, but should be able to parse it. llvm-svn: 201588
* Missed updating this test case with r201585 -- the lockable attribute is now ↵Aaron Ballman2014-02-181-1/+1
| | | | | | internally represented by CapabilityAttr. llvm-svn: 201587
* DeLesley Hutchins (who wrote the original thread-safety attribute ↵Aaron Ballman2014-02-182-16/+41
| | | | | | | | | | | | | | | functionality) and I have agreed to start migrating from lock-specific terminology to "capability"-specific terminology. This opens the door for future threading-related analysis passes so that a common nomenclature can be used. The following attributes have been (silently) deprecated, with their replacements listed: lockable => capability exclusive_locks_required => requires_capability shared_locks_required => requires_shared_capability locks_excluded => requires_capability There are no functional changes intended. llvm-svn: 201585
* [analyzer] Teach CastSizeChecker about flexible array members.Jordan Rose2014-02-182-2/+218
| | | | | | | | | ...as well as fake flexible array members: structs that end in arrays with length 0 or 1. Patch by Daniel Fahlgren! llvm-svn: 201583
* libclang: fix a bug in processing invalid arguments, introduced in r201249Dmitri Gribenko2014-02-182-8/+17
| | | | | | Recommit r201346, reverted in r201373. llvm-svn: 201578
* MS ABI: Refactor extended qualifiersDavid Majnemer2014-02-182-0/+9
| | | | | | | Extended qualifiers can appear in many places, refactor the code so it's more reusable. Add tests in areas where we've increased compatibility. llvm-svn: 201574
* MS ABI: Add support for mangling __restrictDavid Majnemer2014-02-182-0/+25
| | | | | | | | | | | | Pointer types in the MSVC ABI are a bit awkward, the width of the pointer is considered a kind of CVR qualifier. Restrict is handled similarly to const and volatile but is mangled after the pointer width qualifier. This fixes PR18880. llvm-svn: 201569
* PR18876: The special-case rule that ignores the destruction of a top-levelRichard Smith2014-02-182-14/+28
| | | | | | | | temporary in a decltype expression only applies if that temporary was created by a function call, not by a function-style cast or other flavour of expression. llvm-svn: 201542
* PR18839: 'extern "C++"' also adds an implicit 'extern', not just 'extern "C"'.Richard Smith2014-02-171-3/+7
| | | | llvm-svn: 201537
* PR18870: Parse language linkage specifiers properly if the string-literal isRichard Smith2014-02-171-1/+1
| | | | | | spelled in an interesting way. llvm-svn: 201536
* PR18855: Add support for UCNs and UTF-8 encoding within ud-suffixes.Richard Smith2014-02-171-0/+32
| | | | llvm-svn: 201532
* Change PGO instrumentation to compute counts in a separate AST traversal.Bob Wilson2014-02-174-130/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we made one traversal of the AST prior to codegen to assign counters to the ASTs and then propagated the count values during codegen. This patch now adds a separate AST traversal prior to codegen for the -fprofile-instr-use option to propagate the count values. The counts are then saved in a map from which they can be retrieved during codegen. This new approach has several advantages: 1. It gets rid of a lot of extra PGO-related code that had previously been added to codegen. 2. It fixes a serious bug. My original implementation (which was mailed to the list but never committed) used 3 counters for every loop. Justin improved it to move 2 of those counters into the less-frequently executed breaks and continues, but that turned out to produce wrong count values in some cases. The solution requires visiting a loop body before the condition so that the count for the condition properly includes the break and continue counts. Changing codegen to visit a loop body first would be a fairly invasive change, but with a separate AST traversal, it is easy to control the order of traversal. I've added a testcase (provided by Justin) to make sure this works correctly. 3. It improves the instrumentation overhead, reducing the number of counters for a loop from 3 to 1. We no longer need dedicated counters for breaks and continues, since we can just use the propagated count values when visiting breaks and continues. To make this work, I needed to make a change to the way we count case statements, going back to my original approach of not including the fall-through in the counter values. This was necessary because there isn't always an AST node that can be used to record the fall-through count. Now case statements are handled the same as default statements, with the fall-through paths branching over the counter increments. While I was at it, I also went back to using this approach for do-loops -- omitting the fall-through count into the loop body simplifies some of the calculations and make them behave the same as other loops. Whenever we start using this instrumentation for coverage, we'll need to add the fall-through counts into the counter values. llvm-svn: 201528
* Revert "Debug info: Make DWARF4 the default for Darwin, too."Adrian Prantl2014-02-173-4/+15
| | | | | | | | | I'm holding this change to give maintainers of Darwin buildbots more time to update their toolchains. This reverts commit r201375. llvm-svn: 201520
* check-clang: Introduce the feature "non-ms-sdk" to suppress ↵NAKAMURA Takumi2014-02-162-1/+7
| | | | | | Driver/nostdincxx.cpp on msvc. llvm-svn: 201484
* check-clang: Introduce the feature "dw2" to suppress ↵NAKAMURA Takumi2014-02-162-0/+5
| | | | | | | CodeGenCXX/debug-info-namespace.cpp with *-win32. FIXME: Could we add itanium triple here? llvm-svn: 201483
* Introduce the feature "can-remove-opened-file" to suppress tests. [PR18856]NAKAMURA Takumi2014-02-162-1/+6
| | | | llvm-svn: 201482
* Use -target instead of ignored -arch to fix x86_64 buildersNico Rieck2014-02-161-1/+1
| | | | llvm-svn: 201480
* Remove useless XPASSNico Rieck2014-02-161-1/+0
| | | | llvm-svn: 201478
* Fix broken CHECK linesNico Rieck2014-02-1615-28/+28
| | | | llvm-svn: 201477
* FileCheck's -LABEL cannot be combined with -NOT or -DAGNico Rieck2014-02-163-19/+19
| | | | llvm-svn: 201476
* Fix broken RUN linesNico Rieck2014-02-163-7/+7
| | | | llvm-svn: 201475
* DebugInfo: imported_decl/using declarations at namespace scopeDavid Blaikie2014-02-151-1/+6
| | | | llvm-svn: 201470
* [Sema] Fix assertion hit while trying to do constant evaluation for a ↵Argyrios Kyrtzidis2014-02-151-0/+8
| | | | | | | | | | dependent expression inside a GNU statement expression. rdar://16064952 llvm-svn: 201468
* MS ABI: Remove a useless FileCheck lineDavid Majnemer2014-02-151-3/+0
| | | | | | | | 1. CHECK-NOT-LABEL is not valid FileCheck. 2. This test would not trigger the CHECK-NOT-LABEL even if 'interface' is replaced with 'struct'. llvm-svn: 201462
* Move test inputs into the Inputs directory (improvement/fix to r201419)David Blaikie2014-02-153-1/+1
| | | | llvm-svn: 201458
* PGO: fix a bug in parsing pgo data.Manman Ren2014-02-151-0/+3
| | | | | | | | When a function has a single counter, we will offset the pointer by 1 when parsing the next function. If a function has multiple counters, we are okay after skipping rest of the counters. llvm-svn: 201456
* MS ABI: Fix some layout testsDavid Majnemer2014-02-151-20/+16
| | | | | | | | Some lines intended to be used for testing x86_64 ABI compatibility were not firing because lines were annotated with the wrong FileCheck prefix: X64 vs 64 llvm-svn: 201454
* MS ABI: Fix some layout testsDavid Majnemer2014-02-151-14/+11
| | | | | | | | Some lines intended to be used for testing x86_64 ABI compatibility were not firing because lines were annotated with the wrong FileCheck prefix: X64 vs C64 llvm-svn: 201453
OpenPOWER on IntegriCloud