summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Generalize ObjCMissingSuperCallChecker.Jordan Rose2012-12-131-4/+91
| | | | | | | | We now check a few methods for UIResponder, NSResponder, and NSDocument. Patch by Julian Mayer! llvm-svn: 170089
* Using CanQualType::getAs<ArrayType> is unsafe; fix the code currently using it,Eli Friedman2012-12-132-1/+4
| | | | | | and make sure additional uses don't get introduced. <rdar://problem/12858424>. llvm-svn: 170081
* [analyzer] Fix a self-init checker false positive.Anna Zaks2012-12-131-0/+25
| | | | | | | | | | | This is a Band-Aid fix to a false positive, where we complain about not initializing self to [super init], where self is not coming from the init method, but is coming from the caller to init. The proper solution would be to associate the self and it's state with the enclosing init. llvm-svn: 170059
* objc: DOn't complain if a (SEL) expression is typecastFariborz Jahanian2012-12-131-0/+3
| | | | | | to (SEL). Fixes // rdar://12859590 llvm-svn: 170058
* Add missing check for error return from DefaultLvalueConversion. Fixes ↵Eli Friedman2012-12-131-0/+11
| | | | | | <rdar://problem/12857416>. llvm-svn: 170056
* More hacking on mapDiagnosticRanges to make it handle more cases.Eli Friedman2012-12-131-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | This still isn't quite right, but it fixes a crash. I factored out findCommonParent because we need it on the result of getImmediateExpansionRange: for a function macro, the beginning and end of an expansion range can come out of different macros/macro arguments, which means the resulting range is a complete mess to handle consistently. I also made some changes to how findCommonParent works; it works somewhat better in some cases, and somewhat worse in others, but I think overall it's a better balance. I'm coming to the conclusion that mapDiagnosticRanges isn't using the right algorithm, though: chasing the caret is fundamentally more complicated than any algorithm which only considers one FileID for the caret can handle because each SourceLocation doesn't really have a single parent. We need to follow the same path of choosing expansion locations and spelling locations which the caret used to come up with the correct range in the general case. Fixes <rdar://problem/12847524>. llvm-svn: 170049
* [objc] For the ARC error that is emitted when a synthesized property ↵Argyrios Kyrtzidis2012-12-124-31/+40
| | | | | | | | | | | | | | | implementation has inconsistent ownership with the backing ivar, point the error location to the ivar. Pointing to the ivar (instead of the @synthesize) is better since this is where a fix is needed. Also provide the location of @synthesize via a note. This also fixes the problem where an auto-synthesized property would emit an error without any location. llvm-svn: 170039
* [ms-inline asm] Test case for r170037.Chad Rosier2012-12-121-1/+4
| | | | llvm-svn: 170038
* Rewrite calls to bitcast unprototyped functions when emitting a definition.John McCall2012-12-122-1/+10
| | | | | | | | | | | | My variadics patch, r169588, changed these calls to typically be bitcasts rather than calls to a supposedly variadic function. This totally subverted a hack where we intentionally dropped excess arguments from such calls in order to appease the inliner and a "warning" from the optimizer. This patch extends the hack to also work with bitcasts, as well as teaching it to rewrite invokes. llvm-svn: 170034
* [analyzer] Don't crash running destructors for multidimensional arrays.Jordan Rose2012-12-121-0/+27
| | | | | | | | | | We don't handle array destructors correctly yet, but we now apply the same hack (explicitly destroy the first element, implicitly invalidate the rest) for multidimensional arrays that we already use for linear arrays. <rdar://problem/12858542> llvm-svn: 170000
* Marking the objc_autoreleaseReturnValue and objc_retainAutoreleaseReturnValue Chad Rosier2012-12-125-10/+10
| | | | | | | | | | call sites as tail calls unconditionally. While it's theoretically true that this is just an optimization, it's an optimization that we very much want to happen even at -O0, or else ARC applications become substantially harder to debug. See r169796 for the llvm/fast-isel side of things. rdar://12553082 llvm-svn: 169996
* Don't warn about disabled macro expansion if we see the name of a ↵Richard Smith2012-12-121-0/+4
| | | | | | function-like macro which isn't immediately followed by '('. FreeBSD's stdio.h #defines foo(x) to (foo)(x), apparently. llvm-svn: 169960
* [libclang] Make sure tokens from preprocessor directives are annotated as such,Argyrios Kyrtzidis2012-12-121-2/+31
| | | | | | | | even if the directive is inside a declaration. Fixes rdar://11548788 & http://llvm.org/PR12970 llvm-svn: 169949
* Fix line ending is tests. No functional change.Richard Trieu2012-12-122-37/+37
| | | | llvm-svn: 169947
* clang/test: Suppress two tests on win32 for now, since, not sure, in r169829 ↵NAKAMURA Takumi2012-12-122-0/+6
| | | | | | | | to r169831. "ansi-escape-sequences" is easy convenient to exclude win32. Please be patient. llvm-svn: 169945
* Try to fix Win32 failuresDouglas Gregor2012-12-111-1/+1
| | | | llvm-svn: 169923
* Don't use 'touch' in this test; it may be the cause of Windows-related failures.Douglas Gregor2012-12-111-1/+1
| | | | llvm-svn: 169922
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-1161-120/+120
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* Add SPIR32/SPIR64 targets to ClangGuy Benyei2012-12-112-0/+43
| | | | llvm-svn: 169917
* Add -fslp-vectorize to enable bb-vectorizeHal Finkel2012-12-111-0/+13
| | | | | | | | | | | Add -fslp-vectorize (with -ftree-slp-vectorize as an alias for gcc compatibility) to provide a way to enable the basic-block vectorization pass. This uses the same acronym as gcc, superword-level parallelism (SLP), also common in the literature, to refer to basic-block vectorization. Nadav suggested this as a follow-up to the adding of -fvectorize. llvm-svn: 169909
* objective-C blocks: Check for record type when deciding if Fariborz Jahanian2012-12-111-0/+7
| | | | | | | byref variable requires extended layout info. to prevent a crash involving arrays declared __block. // rdar://12787751 llvm-svn: 169908
* Don't complain about incomplete implementations for methods that areDouglas Gregor2012-12-111-1/+3
| | | | | | unavailable due to availability attributes. <rdar://problem/12798237> llvm-svn: 169903
* [driver] Add the -ftree-vectorize flag as a alias of -fvectorize to maintainChad Rosier2012-12-111-0/+4
| | | | | | | compatibility with gcc. rdar://12839978 llvm-svn: 169888
* [driver] Add the -fvectorize flag to enable the loop vectorization passes.Chad Rosier2012-12-111-0/+9
| | | | | | rdar://12839978 llvm-svn: 169885
* clang/test/Driver/linker-opts.c: Fix XFAIL that I removed win32.NAKAMURA Takumi2012-12-111-0/+1
| | | | | | Sorry for my 3rd commit :( llvm-svn: 169827
* clang/test/Driver/debug-options-as.c: Fixup not to use prefix=S. I didn't ↵NAKAMURA Takumi2012-12-111-3/+3
| | | | | | know "REQUIRES:" would match --check-prefix=S ... llvm-svn: 169826
* clang/test/Driver: Introduce the feature "clang-driver", set if gcc driver ↵NAKAMURA Takumi2012-12-118-5/+14
| | | | | | | | is not used. It is not set at targetting cygming. See PR12920. llvm-svn: 169824
* Add tests for a corner case of when to relax all instructions:Rafael Espindola2012-12-112-0/+8
| | | | | | | | | | | | | | | | We don't want to relax all instructions in $ clang -c test.s since most users don't pass -O when using the driver to assemble. On the other hand, -save-temps should not change the output unnecessary, so in $ clang -c test.c -save-temps we should relax all instructions. llvm-svn: 169815
* PR14558: Compute triviality of special members (etc) at the end of the classRichard Smith2012-12-111-0/+12
| | | | | | | | | definition, rather than at the end of the definition of the set of nested classes. We still defer checking of the user-specified exception specification to the end of the nesting -- we can't check that until we've parsed the in-class initializers for non-static data members. llvm-svn: 169805
* [analyzer] Don't generate a summary for "freeWhenDone" if method isAnna Zaks2012-12-111-0/+15
| | | | | | | | | inlined. Fixes a false positive that occurs if a user writes their own initWithBytesNoCopy:freeWhenDone wrapper. llvm-svn: 169795
* Remove until I can fix this.Bill Wendling2012-12-101-20/+0
| | | | llvm-svn: 169778
* Use correct flags for this test.Bill Wendling2012-12-101-1/+2
| | | | llvm-svn: 169768
* Fixup test case from r169755. These are driver options, not frontend options. Chad Rosier2012-12-101-1/+1
| | | | | | Also, add the -S option. llvm-svn: 169763
* Return true from HeaderSearch::isFileMultipleIncludeGuarded if the fileArgyrios Kyrtzidis2012-12-104-0/+12
| | | | | | was #import'ed. llvm-svn: 169761
* Specify if `-mno-red-zone' was used when creating the GCOV instrucmentation ↵Bill Wendling2012-12-101-0/+19
| | | | | | | | | pass. This prevents the functions generated by that pass from using the red zone. <rdar://problem/12843084> llvm-svn: 169755
* Remove unneeded typedef and volatileMichael Ilseman2012-12-102-6/+2
| | | | llvm-svn: 169743
* Virtual method overrides can no longer have mismatched calling conventions. ↵Aaron Ballman2012-12-092-0/+69
| | | | | | This fixes PR14339. llvm-svn: 169705
* Add a triple to this test. It depends on little-endian bitfield layout.Chandler Carruth2012-12-091-1/+1
| | | | llvm-svn: 169696
* Add a test case that I've been using to clarify the bitfield layout forChandler Carruth2012-12-091-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | both LE and BE targets. AFAICT, Clang get's this correct for PPC64. I've compared it to GCC 4.8 output for PPC64 (thanks Roman!) and to my limited ability to read power assembly, it looks functionally equivalent. It would be really good to fill in the assertions on this test case for x86-32, PPC32, ARM, etc., but I've reached the limit of my time and energy... Hopefully other folks can chip in as it would be good to have this in place to test any subsequent changes. To those who care about PPC64 performance, a side note: there is some *obnoxiously* bad code generated for these test cases. It would be worth someone's time to sit down and teach the PPC backend to pattern match these IR constructs better. It appears that things like '(shr %foo, <imm>)' turn into 'rldicl R, R, 64-<imm>, <imm>' or some such. They don't even get combined with other 'rldicl' instructions *immediately adjacent*. I'll add a couple of these patterns to the README, but I think it would be better to look at all the patterns produced by this and other bitfield access code, and systematically build up a collection of patterns that efficiently reduce them to the minimal code. llvm-svn: 169693
* Fix the bitfield record layout in codegen for big endian targets.Chandler Carruth2012-12-091-76/+162
| | | | | | | | | | | | | | | | | | This was an egregious bug due to the several iterations of refactorings that took place. Size no longer meant what it original did by the time I finished, but this line of code never got updated. Unfortunately we had essentially zero tests for this in the regression test suite. =[ I've added a PPC64 run over the bitfield test case I've been primarily using. I'm still looking at adding more tests and making sure this is the *correct* bitfield access code on PPC64 linux, but it looks pretty close to me, and it is *worlds* better than before this patch as it no longer asserts! =] More commits to follow with at least additional tests and maybe more fixes. Sorry for the long breakage due to this.... llvm-svn: 169691
* Fix overload resolution for the initialization of a multi-dimensionalRichard Smith2012-12-092-1/+18
| | | | | | | | | | array from a braced-init-list. There seems to be a core wording wart here (it suggests we should be testing whether the elements of the init list are implicitly convertible to the array element type, not whether there is an implicit conversion sequence) but our prior behavior appears to be a bug, not a deliberate effort to implement the standard as written. llvm-svn: 169690
* PR14550: If a system header contains a bogus constexpr function definition,Richard Smith2012-12-091-1/+21
| | | | | | don't mark the function as invalid, since we suppress the error. llvm-svn: 169689
* PR14549. Don't assert if we see an incomplete decltype specifier at the end ↵Richard Smith2012-12-091-0/+3
| | | | | | of the file. llvm-svn: 169688
* Escape % in the TextDiagnosticBuffer so they aren't interpreted twice when ↵Benjamin Kramer2012-12-081-1/+3
| | | | | | | | fed into the diagnostic formatting machinery again. Fixes PR14543. llvm-svn: 169677
* long double should be 64 bits on FreeBSD/MIPS64. It possibly should be onDavid Chisnall2012-12-081-0/+19
| | | | | | | | Linux too, as I think we inherited it from there. The ABI spec says 128-bit, although I think SGI's compiler on IRIX may be the only thing ever to support this. llvm-svn: 169674
* Finish implementing 'selected constructor' rules for triviality in C++11. InRichard Smith2012-12-084-6/+176
| | | | | | | | | | | | | | | | | | | | | | | | the cases where we can't determine whether special members would be trivial while building the class, we eagerly declare those special members. The impact of this is bounded, since it does not trigger implicit declarations of special members in classes which merely *use* those classes. In order to determine whether we need to apply this rule, we also need to eagerly declare move operations and destructors in cases where they might be deleted. If a move operation were supposed to be deleted, it would instead be suppressed, and we could need overload resolution to determine if we fall back to a trivial copy operation. If a destructor were implicitly deleted, it would cause the move constructor of any derived classes to be suppressed. As discussed on cxx-abi-dev, C++11's selected constructor rules are also retroactively applied as a defect resolution in C++03 mode, in order to identify that class B has a non-trivial copy constructor (since it calls A's constructor template, not A's copy constructor): struct A { template<typename T> A(T &); }; struct B { mutable A a; }; llvm-svn: 169673
* Thread-safety analysis: check member access on guarded non-primitive types.DeLesley Hutchins2012-12-081-1/+62
| | | | llvm-svn: 169669
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-0810-60/+344
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* [libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndefArgyrios Kyrtzidis2012-12-081-0/+9
| | | | | | | | | | directive as a macro expansion. This is more of a "macro reference" than a macro expansion but it's close enough for libclang's purposes. If it causes issues we can revisit and introduce a new kind of cursor. llvm-svn: 169666
* Implement C++03 [dcl.init]p5's checking for value-initialization of referencesRichard Smith2012-12-082-10/+44
| | | | | | | | properly, rather than faking it up by pretending that a reference member makes the default constructor non-trivial. That leads to rejects-valids when putting such types inside unions. llvm-svn: 169662
OpenPOWER on IntegriCloud