summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* in 'new int[4]', constant fold the 4*4=16 instead of Chris Lattner2010-07-201-0/+1
| | | | | | doing an overflow check. llvm-svn: 108943
* don't demand names to be on IR.Chris Lattner2010-07-201-3/+2
| | | | llvm-svn: 108937
* temporarily disable this to fix the build bot.Chris Lattner2010-07-201-1/+0
| | | | llvm-svn: 108936
* Follow the implementation approach suggested by PR6687,Chris Lattner2010-07-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | which generates more efficient and more obviously conformant code. We now test for overflow of the multiply then force the result to -1 if so. On X86, this generates nice code like this: __Z4testl: ## @_Z4testl ## BB#0: ## %entry subl $12, %esp movl $4, %eax mull 16(%esp) testl %edx, %edx movl $-1, %ecx cmovel %eax, %ecx movl %ecx, (%esp) call __Znam addl $12, %esp ret llvm-svn: 108927
* Print template argument names for template class.Devang Patel2010-07-201-0/+9
| | | | llvm-svn: 108916
* implement rdar://5739832 - operator new should check for overflow in multiply,Chris Lattner2010-07-201-2/+16
| | | | | | | | | | | | | | | | | | | | causing clang to compile this code into something that correctly throws a length error, fixing a potential integer overflow security attack: void *test(long N) { return new int[N]; } int main() { test(1L << 62); } We do this even when exceptions are disabled, because it is better for the code to abort than for the attack to succeed. This is heavily based on a patch that Fariborz wrote. llvm-svn: 108915
* Introduce a new lexer function to compute the "preamble" of a file,Douglas Gregor2010-07-202-0/+36
| | | | | | | | | which is the part of the file that contains all of the initial comments, includes, and preprocessor directives that occur before any of the actual code. Added a new -print-preamble cc1 action that is only used for testing. llvm-svn: 108913
* Hookup checking for invalid length modifiers in scanf format strings.Ted Kremenek2010-07-201-0/+8
| | | | llvm-svn: 108907
* Re-apply fixed version of 108749, correctly conditionalizing the new sections onJim Grosbach2010-07-202-5/+5
| | | | | | ObjC ABI version 2 this time. llvm-svn: 108847
* Complain when string literals are too long for the active languageDouglas Gregor2010-07-201-0/+16
| | | | | | standard's minimum requirements. llvm-svn: 108837
* Hide the specializations folding sets of ClassTemplateDecl as an ↵Argyrios Kyrtzidis2010-07-201-0/+5
| | | | | | | | | | | | | implementation detail (InsertPos leaks though) and add methods to its interface for adding/finding specializations. Simplifies its users a bit and we no longer need to replace specializations in the folding set with their redeclarations. We just return the most recent redeclarations. As a bonus, it fixes http://llvm.org/PR7670. llvm-svn: 108832
* Fix test for Win32.Daniel Dunbar2010-07-201-2/+2
| | | | llvm-svn: 108806
* and revert the related tests, tooJim Grosbach2010-07-193-8/+8
| | | | llvm-svn: 108766
* Patch to type match comparing Objective-C Classes which implement Fariborz Jahanian2010-07-191-0/+30
| | | | | | protocols (Radar 8191774). llvm-svn: 108758
* Don't warn when a '%%' or '%*d' (scanf) is used in a format string with ↵Ted Kremenek2010-07-192-0/+9
| | | | | | | | positional arguments, since these don't actually consume an argument. llvm-svn: 108757
* Introduce a new libclang API, clang_reparseTranslationUnit(), whichDouglas Gregor2010-07-191-0/+3
| | | | | | | | reparses an already-parsed translation unit. At the moment it's just a convenience function, but we hope to use it for performance optimizations. llvm-svn: 108756
* Update tests for r108749Jim Grosbach2010-07-193-8/+8
| | | | llvm-svn: 108754
* Hook up 'invalid conversion' warning for scanf format strings.Ted Kremenek2010-07-191-0/+1
| | | | llvm-svn: 108750
* Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes ↵Ted Kremenek2010-07-191-0/+3
| | | | | | <rdar://problem/8204052>. llvm-svn: 108742
* Driver: Make -fnext-runtime the default when rewriting Objective-C.Daniel Dunbar2010-07-191-1/+5
| | | | llvm-svn: 108741
* IRgen: Add a test case I forgot to commit at some point.Daniel Dunbar2010-07-191-0/+38
| | | | llvm-svn: 108713
* Driver/Darwin: Add deployment target after doing argument translation, so thatDaniel Dunbar2010-07-193-3/+11
| | | | | | -mmacosx-version-min works inside a -Xarch_ flag. llvm-svn: 108712
* Categories cannot synthesize property ivars,Fariborz Jahanian2010-07-191-0/+5
| | | | | | and a minor cleanup. llvm-svn: 108707
* Implement support for reading arguments specified in a file with @file. IfRafael Espindola2010-07-192-0/+41
| | | | | | there is no file named "file", keep the @file option unchanged. llvm-svn: 108697
* Adjust test for float printing differences. Windows uses three digits for ↵Benjamin Kramer2010-07-191-6/+6
| | | | | | the exponent, everyone else two. llvm-svn: 108693
* Fix http://llvm.org/PR7660Argyrios Kyrtzidis2010-07-191-0/+3
| | | | | | | A ParmVarDecl instantiated from a FunctionProtoType may have Record as DeclContext, in which case isStaticDataMember() will erroneously return true. llvm-svn: 108692
* Revert r108672, "Implement support for reading arguments specified in a fileDaniel Dunbar2010-07-192-41/+0
| | | | | | | with @file.", it doesn't correctly handle cases where arguments starting with '@' are passed to other command line arguments. llvm-svn: 108686
* Implement support for reading arguments specified in a file with @file.Rafael Espindola2010-07-192-0/+41
| | | | llvm-svn: 108672
* fix test case.Zhongxing Xu2010-07-191-1/+1
| | | | llvm-svn: 108671
* Add double close check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-191-0/+7
| | | | llvm-svn: 108669
* Fix a goof in my previous patch -- not all of the builtins return a value, someChandler Carruth2010-07-181-3/+8
| | | | | | fixed return types. llvm-svn: 108657
* Fix mangling for static member variables of classes inside an extern "C"Eli Friedman2010-07-181-0/+11
| | | | | | | linkage specification. Not sure if this is the ideal fix, but I'm reasonably sure it's correct vs. gcc. llvm-svn: 108656
* daniel doesn't hate me, he hates macpython 2.5, whichChris Lattner2010-07-181-4/+0
| | | | | | is a very reasonable position on life! llvm-svn: 108651
* Improve the representation of the atomic builtins in a few ways. First, we makeChandler Carruth2010-07-182-1/+10
| | | | | | | | | | | | | | | their call expressions synthetically have the "deduced" types based on their first argument. We only insert conversions in the AST for arguments whose values require conversion to match the value type expected. This keeps PR7600 closed by maintaining the return type, but avoids assertions due to unexpected implicit casts making the type unsigned (test case added from Daniel). The magic is moved into the codegen for the atomic builtin which inserts the casts as needed at the IR level to raise the type to an integer suitable for the LLVM intrinsic. This shouldn't cause any real change in functionality, but now we can make the builtin be more truly polymorphic. llvm-svn: 108638
* Fix crash initializing a bit-field with a non-constant in a place where weEli Friedman2010-07-171-0/+5
| | | | | | try to evaluate the initializer as a constant. llvm-svn: 108632
* Check for casts to an incomplete type in C. Improves diagnostics for cast toEli Friedman2010-07-171-0/+14
| | | | | | | incomplete union (PR5692) and incomplete enum, and fixes obscure accepts-invalid on cast to incomplete struct. llvm-svn: 108630
* Add another terrible VC++ compatibility hack: allow users toChris Lattner2010-07-171-0/+8
| | | | | | | allow invalid token pastes (when in -fms-extensions mode) with -Wno-invalid-token-paste llvm-svn: 108624
* rename testChris Lattner2010-07-171-0/+0
| | | | llvm-svn: 108623
* rename testChris Lattner2010-07-171-0/+0
| | | | llvm-svn: 108622
* Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by ↵Ted Kremenek2010-07-171-0/+6
| | | | | | removing a bogus assertion. llvm-svn: 108602
* Another test case for on demand synthesis of ivars.Fariborz Jahanian2010-07-171-0/+88
| | | | llvm-svn: 108600
* Patch to synthesize property ivars on demand asFariborz Jahanian2010-07-171-0/+40
| | | | | | | part of the new property synthesis by default. wip. llvm-svn: 108599
* The GNU-runtime ObjC personality function doesn't let us rethrow with URR forJohn McCall2010-07-171-0/+25
| | | | | | multiple reasons. Rethrow with _objc_exception_throw instead. Fixes PR7656. llvm-svn: 108595
* Fix APFloat assertion failure in IdempotentOperationChecker resulting in havingTed Kremenek2010-07-171-0/+6
| | | | | | an APFloat with different "float semantics" than the compared float literal. llvm-svn: 108590
* When checking whether to bind an expression to a temporary, don't bind Obj-C ↵Anders Carlsson2010-07-161-0/+1
| | | | | | message send expressions who call methods that return references. llvm-svn: 108559
* Remove unicode quotes characters that somehow made it into a recent commit ↵Ted Kremenek2010-07-161-1/+1
| | | | | | of mine. llvm-svn: 108552
* Improved false positive rate for the idempotent operations checker and moved ↵Tom Care2010-07-167-15/+15
| | | | | | | | | | it into the default path-sensitive analysis options. - Added checks for static local variables, self assigned parameters, and truncating/extending self assignments - Removed command line option (now default with --analyze) - Updated test cases to pass with idempotent operation warnings llvm-svn: 108550
* Hook up warning for an incomplete scanlist in scanf format strings.Ted Kremenek2010-07-161-0/+1
| | | | llvm-svn: 108542
* Tweak zero-field width in scanf format string diagnostic.Ted Kremenek2010-07-161-2/+2
| | | | llvm-svn: 108541
* When performing template name lookup for a dependent member accessDouglas Gregor2010-07-161-0/+19
| | | | | | | | | expression such as the "foo" in "this->blah.foo<1, 2>", and we can't look into the type of "this->blah" (e.g., because it is dependent), look into the local scope of a template of the same name. Fixes <rdar://problem/8198511>. llvm-svn: 108531
OpenPOWER on IntegriCloud