summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Implement the feature I was originally driving toward when I startedChandler Carruth2011-10-053-0/+20
| | | | | | | | | | | | | | this saga. Teach the driver to detect a GCC installed along side Clang using the existing InstalledDir support in the Clang driver. This makes a lot of Clang's behavior more automatic when it is installed along side GCC. Also include the first test cases (more to come, honest) which test both the install directory behavior, and the version sorting behavior to show that we're actually searching for the best candidate GCC installation now. llvm-svn: 141145
* c: assignment/init of a function pointer whose function(s)Fariborz Jahanian2011-10-051-0/+16
| | | | | | | | return to one which does not return (has noreturn attribute) should warn as it is an unsafe assignment. // rdar://10095762 c++ already handles this. This is the c version. llvm-svn: 141141
* Don't allow an rvalue reference to bind to the result of a calling aDouglas Gregor2011-10-041-4/+19
| | | | | | | | | conversion function whose result type is an lvalue reference. The initialization code already handled this properly, but overload resolution was allowing the binding. Fixes PR11003 / <rdar://problem/10233078>. llvm-svn: 141137
* Basic/Diagnostics: Apparently, #pragma ... diagnostic is intended to overrideDaniel Dunbar2011-10-041-0/+9
| | | | | | | | the command line options (at least according to GCC's documentation). GCC 4.2 didn't appear to actually do this, but it seems like that has been fixed in later release, so we will follow the docs. llvm-svn: 141119
* objc: Turn diagnostic on property type mismatch inFariborz Jahanian2011-10-041-2/+2
| | | | | | continuation class into warning. // rdar://10231514 llvm-svn: 141100
* Place diagnostic warn_atomic_property_rule under a -W flag. Fixes ↵Ted Kremenek2011-10-041-2/+1
| | | | | | <rdar://problem/10230631>. llvm-svn: 141089
* Place diagnostic warn_ownin_getter_rule under a -W flag. Fixes ↵Ted Kremenek2011-10-041-2/+1
| | | | | | <rdar://problem/10230626>. llvm-svn: 141088
* Place diagnostic ext_predef_outside_function under a -W flag. Fixes ↵Ted Kremenek2011-10-041-2/+1
| | | | | | <rdar://problem/10226192>. llvm-svn: 141087
* Revert r141060. We should NEVER add new warnings that aren't guarded by flag.Ted Kremenek2011-10-041-2/+1
| | | | | | This reverts commit 5383d065241b18e84232bc50d81523f2058ea62b. llvm-svn: 141077
* Mark calls to objc_retainBlock that don't result from castsJohn McCall2011-10-041-0/+22
| | | | | | to id so that we can still optimize them appropriately. llvm-svn: 141064
* Specify -ccc-clang-archs for le32 targets which may not be supported by default.Bob Wilson2011-10-041-3/+3
| | | | llvm-svn: 141062
* Improve location fidelity of objc decls.Argyrios Kyrtzidis2011-10-047-53/+53
| | | | | | | | -Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl. -Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the class name, not the location of '@'. llvm-svn: 141061
* Update testcase for r141053+r141055.Chad Rosier2011-10-041-1/+2
| | | | llvm-svn: 141060
* objc arc: Suppress certain arc diagnostics on unavailableFariborz Jahanian2011-10-031-0/+6
| | | | | | functions. // rdar://10186536 llvm-svn: 141037
* Fixed exapnsion range for # and ##.Abramo Bagnara2011-10-031-6/+3
| | | | llvm-svn: 141012
* objc++: Accessing explicit property of reference type need Fariborz Jahanian2011-10-031-0/+23
| | | | | | not bind to a temporary. Fixes //rdar://10188258 llvm-svn: 141009
* Propagate __attribute__((returns_twice)) from C to IL.Rafael Espindola2011-10-032-14/+25
| | | | llvm-svn: 141002
* Test a multilib setup on a 64-bit host. This is the far more commonChandler Carruth2011-10-0312-0/+33
| | | | | | | | | | | | | configuration, although the test still stubs out more directories than are necessary or common in order to exercise all of the lookup paths observed with upstream GCC. This finishes testing the distribution-independent and GCC-installation-independent parts of the library path search logic. More testing is still needed for the triple detection, GCC-installation detection, and handling distributions with unusual configurations. llvm-svn: 141000
* Enable generic multilib support on 32bit hosts. Previously this was onlyChandler Carruth2011-10-0312-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | enabled for debian hosts, which is quite odd. I think all restriction on when Clang attempts to use a multilib installation should go away. Clang is fundamentally a cross compiler. It behaves more like GCC when built as a cross compiler, and so it should just use multilib installs when they are present on the system. However, there is a very specific exemption for Exherbo, which I can't test on, so I'm leaving that in place. With this, check in a generic test tree for multilib on a 32-bit host. This stubs out many directories that most distributions don't use but that uptsream GCC supports. This is intended to be an agnostic test that the driver behaves properly compared with the GCC driver it aims for compatibility with. Also, fix a bug in the driver that this testing exposed (see!) where it was incorrectly testing the target architecture rather than the host architecture. If anyone is having trouble with the tree-structure stubs I'm creating to test this, let me know and I can revisit the design. I chose this over (for example) a tar-ball in order to make tests run faster at the small, hopefully amortized VCS cost. llvm-svn: 140999
* Relax an assertion here a bit. This doesn't really matter, as we won'tChandler Carruth2011-10-031-2/+2
| | | | | | | | | | | | | include *any* path on crtbegin.o unless we actually find such a file via one of the search paths. We still strictly check the search paths right after this, so we'll catch any issues there. The reason for this is that the driver does some normalization of the path on the actual object file, and this changes the textual format of the string on Windows. It no longer matches the textual format of the sysroot flag. llvm-svn: 140998
* Test that we include a GCC-triple-prefixed tree. While I don't know ofChandler Carruth2011-10-033-0/+2
| | | | | | | any distros that use this, building a multilib GCC from mainline will install linker scripts here. llvm-svn: 140996
* Teach the logic for locating an installed GCC about the system root.Chandler Carruth2011-10-033-3/+11
| | | | | | | | | | | | | | | | | This requires fixing a latent bug -- if we used the default host triple instead of an autodetected triple to locate GCC's installation, we didn't go back and fix the GCC triple. Correct that with a pile of hacks. This entire routine needs a major refactoring which I'm saving for a subsequent commit. Essentially, the detection of the GCC triple should be hoisted into the same routine as we locate the GCC installation: the first is intrinsically tied to the latter. Then the routine will just return the triple and base directory. Also start to bring the rest of the library search path logic under test, including locating crtbegin.o. Still need to test the multilib and other behaviors, but there are also bugs in the way of that. llvm-svn: 140995
* Add initial support for applying the sysroot to library search paths.Chandler Carruth2011-10-033-5/+12
| | | | | | | | | | | | | | | | | | | | This is still very much a WIP, but sysroot was completely broken before this so we are moving closer to correctness. The crux of this is that 'ld' (on Linux, the only place I'm touching here) doesn't apply the sysroot to any flags given to it. Instead, the driver must translate all the paths it adds to the link step with the system root. This is easily observed by building a GCC that supports sysroot, and checking its driver output. This patch just fixes the non-multilib library search paths. We should also use this in many other places, but first things first. This also allows us to make the Linux 'ld' test independent of the host system. This in turn will allow me to check in test tree configurations based on various different distro's configuration. Again, WIP. llvm-svn: 140990
* Rework the selection of builtin library search paths on Linux toChandler Carruth2011-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | precisely match the pattern and logic used by the GCC driver on Linux as of a recent SVN checkout. This happens to follow a *much* more principled approach. There is a strict hierarchy of paths examined, first with multilib-suffixing, second without such suffixing. Any and all of these directories which exist will be added to the library search path when using GCC. There were many places where Clang followed different paths, omitted critical entries, and worst of all (in terms of challenges to debugging) got the entries in a subtly wrong order. If this breaks Clang on a distro you use, please let me know, and I'll work with you to figure out what is needed to work on that distro. I've checked the behavior of the latest release of Ubuntu, OpenSUSE, Fedora, and Gentoo. I'll be testing it on those as well as Debian stable and unstable and ArchLinux. I may even dig out a Slackware install. No real regression tests yet, those will follow once I add enough support for sysroot to simulate various distro layouts in the testsuite. llvm-svn: 140981
* CUDA: diagnose invalid calls across targetsPeter Collingbourne2011-10-022-1/+45
| | | | llvm-svn: 140978
* CUDA: add separate diagnostics for too few/many exec config argsPeter Collingbourne2011-10-021-0/+2
| | | | llvm-svn: 140977
* CUDA: diagnose unconfigured calls to global functionsPeter Collingbourne2011-10-021-0/+1
| | | | llvm-svn: 140975
* Sorry, I misunderstood the interaction here; the GNU runtime doesJohn McCall2011-10-021-5/+3
| | | | | | | | | support both a fragile and non-fragile ABI, and it can be selected at runtime. That driver option also works on Darwin (although obviously the code is not necessarily usable if the system runtime is fragile) so just do that. llvm-svn: 140973
* Use -fgnu-runtime to force the use of the non-fragile ABI;John McCall2011-10-021-6/+5
| | | | | | | otherwise these tests would fail on hosts that happen to default to that, since that affects whether default synthesis can happen. llvm-svn: 140970
* Temporarily XFAIL this test until John or someone else who works on ObjCChandler Carruth2011-10-021-0/+3
| | | | | | can look at it. llvm-svn: 140968
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-02305-440/+440
| | | | | | | | | | | | | | | | | | | increasingly prevailing case to the point that new features like ARC don't even support the fragile ABI anymore. This required a little bit of reshuffling with exceptions because a check was assuming that ObjCNonFragileABI was only being set in ObjC mode, and that's actually a bit obnoxious to do. Most, though, it involved a perl script to translate a ton of test cases. Mostly no functionality change for driver users, although there are corner cases with disabling language-specific exceptions that we should handle more correctly now. llvm-svn: 140957
* Fix LiveVariables analysis bug with MaterializeTemporaryExpr and fix ↵Ted Kremenek2011-10-021-1/+1
| | | | | | handling in ExprEngine. Fixes <rdar://problem/10201666>. llvm-svn: 140956
* When performing an @throw in ARC, retain + autoreleaseJohn McCall2011-10-011-10/+12
| | | | | | | the pointer, being sure to do so before running cleanups associated with that full-expression. rdar://10042689 llvm-svn: 140945
* Parse attributes written in an ObjC method parameter type asJohn McCall2011-10-011-0/+24
| | | | | | attributes on the parameter declaration. llvm-svn: 140944
* Address PR10616. The crash has already been fixed by Ted in r140725, so just ↵Anna Zaks2011-10-011-0/+13
| | | | | | refactor to use existing API + test case. llvm-svn: 140932
* Hey, maybe we shouldn't silently ignore decl attributesJohn McCall2011-10-012-2/+6
| | | | | | on declarators written as types. llvm-svn: 140931
* As I suspected, completely non-multilib machines just get no suffix.Chandler Carruth2011-10-011-3/+1
| | | | | | | | | | Make the suffixes optional everywhere, and just make sure they have the right value. The suffixes aren't the interesting part of this test anyways. Sorry for the churn as I let the bots try out various patterns. llvm-svn: 140927
* constexpr: semantic checking for constexpr functions and constructors. Based inRichard Smith2011-10-016-9/+551
| | | | | | | | | | | | | part on patches by Peter Collingbourne. We diverge from the C++11 standard in a few areas, mostly related to checking constexpr function declarations, and not just definitions. See WG21 paper N3308=11-0078 for details. Function invocation substitution is not available in this patch; constexpr functions cannot yet be used from within constant expressions. llvm-svn: 140926
* Teach this test to cope with Windows suffixes so that msys builds canChandler Carruth2011-10-011-2/+2
| | | | | | run it. llvm-svn: 140925
* Correct my failure at writing proper regex's for FileCheck. Thanks Nick.Chandler Carruth2011-10-011-1/+1
| | | | llvm-svn: 140920
* Allow for both 'lib' and 'lib32', as both seem to be in evidence. I'veChandler Carruth2011-10-011-1/+3
| | | | | | | | | left a FIXME to go track down more distros and see if 'lib' is ever the 64-bit half. This should hopefully appease the build bots. llvm-svn: 140915
* There might be an 'ld' without any path prefix.Chandler Carruth2011-10-011-2/+2
| | | | llvm-svn: 140913
* Allow the results of cf_returns_not_retained functionJohn McCall2011-10-013-13/+85
| | | | | | | | | | calls, or calls to audited functions without an explicit return attribute, to be casted without a bridge cast. Tie this mechanism in with the existing exceptions to the cast restrictions. State those restrictions more correctly and generalize. llvm-svn: 140912
* Tweak the interface for analyzing the CF conventions for a nameJohn McCall2011-10-011-0/+10
| | | | | | | | | | | | to take a FunctionDecl* instead of an llvm::StringRef. Eventually we might push more logic in there, like using slightly different conventions for C++ methods. Also, fix a bug where 'copy' and 'create' were being caught in non-camel-cased strings. We want copyFoo and CopyFoo and XCopy but not Xcopy or xcopy. llvm-svn: 140911
* Add a test that ensures we get the basic multilib '-L' flags to 'ld'Chandler Carruth2011-10-011-0/+9
| | | | | | invocations on Linux. llvm-svn: 140909
* Revert my --working-directory option, which wasn't well thought through.Daniel Dunbar2011-09-301-3/+0
| | | | llvm-svn: 140889
* objc arc: allow objc_returns_inner_pointer on methods that return Fariborz Jahanian2011-09-301-0/+22
| | | | | | | a reference type, since inner reference is much like an inner pointer. // rdar://10139365 llvm-svn: 140880
* Support dllimport and dllexport on x86-64 Windows. PR10978. Patch by Ruben ↵Eli Friedman2011-09-301-0/+1
| | | | | | Van Boxem. llvm-svn: 140871
* objc gc: assigning to an objc object struct member through an ivar Fariborz Jahanian2011-09-301-2/+19
| | | | | | pointer to this struct must go through the none ivar writer barrier. llvm-svn: 140867
* [libclang] Introduce CXCursor_CXXAccessSpecifier for C++'s ↵Argyrios Kyrtzidis2011-09-301-15/+15
| | | | | | | | public:/private:/protected: specifiers. Patch by Paolo Capriotti! llvm-svn: 140864
OpenPOWER on IntegriCloud