summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [ms-inline-asm] Test cases to ensure the AsmRewrite list is sorted (r175021).Chad Rosier2013-02-131-0/+12
| | | | | | Part of rdar://13202662 llvm-svn: 175022
* Order the methods in the global method pool based on when they become ↵Douglas Gregor2013-02-123-6/+22
| | | | | | visible, not when they become deserialized <rdar://problem/13203033>. llvm-svn: 175018
* [ms-inline-asm] Add test cases for the align/emit directives.Chad Rosier2013-02-121-0/+16
| | | | | | Part of rdar://13200215 llvm-svn: 175009
* Add a test for r174980, that we used to acceptDmitri Gribenko2013-02-121-2/+10
| | | | llvm-svn: 175005
* [ms-inline asm] Update test case now that we are correctly parsing __emit ↵Chad Rosier2013-02-121-2/+2
| | | | | | directives. llvm-svn: 175000
* Typo.Chad Rosier2013-02-121-1/+1
| | | | llvm-svn: 174995
* [ms-inline asm] Add a few test cases for the parsing of hexidecimal integers.Chad Rosier2013-02-121-0/+34
| | | | llvm-svn: 174989
* Accept over-qualified constructor in MSVC emulation modeDmitri Gribenko2013-02-122-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC accepts this: class A { A::A(); }; Clang accepts regular member functions with extra qualification as an MS extension, but not constructors. This changes the parser to defer rejecting qualified constructors so that the same Sema logic can apply to constructors as regular member functions. This also improves the error message when MS extensions are disabled (in my opinion). Before it was: /Users/jason/Desktop/test.cpp:2:8: error: expected member name or ';' after declaration specifiers A::A(); ~~~~ ^ 1 error generated. After: /Users/jason/Desktop/test.cpp:2:6: error: extra qualification on member 'A' A::A(); ~~~^ 1 error generated. Patch by Jason Haslam. llvm-svn: 174980
* Rename -constructors test to just -structors as in fact it tests dtors too. ↵Timur Iskhodzhanov2013-02-121-1/+1
| | | | | | Also, fix a minor typo in the test. llvm-svn: 174966
* Attempt to fix this test on i686 targets.Nick Lewycky2013-02-121-1/+1
| | | | llvm-svn: 174953
* The meat of this patch is in BuildCXXMemberCalLExpr where we make it useNick Lewycky2013-02-123-1/+53
| | | | | | | | | | | | MarkMemberReferenced instead of marking functions referenced directly. An audit of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few other changes: * don't mark functions odr-used when considering them for an initialization sequence. Do mark them referenced though. * the function nominated by the cleanup attribute should be diagnosed. * operator new/delete should be diagnosed when building a 'new' expression. llvm-svn: 174951
* Properly assemble PHIs after a null-checked invoke of objc_msgSend.John McCall2013-02-122-18/+68
| | | | | | rdar://12046763 llvm-svn: 174946
* Fix a bug reduced from a crash when trying to use modules with libc++. We checkRichard Smith2013-02-123-0/+23
| | | | | | | | the linkage of functions and variables while merging declarations from modules, and we don't necessarily have enough of the rest of the AST loaded at that point to allow us to compute linkage, so serialize it instead. llvm-svn: 174943
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-124-8/+17
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* Remove an assert which triggers when a decl context in a module hits the 'hasRichard Smith2013-02-123-0/+21
| | | | | | | | | lexical storage but not visible storage' case in C++. It's unclear whether we even need the special-case handling for C++, since it seems to be working around our not serializing a lookup table for the TU in C. But in any case, the assertion is incorrect. llvm-svn: 174931
* Perform placeholder conversions on the controller of a _GenericJohn McCall2013-02-121-0/+17
| | | | | | expression. llvm-svn: 174930
* Diagnose loads of 'half' l-values in OpenCL.John McCall2013-02-121-15/+13
| | | | | | Patch by Joey Gouly! llvm-svn: 174928
* Backing out r174919 while I investigate a self-host bug on Takumi's builder.Lang Hames2013-02-123-3/+10
| | | | llvm-svn: 174925
* In ARC, emit non-peepholed +1s within the full-expression insteadJohn McCall2013-02-121-0/+39
| | | | | | of immediately afterwards. llvm-svn: 174922
* Split a couple of tests out into their own file.John McCall2013-02-122-93/+95
| | | | llvm-svn: 174921
* When generating IR for default copy-constructors, copy-assignment operators,Lang Hames2013-02-113-10/+3
| | | | | | | | | | | | | | | | | | | | move-constructors and move-assignment operators, use memcpy to copy adjacent POD members. Previously, classes with one or more Non-POD members would fall back on element-wise copies for all members, including POD members. This often generated a lot of IR. Without padding metadata, it wasn't often possible for the LLVM optimizers to turn the element-wise copies into a memcpy. This code hasn't yet received any serious tuning. I didn't see any serious regressions on a self-hosted clang build, or any of the nightly tests, but I think it's important to get this out in the wild to get more testing. Insights, feedback and comments welcome. Many thanks to David Blaikie, Richard Smith, and especially John McCall for their help and feedback on this work. llvm-svn: 174919
* objective-C modern translator: Fixes a mistranslationFariborz Jahanian2013-02-111-0/+26
| | | | | | | of @throw statement by finding location of the ';' correctly. // rdar://13186010 llvm-svn: 174898
* [Modules] Cope better with top-level declarations loaded after being ↵Douglas Gregor2013-02-115-0/+29
| | | | | | | | | | | | | | | | | | | | declared in the current translation unit <rdar://problem/13189985>. These two related tweaks to keep the information associated with a given identifier correct when the identifier has been given some top-level information (say, a top-level declaration) and more information is then loaded from a module. The first ensures that an identifier that was "interesting" before being loaded from an AST is considered to be different from its on-disk counterpart. Otherwise, we lose such changes when writing the current translation unit as a module. Second, teach the code that injects AST-loaded names into the identifier chain for name lookup to keep the most recent declaration, so that we don't end up confusing our declaration chains by having a different declaration in there. llvm-svn: 174895
* Update test to not fail with attribute groups.Bill Wendling2013-02-111-2/+2
| | | | llvm-svn: 174866
* Use -mno-implicit-float by default for kernel/kext code. <rdar://13177960>Bob Wilson2013-02-101-0/+6
| | | | | | | | | | | Apple's kernel engineers have been expecting this behavior even though we've never implemented it before, as far as I can tell. In recent months, clang has gotten better at using vector instructions to optimize memcpy-like operations, and that has exposed problems when vector/floating-point instructions are used in kexts that don't support that. This behavior also matches what Apple's GCC did for PowerPC targets. llvm-svn: 174838
* Recognize -mno-implicit-float option for x86 as well as ARM. <rdar://13180731>Bob Wilson2013-02-101-1/+4
| | | | | | | | | For x86 targets, we've been using the -msoft-float option to control passing the no-implicit-float option to cc1. Since the -mno-implicit-float option is now accepted by the driver, this just makes it work for x86 the same as it does for ARM targets. llvm-svn: 174836
* objective-C: Fixes a bogus warning due to not settingFariborz Jahanian2013-02-103-3/+22
| | | | | | | | the "nonatomic" attribute in property redeclaration in class extension. Also, improved on diagnostics in this area while at it. // rdar://13156292 llvm-svn: 174821
* FileCheck'ize testsDmitri Gribenko2013-02-094-9/+16
| | | | llvm-svn: 174815
* FileCheck'ize a testDmitri Gribenko2013-02-091-1/+2
| | | | llvm-svn: 174814
* QoI: -Wreadonly-iboutlet-property should have the warning's location on the ↵Ted Kremenek2013-02-091-8/+6
| | | | | | | | | | property. There's no need to refer to the @implementation at all. Fixes <rdar://problem/13186515> llvm-svn: 174802
* Ensure that type definitions present in just-loaded modules areDouglas Gregor2013-02-093-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | visible. The basic problem here is that a given translation unit can use forward declarations to form pointers to a given type, say, class X; X *x; and then import a module that includes a definition of X: import XDef; We will then fail when attempting to access a member of X, e.g., x->method() because the AST reader did not know to look for a default of a class named X within the new module. This implementation is a bit of a C-centric hack, because the only definitions that can have this property are enums, structs, unions, Objective-C classes, and Objective-C protocols, and all of those are either visible at the top-level or can't be defined later. Hence, we can use the out-of-date-ness of the name and the identifier-update mechanism to force the update. In C++, we will not be so lucky, and will need a more advanced solution, because the definitions could be in namespaces defined in two different modules, e.g., // module 1 namespace N { struct X; } // module 2 namespace N { struct X { /* ... */ }; } One possible implementation here is for C++ to extend the information associated with each identifier table to include the declaration IDs of any definitions associated with that name, regardless of context. We would have to eagerly load those definitions. llvm-svn: 174794
* Properly validate UCNs for C99 and C++03 (both more restrictive than C(++)11).Jordan Rose2013-02-092-0/+146
| | | | | | | | Add warnings under -Wc++11-compat, -Wc++98-compat, and -Wc99-compat when a particular UCN is incompatible with a different standard, and -Wunicode when a UCN refers to a surrogate character in C++03. llvm-svn: 174788
* [analyzer] Invalidation checker: move the "missing implementation" checkAnna Zaks2013-02-091-2/+2
| | | | | | | | | | | | The missing definition check should be in the same category as the missing ivar validation - in this case, the intent is to invalidate in the given class, as described in the declaration, but the implementation does not perform the invalidation. Whereas the MissingInvalidationMethod checker checks the cases where the method intention is not to invalidate. The second checker has potential to have a much higher false positive rate. llvm-svn: 174787
* [analyzer] Split IvarInvalidation into two checkersAnna Zaks2013-02-081-16/+32
| | | | | | | Separate the checking for the missing invalidation methods into a separate checker so that it can be turned on/off independently. llvm-svn: 174781
* [analyzer] IvarInvalidation: add annotation for partial invalidationAnna Zaks2013-02-081-6/+72
| | | | | | | | | | | The new annotation allows having methods that only partially invalidate IVars and might not be called from the invalidation methods directly (instead, are guaranteed to be called before the invalidation occurs). The checker is going to trust the programmer to call the partial invalidation method before the invalidator.This is common in cases when partial object tear down happens before the death of the object. llvm-svn: 174779
* objective-C: don't issue bogus warning aboutFariborz Jahanian2013-02-081-0/+21
| | | | | | | | "auto-synthesized may not work correctly with 'nib' loader" when 'readonly' property is redeclared 'readwrite' in class extension. // rdar://13123861 llvm-svn: 174775
* Simplify logic for avoiding concatenation after numeric constants.Jordan Rose2013-02-081-1/+9
| | | | | | | I threw in a couple of test cases for UD-suffixes -- already working, but it wasn't immediately obvious to me. llvm-svn: 174767
* StmtPrinter: Write large char values using \u or \U.Jordan Rose2013-02-081-6/+6
| | | | | | | | | This may not always be valid, but we were previously just emitting them raw. While here, s/isprint/isPrintable/ (using the new CharInfo). llvm-svn: 174766
* Teach BugReporter (extensive diagnostics) to emit a diagnostic when a loop ↵Ted Kremenek2013-02-081-0/+631
| | | | | | | | body is skipped. Fixes <rdar://problem/12322528>. llvm-svn: 174736
* [libclang] Add a test to make sure annotation works fine in the presence ofArgyrios Kyrtzidis2013-02-081-0/+27
| | | | | | | | | | | 'override' on the method. This was fixed in a previous commit, generally handling attributes that are at the end of the declaration. rdar://13140589 llvm-svn: 174734
* objective-C modern translation: Fix another random translation bugFariborz Jahanian2013-02-081-0/+43
| | | | | | | involving property getter expressions on rhs of property setter. // rdar://13138459 llvm-svn: 174729
* objective-C modern translator. Fixes a trivialFariborz Jahanian2013-02-081-0/+20
| | | | | | | rewriting bug where #ifdef ended up on the same line as the attribute declaration. llvm-svn: 174719
* Improve filechecking of volatile test.Tim Northover2013-02-081-37/+110
| | | | | | | | | | | | My previous attempt was extremely deficient, allowing more volatiles to be introduced and not even checking all of the ones that are present. This attempt doesn't try to keep track of the values stored or offsets within particular objects, just that the correct objects are accessed in a correctly volatile manner throughout. llvm-svn: 174700
* CMake: Include Clang unit tests in check-clang target in standalone builds.Jordan Rose2013-02-081-19/+25
| | | | | | | | | | | | | | | | Also, remove CLANG_BUILD_TESTS option. It won't have consistent behavior between standalone and non-standalone builds, so I'm not going to bother hooking it up for standalone builds. LLVM_BUILD_TESTS will continue to control unit test inclusion in the "all" target in non-standalone builds. Finally, fix the default value of CLANG_INCLUDE_TESTS, which was being set to the boolean value of "LLVM_INCLUDE_TESTS", i.e. OFF, rather than actually reading the variable ${LLVM_INCLUDE_TESTS}! If you picked up my earlier commit, YOU WILL HAVE TO MANUALLY SET THIS OPTION BACK ON. My apologies! Part two of r174691 (allow the unit tests to be built in standalone mode). llvm-svn: 174698
* Fix test failure by making sure this file isn't identical to any other fileNick Lewycky2013-02-081-0/+1
| | | | | | | included in the same test. Clang gets confused about whether it's already built a module for this file, when running on a content-addressible filesystem. llvm-svn: 174694
* Fix conflict between r174685 and r174645 (rename -fmodule-cache-path <foo> ↵Richard Smith2013-02-081-1/+1
| | | | | | to -fmodules-cache-path=<foo>). llvm-svn: 174690
* [libclang] Attribute visitation happens out-of-source-order, make sureArgyrios Kyrtzidis2013-02-082-2/+30
| | | | | | | | | we annotate properly when there is an attribute and not skip type specs if the attribute is after the declaration. rdar://13129077 llvm-svn: 174689
* Use the target address space value when mangling names.Tanya Lattner2013-02-082-0/+8
| | | | llvm-svn: 174688
* Fix stack overflow and improve performance when a module contains manyRichard Smith2013-02-083-0/+2017
| | | | | | | | | | | | | overloads of a name by claiming that there are no lookup results for that name in modules while loading the names from the module. Lookups in deserialization really don't want to find names which they themselves are in the process of introducing. This also has the pleasant side-effect of automatically caching PCH lookups which found no names. The runtime here is still quadratic in the number of overloads, but the constant is lower. llvm-svn: 174685
* objective-C modern translator. Generate #lineFariborz Jahanian2013-02-081-0/+40
| | | | | | | info in the translated code under -g only. // rdar://13138170 llvm-svn: 174684
OpenPOWER on IntegriCloud