summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement -MG. Fixes PR9613Peter Collingbourne2011-07-121-0/+5
| | | | llvm-svn: 134996
* In ARC mode, consider Objective-C lifetime types (object pointers andDouglas Gregor2011-07-124-6/+29
| | | | | | | | | | | | | | block pointers) that don't have any qualification to be POD types. We were previously considering them to be non-POD types, because this was convenient in C++ for is_pod-like traits. However, we now end up inferring lifetime in such cases (template arguments infer __strong), so it is not necessary. Moreover, we want rvalues of object type (which have their lifetime stripped) to be PODs to allow, e.g., va_arg(arglist, id) to function properly. Fixes <rdar://problem/9758798>. llvm-svn: 134993
* Fix a bug where a local variable named 'self' is causingFariborz Jahanian2011-07-121-7/+8
| | | | | | | implicit ivar accesses to go through the 'self' variable rather than the real 'self' for the method. // rdar://9730771 llvm-svn: 134992
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-122-9/+15
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* Improve name mangling for instantiation-dependent types that are notDouglas Gregor2011-07-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | dependent. This covers an odd class of types such as int (&)[sizeof(sizeof(T() + T()))]; which involve template parameters but, because of some trick typically involving a form of expression that is never type-dependent, resolve down to a non-dependent type. Such types need to be mangled essentially as they were written in the source code (involving template parameters), rather than via their canonical type. In general, instantiation-dependent types should be mangled as they were written in the source. However, since we can't do that now without non-trivial refactoring of the AST (see the new FIXME), I've gone for this partial solution: only use the as-written-in-the-source mangling for these strange types that are instantiation-dependent but not dependent. This provides better compatibility with previous incarnations of Clang and with GCC. In the future, we'd like to get this right. Fixes <rdar://problem/9663282>. llvm-svn: 134984
* Fix typo correction crash on overloaded functions, pr10283.Hans Wennborg2011-07-121-0/+12
| | | | | | | It would be cool if we could do overload resolution to suggest the right function, but at least this fixes the crashing. llvm-svn: 134976
* Implement name mangling for sizeof...(function parameter pack).Douglas Gregor2011-07-121-0/+10
| | | | llvm-svn: 134974
* Fix a problem Eli ran into where we now reject incomplete arrays of Chris Lattner2011-07-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | uncompleted struct types. We now do what llvm-gcc does and compile them into [i8 x 0]. If the type is later completed, we make sure that it is appropriately cast. We compile the terrible example to something like this now: %struct.A = type { i32, i32, i32 } @g = external global [0 x i8] define void @_Z1fv() nounwind { entry: call void @_Z3fooP1A(%struct.A* bitcast ([0 x i8]* @g to %struct.A*)) ret void } declare void @_Z3fooP1A(%struct.A*) define %struct.A* @_Z2f2v() nounwind { entry: ret %struct.A* getelementptr inbounds ([0 x %struct.A]* bitcast ([0 x i8]* @g to [0 x %struct.A]*), i32 0, i64 1) } llvm-svn: 134972
* fix an unintended behavior change in the type system rewrite, which caused ↵Chris Lattner2011-07-127-14/+14
| | | | | | | | | | | | | | | | | | | | | us to compile stuff like this: typedef struct { int x, y, z; } foo_t; foo_t g; into: %"struct.<anonymous>" = type { i32, i32, i32 } we now get: %struct.foo_t = type { i32, i32, i32 } This doesn't change the behavior of the compiler, but makes the IR much easier to read. llvm-svn: 134969
* Mangle dependent template names of unknown arityDouglas Gregor2011-07-121-0/+13
| | | | llvm-svn: 134967
* fix PR10335 by watching out for IR type compatibility in call argument lists.Chris Lattner2011-07-121-2/+14
| | | | llvm-svn: 134966
* make test name less specificChris Lattner2011-07-121-0/+0
| | | | llvm-svn: 134964
* Implement the Itanium C++ ABI's mangling rule forDouglas Gregor2011-07-121-0/+16
| | | | | | non-instantiation-dependent sizeof and alignof expressions. llvm-svn: 134963
* [ARC] Complain about property without storage attribute when @synthesizing ↵Argyrios Kyrtzidis2011-07-121-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it, not at its declaration. For this sample: @interface Foo @property id x; @end we get: t.m:2:1: error: ARC forbids properties of Objective-C objects with unspecified storage attribute @property id x; ^ 1 error generated. The error should be imposed on the implementor of the interface, not the user. If the user uses a header of a non-ARC library whose source code he does not have, we are basically asking him to go change the header of the library (bad in general), possible overriding how the property is implemented if he gets confused and says "Oh I'll just add 'copy' then" (even worse). Second issue is that we don't emit any error for 'readonly' properties, e.g: @interface Foo @property (readonly) id x; // no error here @end @implementation Foo @synthesize x; // no error here too @end We should give an error when the implementor is @synthesizing a property which doesn't have any storage specifier; this is when the explicit specifier is important, because we are going to create an ivar and we want its ownership to be explicit. Related improvements: -OBJC_PR_unsafe_unretained turned out to not fit in ObjCPropertyDecl's bitfields, fix it. -For properties of extension classes don't drop PropertyAttributesAsWritten values. -Have PropertyAttributesAsWritten actually only reflect what the user wrote rdar://9756610. llvm-svn: 134960
* Do the same as r134946 for arrays. Add more testcases for avx x86_64 argBruno Cardoso Lopes2011-07-121-3/+15
| | | | | | passing. llvm-svn: 134951
* Fix one x86_64 abi issue and the test to actually look for the right thing,Bruno Cardoso Lopes2011-07-121-2/+2
| | | | | | which is: { <4 x float>, <4 x float> } should continue to go through memory. llvm-svn: 134946
* Reapply r134754, which turns out to be working correctly and alsoBruno Cardoso Lopes2011-07-111-0/+30
| | | | | | add one more testcase. llvm-svn: 134934
* Allow us to compute linkage et al for instantiation-dependent types.Douglas Gregor2011-07-111-0/+8
| | | | llvm-svn: 134932
* Revert r134898, "test/Frontend/dependency-gen.c: Mark XFAIL: mingw due to ↵NAKAMURA Takumi2011-07-111-4/+0
| | | | | | | | PR10331. to appease mingw-target (and non-mingw-host) builds. PR10331 is still alive I suppose. llvm-svn: 134931
* Reenable test.Argyrios Kyrtzidis2011-07-111-1/+0
| | | | llvm-svn: 134928
* Add missing header file for the test.Argyrios Kyrtzidis2011-07-111-0/+1
| | | | llvm-svn: 134927
* Add diagnostic for constructs like "va_arg(l, float)" which have undefined ↵Eli Friedman2011-07-111-0/+9
| | | | | | behavior. PR10201. llvm-svn: 134926
* Test is broken; XFAIL it until Argyrios gets a chance to look at it.Eli Friedman2011-07-111-0/+1
| | | | llvm-svn: 134925
* Don't warn for unused macro when undef'ing it, if it comes from an included ↵Argyrios Kyrtzidis2011-07-111-0/+5
| | | | | | file. rdar://9745065 llvm-svn: 134919
* Emit partial destruction of structs with initializer lists.John McCall2011-07-111-0/+30
| | | | llvm-svn: 134913
* objc-arc: Diagnose when captured variable in block literalsFariborz Jahanian2011-07-111-0/+84
| | | | | | | | require destruction and there is possibility of that without construction. Thanks Johnm for review and suggestions offline. // rdar://9535237. llvm-svn: 134906
* Apply patch from Richard Trieu to fix PR9548:Chandler Carruth2011-07-111-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When two different types has the same text representation in the same diagnostic message, print an a.k.a. after the type if the a.k.a. gives extra information about the type. class versa_string; typedef versa_string string; namespace std {template <typename T> class vector;} using std::vector; void f(vector<string> v); namespace std { class basic_string; typedef basic_string string; template <typename T> class vector {}; void g() { vector<string> v; f(v); } } Old message: ---------------- test.cc:15:3: error: no matching function for call to 'f' f(&v); ^ test.cc:7:6: note: candidate function not viable: no known conversion from 'vector<string>' to 'vector<string>' for 1st argument void f(vector<string> v); ^ 1 error generated. New message: --------------- test.cc:15:3: error: no matching function for call to 'f' f(v); ^ test.cc:7:6: note: candidate function not viable: no known conversion from 'vector<string>' (aka 'std::vector<std::basic_string>') to 'vector<string>' (aka 'std::vector<versa_string>') for 1st argument void f(vector<string> v); ^ 1 error generated. llvm-svn: 134904
* Tweak two tests with MSYS-bash tolerant.NAKAMURA Takumi2011-07-112-4/+4
| | | | llvm-svn: 134899
* test/Frontend/dependency-gen.c: Mark XFAIL: mingw due to PR10331.NAKAMURA Takumi2011-07-111-0/+4
| | | | llvm-svn: 134898
* Don't complain about missing return statements for nakedDouglas Gregor2011-07-111-0/+4
| | | | | | functions. Fixes <rdar://problem/9731999>. llvm-svn: 134897
* test/Preprocessor/include-directive2.c: Get rid of using <float.h> to avoid ↵NAKAMURA Takumi2011-07-111-1/+1
| | | | | | #include_next on mingw. llvm-svn: 134896
* Fixed PR10243.Abramo Bagnara2011-07-111-0/+23
| | | | llvm-svn: 134892
* Fix a lot of problems with the partial destruction of arrays:John McCall2011-07-112-2/+103
| | | | | | | | | | | - an off-by-one error in emission of irregular array limits for InitListExprs - use an EH partial-destruction cleanup within the normal array-destruction cleanup - get the branch destinations right for the empty check Also some refactoring which unfortunately obscures these changes. llvm-svn: 134890
* test/CMakeLists.txt: clang-test may depend on llc when LLVM is built together.NAKAMURA Takumi2011-07-101-2/+1
| | | | llvm-svn: 134874
* test/CMakeLists.txt: Fix ClangUnitTests to be built with clang-test and ↵NAKAMURA Takumi2011-07-101-2/+2
| | | | | | check-all. llvm-svn: 134873
* relax this test a bit to hopefully work with VC++Chris Lattner2011-07-101-1/+1
| | | | llvm-svn: 134870
* Change __debugbreak signature to void __debugbreak(void); MSVC compatibility.Francois Pichet2011-07-101-1/+1
| | | | llvm-svn: 134869
* implement a nice new optimization: CodeGenTypes::UpdateCompletedTypeChris Lattner2011-07-101-4/+4
| | | | | | | | | | | | | is called whenever a tag type is completed. We previously used that as the sign to layout the codegen representation for the tag type, which worked but meant that we laid out *every* completed type, whether it was used or not. Now we just lay out the type if we've already seen it somehow else. This means that we lay out types we've used but haven't seen a body for, but we don't lay out tons of stuff that noone cares about. llvm-svn: 134866
* keep track of whether being in a RS_StructPointer stateChris Lattner2011-07-103-7/+7
| | | | | | | | | | caused us to skip layout out a function accurately. If so, flush the type cache for both the function and struct case to ensure that any pointers to the functions get recomputed. This is overconservative, but with this patch clang can build itself again. llvm-svn: 134863
* Fix the clang bootstrap and Jay's testcase from llvm-dev by being completelyChris Lattner2011-07-105-12/+25
| | | | | | | | | | conservative when converting a functiontype to IR when in a "pointer within a struct" context. This has the unfortunate sideeffect of compiling all function pointers inside of structs into "{}*" which, though correct, is ugly. This has the positive side effect of being correct, and it is pretty straight-forward to improve on this. llvm-svn: 134861
* Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible sinceChris Lattner2011-07-101-0/+8
| | | | | | | | | | | | | | | | | | it is a predicate, not an action. Change the return type to be a bool, not the incomplete member. Enhace it to detect the recursive compilation case, allowing us to compile Eli's testcase on llvmdev: struct T { struct T (*p)(void); } t; into: %struct.T = type { {}* } @t = common global %struct.T zeroinitializer, align 8 llvm-svn: 134853
* test/CMakeLists.txt: Add missing c-arcmt-test to clang-test.deps.NAKAMURA Takumi2011-07-091-1/+1
| | | | llvm-svn: 134851
* [arcmt] Remove test/ARCMT/with-working-dir.m which fails at windows hosts ↵Argyrios Kyrtzidis2011-07-092-90/+0
| | | | | | | | and is not that useful in the first place. http://llvm.org/PR10312. llvm-svn: 134845
* [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.Argyrios Kyrtzidis2011-07-098-0/+57
| | | | | | | | | | | | | | | | | | | | This is a new mode of migration, where we avoid modifying the original files but we emit temporary files instead. <path> will be used to keep migration process metadata. Currently the temporary files that are produced are put in the system's temp directory but we can put them in the <path> if is necessary. Also introduce new ARC migration functions in libclang whose only purpose, currently, is to accept <path> and provide pairs of original file/transformed file to map from the originals to the files after transformations are applied. Finally introduce the c-arcmt-test utility that exercises the new libclang functions, update arcmt-test, and add tests for the whole process. rdar://9735086. llvm-svn: 134844
* fix this on 32-bit hosts.Chris Lattner2011-07-091-1/+1
| | | | llvm-svn: 134840
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-0958-204/+201
| | | | llvm-svn: 134831
* cc1 must initialize MC subtarget infos for inline asm parsing. Re-enable ↵Evan Cheng2011-07-091-4/+2
| | | | | | asm-errors.c llvm-svn: 134811
* disable this test to get the botz green again.Chris Lattner2011-07-091-2/+4
| | | | llvm-svn: 134808
* A number of array-related IR-gen cleanups.John McCall2011-07-094-70/+91
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* Silly typo in test for r134770.Eli Friedman2011-07-081-1/+1
| | | | llvm-svn: 134774
OpenPOWER on IntegriCloud