summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-142-3/+59
| | | | | | | | | | attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't enter cleanups for unreachable variables. It's impossible toJohn McCall2012-04-131-0/+10
| | | | | | | | jump into these scopes, and the cleanup-entering code sometimes wants to do some operations first (e.g. a GEP), which can leave us with unparented IR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154684 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator: Fixes translation ofFariborz Jahanian2012-04-132-0/+47
| | | | | | | | __typeof which is a regression by reverting r154360. // rdar://11233924 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154679 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator: When translatingFariborz Jahanian2012-04-131-0/+23
| | | | | | | | | call to 'super' use __rw_objc_super as type of the 'super' meta-data instead of objc_super. // rdar://11239894 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154670 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -cc1-level option "-pubnames-dump". Such things should stayDouglas Gregor2012-04-131-19/+0
| | | | | | | out of the tree and use the tooling infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154668 91177308-0d34-0410-b5e6-96231b3b80d8
* super and class property reference expressions don't need to beDouglas Gregor2012-04-131-0/+15
| | | | | | | | rebuilt. Fixes <rdar://problem/11052352>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154667 91177308-0d34-0410-b5e6-96231b3b80d8
* First set of tests for ARM homogenous aggregates. C only. C++ will follow.Anton Korobeynikov2012-04-131-0/+158
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154666 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set ofRichard Smith2012-04-131-0/+15
| | | | | | | GNU __atomic builtins. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154659 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12500: Improve the wording of the diagnostic for a redefinition of a nameRichard Smith2012-04-134-8/+8
| | | | | | | in the wrong namespace scope. Patch by Jonathan Sauer! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154656 91177308-0d34-0410-b5e6-96231b3b80d8
* Support -Wc++98-compat-pedantic as requested:Seth Cantrell2012-04-131-0/+4
| | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120409/056126.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154655 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a trivial oversight with apple-kext static local destructorsJohn McCall2012-04-131-0/+22
| | | | | | and add a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154653 91177308-0d34-0410-b5e6-96231b3b80d8
* When we're flagging a protected scope to prevent jumps into theJohn McCall2012-04-132-0/+23
| | | | | | | | shadow of a block expression with non-trivial destructed cleanups, we should flag that in the enclosing function, not in the block that we're about to pop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154646 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11 no longer requires files to end with a newlineSeth Cantrell2012-04-132-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154643 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the missing pieces needed to support libstdc++4.7's <atomic>:Richard Smith2012-04-132-13/+127
| | | | | | | | | | | | | | | | | | | | | | | | | __atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_* predefined macros. Implement library fallback for __atomic_is_lock_free and __c11_atomic_is_lock_free, and implement __atomic_always_lock_free. Contrary to their documentation, GCC's __atomic_fetch_add family don't multiply the operand by sizeof(T) when operating on a pointer type. libstdc++ relies on this quirk. Remove this handling for all but the __c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins. Contrary to their documentation, __atomic_test_and_set and __atomic_clear take a first argument of type 'volatile void *', not 'void *' or 'bool *', and __atomic_is_lock_free and __atomic_always_lock_free have an argument of type 'const volatile void *', not 'void *'. With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite, except for a couple of libstdc++ bugs and some cases where libc++'s test suite tests for properties which implementations have latitude to vary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
* Warn on 64-to-32 for source value of x bits where 64 >= x > 32.David Blaikie2012-04-121-0/+4
| | | | | | | | | The codepath already only works for source bits > target bits, it's just that it was testing for the source expr bits to be exactly 64. This meant simple cases (int i = x_long / 2) were missed & ended up under the general -Wconversion warning, which a user might not have enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154626 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] PCH deserialization optimization.Anna Zaks2012-04-122-0/+37
| | | | | | | | | | | | | | | | We should not deserialize unused declarations from the PCH file. Achieve this by storing the top level declarations during parsing (HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call graph only for those. Tested the patch on a sample ObjC file that uses PCH. With the patch, the analyzes is 17.5% faster and clang consumes 40% less memory. Got about 10% overall build/analyzes time decrease on a large Objective C project. A bit of CallGraph refactoring/cleanup as well.. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154625 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Test case for r154451 (redefining system functions).Anna Zaks2012-04-121-0/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154624 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c literals: Issue warning and ignoreFariborz Jahanian2012-04-121-0/+7
| | | | | | | | when BOOL is not of an intergal type when boolean literals are used. // rdar://11231426 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154619 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some i1/i8 confusion within _Atomic(bool) in IR generation, bothDouglas Gregor2012-04-121-1/+24
| | | | | | | | | | | | | | | | in general (such an atomic has boolean representation) and specifically for IR generation of __c11_atomic_init. The latter also means actually using initialization semantics for this initialization, rather than just creating a store. On a related note, make sure we actually put in non-atomic-to-atomic conversions when performing an implicit conversion sequence. IR generation is far too kind here, but we still want the ASTs to make sense. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154612 91177308-0d34-0410-b5e6-96231b3b80d8
* Include lambda capture init expressions in CFG.Ted Kremenek2012-04-121-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154611 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -Wuninitialized test for C++11 lambdas.Ted Kremenek2012-04-121-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154608 91177308-0d34-0410-b5e6-96231b3b80d8
* Compute standard conversion sequences for conversions to atomicDouglas Gregor2012-04-121-0/+23
| | | | | | | | | | | | | types. The second and third conversions in the sequence are based on the conversion for the underlying type, so that we get sensible overloading behavior for, e.g., _Atomic(int) vs. _Atomic(float). As part of this, actually implement the lvalue-to-rvalue conversion for atomic types. There is probably a pile of code in SemaExpr that can now be deleted, but I haven't tracked it down yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154596 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c numeric literal: type of boolean isFariborz Jahanian2012-04-122-1/+41
| | | | | | | | that of typedef BOOL if found. // rdar://11231426 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154595 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator. ifdef'out Fariborz Jahanian2012-04-121-1/+6
| | | | | | | | | __weak and __block when rewriting. // rdar://11236342 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154592 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a flag to the parser to skip method bodies.Erik Verbruggen2012-04-121-0/+45
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154584 91177308-0d34-0410-b5e6-96231b3b80d8
* There's some code in the PCH reader that looks like it's needlessly complex, butNick Lewycky2012-04-124-0/+21
| | | | | | | | turns out that it's actually needed for C++ modules support. Since simplifying it didn't cause any test failures, I'll add a test for it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154582 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for 18 of the GNU-compatible __atomic builtins.Richard Smith2012-04-124-32/+202
| | | | | | | | | | | | | This is not quite sufficient for libstdc++'s <atomic>: we still need __atomic_test_and_set and __atomic_clear, and may need a more complete __atomic_is_lock_free implementation. We are also missing an implementation of __atomic_always_lock_free, __atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed for libstdc++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154579 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for previous commit.Eric Christopher2012-04-121-0/+10
| | | | | | rdar://11079003 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154571 91177308-0d34-0410-b5e6-96231b3b80d8
* The copy and destroy helper functions aren't prototyped, don't call themEric Christopher2012-04-121-1/+1
| | | | | | so. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154569 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement clang_getDiagnosticCategoryText() to provide a way for a client of ↵Ted Kremenek2012-04-121-1/+1
| | | | | | | | | libclang to accurately get the diagnostic category name from a serialized diagnostic when the version of libclang used to read the diagnostic file is newer than the clang that emitted the diagnostic file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154567 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator. Fixes a mis-translation whenFariborz Jahanian2012-04-111-0/+18
| | | | | | | of a __block struct object. // rdar://11230308 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154566 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test for a construct we currently reject, constant-evaluating a load ↵Eli Friedman2012-04-111-0/+4
| | | | | | from a constant string. Given that gcc doesn't accept this, we should continue to not accept it, even though it was accidentally supported by clang for a brief period. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154564 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Another dynamic_cast false positive/negative.Anna Zaks2012-04-111-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154543 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Better test cases for explaining where tracking types ofAnna Zaks2012-04-111-5/+35
| | | | | | | | symbolic regions would help. Thanks to Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154541 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator. Fixes a translation bug when Fariborz Jahanian2012-04-111-0/+28
| | | | | | | | first ivar in the list is a bitfield. // rdar://11229770 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154534 91177308-0d34-0410-b5e6-96231b3b80d8
* Part of PR10101: after a parse error in a declaration, try harder to find theRichard Smith2012-04-112-2/+44
| | | | | | | | right place to pick up parsing. In C++, this had a tendency to skip everything declared within headers if the TU starts with garbage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154530 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce a couple of functions to make it convenientArgyrios Kyrtzidis2012-04-112-3/+3
| | | | | | | | | | | to get at the parameters (and their types) of a function or objc method cursor. int clang_Cursor_getNumArguments(CXCursor C); CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i); rdar://11201527 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154523 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] In cxloc::translateSourceRange make sure to handle locations in ↵Argyrios Kyrtzidis2012-04-111-1/+10
| | | | | | | | | | macro arguments correctly. clang diagnostics can provide fixits inside a macro argument now. rdar://11014346 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154517 91177308-0d34-0410-b5e6-96231b3b80d8
* Update recently-added test to use new __c11_ form of atomic builtins.Richard Smith2012-04-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154514 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide, and document, a set of __c11_atomic_* intrinsics to implement C11'sRichard Smith2012-04-114-46/+47
| | | | | | | | | | <stdatomic.h> header. In passing, fix LanguageExtensions to note that C11 and C++11 are no longer "upcoming standards" but are now actually standardized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154513 91177308-0d34-0410-b5e6-96231b3b80d8
* Make __atomic_init() (soon to be __c11_atomic_init()) work with non-scalar ↵David Chisnall2012-04-111-0/+13
| | | | | | types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154507 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow c++ initialisers to initialise _Atomic fields.David Chisnall2012-04-111-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154499 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a triple to this test.Eric Christopher2012-04-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154485 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix the windows buildbots by making this test a little lessEric Christopher2012-04-111-1/+1
| | | | | | dependent upon metadata ordering. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154482 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable debug info for objective c implementations that may not haveEric Christopher2012-04-114-4/+20
| | | | | | | | an explicit instance variable. rdar://10590352 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154481 91177308-0d34-0410-b5e6-96231b3b80d8
* Support C++11 attributes at the start of a parameter-declaration.Richard Smith2012-04-112-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154476 91177308-0d34-0410-b5e6-96231b3b80d8
* AtomicExpr: make ASTStmtReader a friend and remove setters. Also fix savingRichard Smith2012-04-101-0/+9
| | | | | | | | of an uninitialized Stmt* in serialization of __atomic_init and add a test of atomics serialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154448 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix quoting to allow shell expansion to occur for shell variablesKaelyn Uhrain2012-04-101-1/+1
| | | | | | introduced by the test harness' expansion of %t. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154443 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translation: writing containerFariborz Jahanian2012-04-101-0/+48
| | | | | | | | subscripting. // rdar://11203853 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154441 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] dynamic_cast: Better model cast from a reference.Anna Zaks2012-04-101-2/+10
| | | | | | | Generate a sink when the dynamic_cast from a reference fails to represent a thrown exception. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154438 91177308-0d34-0410-b5e6-96231b3b80d8