summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Allow vector types in pseudo-destructor expressions. Fixes PR13798.Douglas Gregor2012-09-101-0/+11
| | | | llvm-svn: 163514
* Revert "Revert Ted's r163489 and r163490, due to breakage."Ted Kremenek2012-09-101-2777/+2776
| | | | | | | | | I need to see how this breaks on other platforms when I fix the issue that Benjamin Kramer pointed out. This includes r163489 and r163490, plus a two line change. llvm-svn: 163512
* Wrong crtbegin/crtend pair used for PIE on Android.Evgeniy Stepanov2012-09-101-0/+17
| | | | | | | | Android uses the same flavour of crt*.o for PIE and non-PIE executables, and a different one for DSOs. GNU/Linux, on the other hand, uses one set of crt*.o for non-PIE executables, and another for both PIE executables and DSOs. llvm-svn: 163500
* Revert Ted's r163489 and r163490, due to breakage.NAKAMURA Takumi2012-09-101-2776/+2777
| | | | | | | r163489, "Take another crack at stabilizing the emission order of analyzer" r163490, "Use isBeforeInTranslationUnitThan() instead of operator<." llvm-svn: 163497
* MIPS: Use -march=arch option to select either generic MIPS ISA,Simon Atanasyan2012-09-102-0/+10
| | | | | | | | or the name of a particular processor. The patch reviewed by Douglas Gregor. llvm-svn: 163492
* Take another crack at stabilizing the emission order of analyzerTed Kremenek2012-09-101-2777/+2776
| | | | | | | | | | | | | | diagnostics without using FoldingSetNodeIDs. This is done by doing a complete recursive comparison of the PathDiagnostics. Note that the previous method of comparing FoldingSetNodeIDs did not end up relying on unstable things such as pointer addresses, so I suspect this may still have some issues on various buildbots because I'm not sure if the true source of non-determinism has been eliminated. The tests pass for me, so the only way to know is to commit this change and see what happens. llvm-svn: 163489
* Fixed support for disabled wchar_t and added an appropriate test.Abramo Bagnara2012-09-091-1/+8
| | | | llvm-svn: 163476
* clang/test/Sema/format-strings-scanf.c: Relax a couple of expressions with ↵NAKAMURA Takumi2012-09-081-2/+2
| | | | | | | | | expected-warning-re to let matched for Win32 targets. - format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *' - format specifies type 'wchar_t **' (aka 'unsigned short **') but the argument has type 'float *' llvm-svn: 163468
* Add some ARM EABI preprocessor builtins testsAnton Korobeynikov2012-09-081-0/+209
| | | | llvm-svn: 163467
* Try disabling the FileCheck part of the retain-release.m test to see if it ↵Ted Kremenek2012-09-081-2/+4
| | | | | | fixes the buildbots. llvm-svn: 163462
* Fix bug in BugReporter::RemoveUneededCalls() where "prunable"Ted Kremenek2012-09-084-1/+899
| | | | | | | PathDiagnosticEventPieces were *always* pruned. Instead, they are suppose to only be pruned if the entire call gets pruned. llvm-svn: 163460
* When a bad UTF-8 encoding or bogus escape sequence is encountered in aRichard Smith2012-09-082-2/+27
| | | | | | | string literal, produce a diagnostic pointing at the erroneous character range, not at the start of the literal. llvm-svn: 163459
* This test does not require --exact-match from FileCheck.Ted Kremenek2012-09-081-1/+1
| | | | llvm-svn: 163456
* Attempt (again) to stabilize the order of the emission of diagnosticsTed Kremenek2012-09-089-12564/+35601
| | | | | | | of the analyzer by using the FullProfile() of a PathDiagnostic for ordering them. llvm-svn: 163455
* Format strings: suggest %lld instead of %qd and %Ld with -Wformat-non-iso.Jordan Rose2012-09-082-7/+8
| | | | | | | As a corollary to the previous commit, even when an extension is available, we can still offer a fixit to the standard modifier. llvm-svn: 163453
* Format strings: %Ld isn't available on Darwin or Windows.Jordan Rose2012-09-084-23/+57
| | | | | | | | | This seems to be a GNU libc extension; we offer a fixit to %lld on these platforms. <rdar://problem/11518237> llvm-svn: 163452
* -fcatch-undefined-behavior: Factor emission of the creation of, and branch to,Richard Smith2012-09-081-3/+6
| | | | | | | | | the trap BB out of the individual checks and into a common function, to prepare for making this code call into a runtime library. Rename the existing EmitCheck to EmitTypeCheck to clarify it and to move it out of the way of the new EmitCheck. llvm-svn: 163451
* [analyzer] ObjCSelfInitChecker should always clean up in postCall checks.Jordan Rose2012-09-081-62/+0
| | | | | | | | | | | | | | | | | | | | ObjCSelfInitChecker stashes information in the GDM to persist it across function calls; it is stored in pre-call checks and retrieved post-call. The post-call check is supposed to clear out the stored state, but was failing to do so in cases where the call did not have a symbolic return value. This was actually causing the inappropriate cache-out from r163361. Per discussion with Anna, we should never actually cache out when assuming the receiver of an Objective-C message is non-nil, because we guarded that node generation by checking that the state has changed. Therefore, the only states that could reach this exact ExplodedNode are ones that should have merged /before/ making this assumption. r163361 has been reverted and the test case removed, since it won't actually test anything interesting now. llvm-svn: 163449
* Revert "Add plist output for retain-release.m in addition to -verify checking."Ted Kremenek2012-09-081-21887/+2
| | | | llvm-svn: 163447
* Revert "Attempt to make the PathDiagnostic emission order more deterministic by"Ted Kremenek2012-09-081-57/+57
| | | | llvm-svn: 163446
* [analyzer] Remove constraints on dead symbols as part of removeDeadBindings.Jordan Rose2012-09-081-0/+21
| | | | | | | | | | | | | Previously, we'd just keep constraints around forever, which means we'd never be able to merge paths that differed only in constraints on dead symbols. Because we now allow constraints on symbolic expressions, not just single symbols, this requires changing SymExpr::symbol_iterator to include intermediate symbol nodes in its traversal, not just the SymbolData leaf nodes. llvm-svn: 163444
* [analyzer] Cast the result of a placement new-expression to the correct type.Jordan Rose2012-09-081-0/+26
| | | | | | | | | | | This is necessary because further analysis will assume that the SVal's type matches the AST type. This caused a crash when trying to perform a derived-to-base cast on a C++ object that had been new'd to be another object type. Yet another crash in PR13763. llvm-svn: 163442
* [analyzer] Address John's code review for r163407.Anna Zaks2012-09-081-1/+3
| | | | | | | Teach malloc sizeof checker to find type inconsistencies in multi- dimensional arrays. llvm-svn: 163438
* objective-C: introduce __attribute((objc_requires_super)) on methodFariborz Jahanian2012-09-073-3/+34
| | | | | | | | in classes. Use it to flag those method implementations which don't contain call to 'super' if they have 'super' class and it has the method with this attribute set. This is wip. // rdar://6386358 llvm-svn: 163434
* In ARC, if we're emitting assembly markers for calls toJohn McCall2012-09-071-0/+17
| | | | | | | | | objc_retainAutoreleasedReturnValue, we need to also be killing them during return peepholing. Make sure we recognize an intervening bitcast, but more importantly, assert if we can't find the asm marker at all. rdar://problem/12133032 llvm-svn: 163431
* Attempt to make the PathDiagnostic emission order more deterministic byTed Kremenek2012-09-071-57/+57
| | | | | | looking at PathPieces. llvm-svn: 163427
* Add plist output for retain-release.m in addition to -verify checking.Ted Kremenek2012-09-071-2/+21887
| | | | llvm-svn: 163418
* [analyzer] Fix a false positive in sizeof malloc checker.Anna Zaks2012-09-071-0/+14
| | | | | | | Don't warn when the sizeof argument is an array with the same element type as the pointee of the return type. llvm-svn: 163407
* Add test case for <rdar://problem/12075238>, which recently got fixed by ↵Ted Kremenek2012-09-071-0/+18
| | | | | | changes to RegionStore. llvm-svn: 163406
* Whitespace.Chad Rosier2012-09-071-4/+0
| | | | llvm-svn: 163404
* Thread-safety analysis: Add support for selectively turning off warningsDeLesley Hutchins2012-09-071-4/+84
| | | | | | within part of a particular method. llvm-svn: 163397
* Attempt to pacify Windows buildbots.Roman Divacky2012-09-071-1/+1
| | | | llvm-svn: 163389
* Link to crtend.S when PIE in the FreeBSD driver. Patch by Brooks Davis!Roman Divacky2012-09-071-0/+14
| | | | llvm-svn: 163388
* Revert "Rework the retain-release.m test to use FileCheck and the "text" output"Ted Kremenek2012-09-071-1348/+180
| | | | | | Apparently the output of this test is not deterministic. Needs investigation. llvm-svn: 163377
* Fix off-by-one bug in diagnostic prose of ObjCContainersASTChecker.Ted Kremenek2012-09-071-7/+7
| | | | | | | | | While the check itself should count 0-based for the parameter index, the diagnostic should be 1-based (first, second, third, not start at 0). Fixes <rdar://problem/12249569>. llvm-svn: 163375
* Rework the retain-release.m test to use FileCheck and the "text" outputTed Kremenek2012-09-071-180/+1348
| | | | | | | | | | of the analyzer, as the RetainReleaseChecker has many fine-grain path diagnostic events that were not being checked. This uncovered an inconsistency between the path diagnostics between Objective-C and Objective-C++ code in ConditionBRVisitor that was fixed in a recent patch. llvm-svn: 163373
* Fix bug in ConditionBRVisitor where for C++ (and not C) we were not ignoringTed Kremenek2012-09-072-2/+3
| | | | | | | | | | | | | | | | implicit pointer-to-boolean conversions in condition expressions. This would result in inconsistent diagnostic emission between C and C++. A consequence of this is now ConditionBRVisitor and TrackConstraintBRVisitor may emit redundant diagnostics, for example: "Assuming pointer value is null" (TrackConstraintBRVisitor) "Assuming 'p' is null" (ConditionBRVisitor) We need to reconcile the two, and perhaps prefer one over the other in some cases. llvm-svn: 163372
* PR9023: A template template parameter whose template parameter list contains anRichard Smith2012-09-073-0/+161
| | | | | | | | | | | | | unexpanded parameter pack is a pack expansion. Thus, as with a non-type template parameter which is a pack expansion, it needs to be expanded early into a fixed list of template parameters. Since the expanded list of template parameters is not itself a parameter pack, it is permitted to appear before the end of the template parameter list, so also remove that restriction (for both template template parameter pack expansions and non-type template parameter pack expansions). llvm-svn: 163369
* [analyzer] Fail gracefully when the dynamic type is outside the hierarchy.Jordan Rose2012-09-071-0/+32
| | | | | | | | | | | | | | | | | | | With some particularly evil casts, we can get an object whose dynamic type is not actually a subclass of its static type. In this case, we won't even find the statically-resolved method as a devirtualization candidate. Rather than assert that this situation cannot occur, we now simply check that the dynamic type is not an ancestor or descendent of the static type, and leave it at that. This error actually occurred analyzing LLVM: CallEventManager uses a BumpPtrAllocator to allocate a concrete subclass of CallEvent (FunctionCall), but then casts it to the actual subclass requested (such as ObjCMethodCall) to perform the constructor. Yet another crash in PR13763. llvm-svn: 163367
* Teach RetainCountChecker that CFPlugInInstanceCreate does notTed Kremenek2012-09-061-0/+12
| | | | | | | | return a CF object at all. Fixes <rdar://problem/9566345> llvm-svn: 163362
* [analyzer] Don't crash if we cache out while evaluating an ObjC message.Jordan Rose2012-09-061-0/+62
| | | | | | | | | | | | | | | | A bizarre series of coincidences led us to generate a previously-seen node in the middle of processing an Objective-C message, where we assume the receiver is non-nil. We were assuming that such an assumption would never "cache out" like this, and blithely went on using a null ExplodedNode as the predecessor for the next step in evaluation. Although the test case committed here is complicated, this could in theory happen in other ways as well, so the correct fix is just to test if the non-nil assumption results in an ExplodedNode we've seen before. <rdar://problem/12243648> llvm-svn: 163361
* Refine diagnostics for leaks reported when returning an objectTed Kremenek2012-09-061-0/+9
| | | | | | | | via function/method with [CF,NS]_RETURNS_NOT_RETAINED. Fixes <rdar://problem/11379000>. llvm-svn: 163355
* Tweak DeadStoresChecker to not warn about dead stores to variables thatTed Kremenek2012-09-061-0/+17
| | | | | | | | | are used in EH code. Right now the CFG doesn't support exceptions well, so we need this hack to avoid bogus dead store warnings. Fixes <rdar://problem/12147586> llvm-svn: 163353
* Clarified diagnostics for range-based for loops with invalid rangesSam Panzer2012-09-061-3/+16
| | | | llvm-svn: 163350
* [analyzer] Don't attempt to devirtualize calls to base class destructors.Jordan Rose2012-09-061-0/+30
| | | | | | | | | | | | | | | | | | | CXXDestructorCall now has a flag for when it is a base destructor call. Other kinds of destructor calls (locals, fields, temporaries, and 'delete') all behave as "whole-object" destructors and do not behave differently from one another (specifically, in these cases we /should/ try to devirtualize a call to a virtual destructor). This was causing crashes in both our internal buildbot, the crash still being tracked in PR13765, and some of the crashes being tracked in PR13763, due to a assertion failure. (The behavior under -Asserts happened to be correct anyway.) Adding this knowledge also allows our DynamicTypePropagation checker to do a bit less work; the special rules about virtual method calls during a destructor only require extra handling during base destructors. llvm-svn: 163348
* [ms-inline asm] Output empty asm statements for the directives we don'tChad Rosier2012-09-061-0/+9
| | | | | | | handle. Otherwise, the AsmParser will explode if we try to generate an object files. llvm-svn: 163345
* [ms-inline asm] The IR representation of inline assembly enumerates the inputChad Rosier2012-09-061-1/+1
| | | | | | | and output expressions much like that in GNU-style inline assembly. Output expressions are first. Do this for MS-style inline asms. llvm-svn: 163342
* refactoring + objective-C specific test for my last patch.Fariborz Jahanian2012-09-061-1/+15
| | | | | | // rdar://12233989 llvm-svn: 163338
* Don't try to check override control for invalid member functions. Fixes a ↵Richard Smith2012-09-061-0/+5
| | | | | | crash in a corner case. Patch by Olivier Goffart! llvm-svn: 163337
* Use custom ABIInfo for le32/PNaCl argument codegenDerek Schuff2012-09-062-0/+102
| | | | | | | | | This patch uses a new ABIInfo implementation specific to the le32 target, rather than falling back to DefaultABIInfo. Its behavior is basically the same, but it also allows the regparm argument attribute. It also includes basic tests for argument codegen and attributes. llvm-svn: 163333
OpenPOWER on IntegriCloud