summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* This reverts commit r224668 and r224667.Rafael Espindola2014-12-231-14/+0
| | | | | | | | | | r224667 broke bootstrap on Fedora 20 X86_64 (at least). See pr22006 for the details. r224668 depends on r224667. llvm-svn: 224770
* Add a triple to try and get this test passing on the ARM bots.Nico Weber2014-12-231-1/+1
| | | | llvm-svn: 224747
* Disable trigraphs in microsoft mode by default. Matches cl.exe.Nico Weber2014-12-221-2/+4
| | | | | | | | | | The default value of Opts.Trigraphs now no longer depends solely on the language input kind, so move the code out of setLangDefaults(). Also make sure that Opts.MSVCCompat is set before the Trigraph code runs. Related to PR21974. llvm-svn: 224719
* Rename test.cc files to test.cpp.Nico Weber2014-12-226-3/+3
| | | | | | | The lit.cfg files only add .cpp to suffixes, so these tests used to never run, oops. (Also tweak to of these tests in minor ways to make the actually pass.) llvm-svn: 224718
* Add test coverage for cc1's trigraph option handling.Nico Weber2014-12-221-0/+15
| | | | llvm-svn: 224714
* Simplify test for rdar://19256338Fariborz Jahanian2014-12-221-12/+4
| | | | | | (from patch r224549). llvm-svn: 224713
* Reapply "Change -save-temps to emit unoptimized bitcode files."Bob Wilson2014-12-217-46/+77
| | | | | | | | | | | | | | | | | | | | | | | | This reapplies r224503 along with a fix for compiling Fortran by having the clang driver invoke gcc (see r224546, where it was reverted). I have added a testcase for that as well. Original commit message: It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224688
* Fix for PR21758Richard Trieu2014-12-201-0/+14
| | | | | | | | | When a non-type template argument expression needs a conversion to change it into the argument type, preserve that information by remaking the TemplateArgument with an expression that has those conversions. Also a small fix to template type diffing to handle the extra conversions in some cases. llvm-svn: 224667
* Don't drop attributes when checking explicit specializations.Nico Weber2014-12-192-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a template class with attributes on a method, and an explicit specialization of that method: template <int> struct A { void foo() final; }; template <> void A<0>::foo() {} In this example, the attribute is `final`, but it might also be an __attribute__((visibility("foo"))), noreturn, inline, etc. clang's current behavior is to strip all attributes, which for some attributes is wrong (the snippet above allows a subclass of A<0> to override the final method, for example) and for others disagrees with gcc. So stop dropping attributes. r95845 added this code without a test case, and r176728 added the code for dropping attributes on parameters (with tests, but they still pass). As an additional wrinkle, do drop dllimport and dllexport, since that's how these two attributes work. (This is covered by existing tests.) Fixes PR21942. The approach is by Richard Smith, initial analysis and typing was done by me. With this, clang also matches GCC and EDG on all attributes Richard tested. llvm-svn: 224651
* Tweak the assert in ModuleBuilder from r224533 (PR21989)Hans Wennborg2014-12-191-0/+9
| | | | | | | Turns out there will be left-over deferred inline methods if there have been errors, because in that case HandleTopLevelDecl bails out early. llvm-svn: 224649
* DR1048: drop top-level cv-qualifiers when deducing the return type of aRichard Smith2014-12-193-8/+21
| | | | | | lambda-expression in C++11, to match the C++14 rules. llvm-svn: 224620
* Allow to disable all sanitizers with "-fno-sanitize=all" option.Alexey Samsonov2014-12-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds "all" sanitizer group. A shortcut "-fno-sanitize=all" can be used to disable all sanitizers for a given source file. "-fsanitize=all" option makes no sense, and will produce an error. This group can also be useful when we add "-fsanitize-recover=<list>" options (patch in http://reviews.llvm.org/D6302), as it would allow to conveniently enable/disable recovery for all specified sanitizers. Test Plan: regression test suite Reviewers: kcc, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6733 llvm-svn: 224596
* Added a fixit to remove empty parens from a C++11 attribute argument list ↵Aaron Ballman2014-12-191-0/+5
| | | | | | when we diagnose this as an error. llvm-svn: 224595
* Fix an address space id reset with array decay'sPekka Jaaskelainen2014-12-191-0/+11
| | | | | | | | | | implicit conversion. The issue was produced with OpenCL C code that called a function with a constant string literal argument. llvm-svn: 224592
* Attributes accepting an EnumArgument are allowed to pass a string literal, ↵Aaron Ballman2014-12-191-0/+1
| | | | | | | | or an identifier. VariadicEnumArguments now behave consistently instead of only accepting a string literal. This change affects the only attribute accepting a variadic enumeration: callable_when. llvm-svn: 224582
* PR21969: Improve diagnostics for a conversion function that has any pieces of aRichard Smith2014-12-194-7/+24
| | | | | | declared return type (including a trailing-return-type in C++14). llvm-svn: 224561
* Correct delayed typos in the operand to typeof expressions.Kaelyn Takata2014-12-191-0/+5
| | | | | | Fixes PR21947. llvm-svn: 224558
* [c Sema]. Patch fixes pointer-bool-conversion warning on C codeFariborz Jahanian2014-12-181-1/+15
| | | | | | | | when source range is incorrect causing the warning to be issued when it should not because expression is in a macro. rdar://19256338 llvm-svn: 224549
* Revert "Change -save-temps to emit unoptimized bitcode files."Reid Kleckner2014-12-186-68/+46
| | | | | | | | | | This reverts commit r224503. It broke compilation of fortran through the Clang driver. Previously `clang -c t.f` would invoke `gcc t.f` and `clang -cc1as`, but now it tries to call `clang -cc1 t.f` which fails for obvious reasons. llvm-svn: 224546
* Objective-C. Provide group name for warningFariborz Jahanian2014-12-182-2/+27
| | | | | | | on multiple selector names found during lookup. rdar://19265296 llvm-svn: 224536
* Revert "Don't build invalid AST nodes during recovery"Reid Kleckner2014-12-181-12/+1
| | | | | | | | | | | This reverts commit r224451. It caused us to reject some valid existing code. This code appears to run in non-error cases as well as error cases. If the scope of a DependentScopeDeclRefExpr is still incomplete it probably means we still have more instantiation to do. llvm-svn: 224526
* Correction to -mfu=neon-vfpv4 to pass the correct backend feature nameRichard Barton2014-12-181-2/+2
| | | | | Change-Id: I4dbfe1d97670fc4e626368ef1f91fc008778dfca llvm-svn: 224523
* Enabling this test again on mingw. The problem seems to happen whenYaron Keren2014-12-181-1/+0
| | | | | | | two identical module.modulemap are available on the include path and so should be fixed in the mingw driver include dies, when we'll have it. llvm-svn: 224515
* Fixed warnings on redefine keywords and reserved ids.Serge Pavlov2014-12-184-19/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro. The warning -Wkeyword-macro now is not issued in patterns that are used in configuration scripts: #define inline also for 'const', 'extern' and 'static'. If macro repalcement is identical to macro name, the warning also is not issued: #define volatile volatile And finally if macro replacement is also a keyword identical to the replaced one but decorated with leading/trailing underscores: #define inline __inline #define inline __inline__ #define inline _inline // in MSVC compatibility mode Warning -Wreserved-id-macro is off by default, it could help catching things like: #undef __cplusplus llvm-svn: 224512
* Parse: Don't parse after the eof has been consumedDavid Majnemer2014-12-181-0/+4
| | | | | | | | | | | | | | ParseCXXNonStaticMemberInitializer stashes away all the tokens for the initializer and an additional EOF token to denote where the initializer ends. However, it is possible for ParseLexedMemberInitializer to get its hands on the "real" EOF token; since the two tokens are indistinguishable, we end up consuming the EOF and descend into madness. Instead, make it possible to tell which EOF token we are looking at. This fixes PR21872. llvm-svn: 224505
* Fix for PR21915: assert on multidimensional VLA in function arguments.Alexey Bataev2014-12-182-0/+52
| | | | | | | Fixed assertion on type checking for arguments and parameters on function call if arguments are pointers to VLA Differential Revision: http://reviews.llvm.org/D6655 llvm-svn: 224504
* Change -save-temps to emit unoptimized bitcode files.Bob Wilson2014-12-186-46/+68
| | | | | | | | | | | | | | | | | | | It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224503
* Make sure that arm-linux-gnu is still the apcs-gnu ABI when weEric Christopher2014-12-182-13/+13
| | | | | | | | | | | | use clang -cc1 matching the front end and backend. Fix up a couple of tests that were testing aapcs for arm-linux-gnu. The test that removes the aapcs abi calling convention removes them because the default triple matches what the backend uses for the calling convention there and so it doesn't need to be explicitly stated - see the code in TargetInfo.cpp. llvm-svn: 224491
* Reinstate aapcs as the default arm abi.Eric Christopher2014-12-181-5/+5
| | | | llvm-svn: 224490
* CGDebugInfo: Use DIBuilder API for self-referencing DICompositeTypesDuncan P. N. Exon Smith2014-12-181-0/+15
| | | | | | | | | | | Use new `DIBuilder` API from LLVM r224482 to mutate `DICompositeType`s, rather than changing them directly. This allows `DIBuilder` to track otherwise orphaned cycles when `CollectContainingType()` creates a self-reference. Fixes PR21941. llvm-svn: 224483
* Fix diagnostic for static methods referencing fields from using declsReid Kleckner2014-12-181-0/+8
| | | | | | | | | | | | Previously we thought the instance member was a function, not a field, and we'd say something silly like: t.cpp:4:27: error: call to non-static member function without an object argument static int f() { return n; } ^ Noticed in PR21923. llvm-svn: 224480
* [Objective-C]. Modern property getters have side-effects.Fariborz Jahanian2014-12-182-1/+18
| | | | | | | | So, place warning about property getter should not be used for side-effect under its own group so warning can be turned off. rdar://19137815 llvm-svn: 224479
* Revert "Put static local variables of inline functions in the function comdat."Rafael Espindola2014-12-171-3/+6
| | | | | | | | | This reverts commit r224369. Thanks to Reid Kleckner for pointing out that we need a bigger gun to fix this case. llvm-svn: 224475
* Don't assume friended C++ method decls have qualifiersReid Kleckner2014-12-171-1/+54
| | | | | | | | | | | There are a few cases where unqualified lookup can find C++ methods. Unfortunately, none of them seem to have illegal access paths, so I can't excercise the diagnostic source range code that I am changing here. Fixes PR21851, which was a crash on valid. llvm-svn: 224471
* Adding a -Wunused-value warning for expressions with side effects used in an ↵Aaron Ballman2014-12-1715-21/+95
| | | | | | unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case. llvm-svn: 224465
* [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, clang partKostya Serebryany2014-12-171-0/+1
| | | | llvm-svn: 224462
* [c++1z] Fixes for generalized non-type template argument support: check forRichard Smith2014-12-171-0/+38
| | | | | | | | exact type match for deduced template arguments, and be sure to produce correct canonical TemplateArgument representations to enable correct redeclaration matching. llvm-svn: 224456
* Destroy the diagnostic client first in ~DiagnosticEngineReid Kleckner2014-12-171-0/+6
| | | | | | | | | | | | Add a comment and a test to ~DiagnosticEngine about the ordering requirements on the teardown of DiagnosticConsumer. This could also be accomplished by rearranging the fields of ~DiagnosticEngine, but I felt that this was a better, more explicit solution. This fixes PR21911, an issue that occurred after the unique_ptr migration in r222193. llvm-svn: 224454
* This test does not pass for -target i686-pc-windows-gnu (-mingw32)Yaron Keren2014-12-171-0/+1
| | | | | | | when clang is built with mingw-w64 4.9.1 or according to http://llvm.org/PR20995 , mingw-w64 4.7.2 as well. llvm-svn: 224453
* Don't build invalid AST nodes during recoveryReid Kleckner2014-12-171-1/+12
| | | | | | | | | | | | | | A DependentScopeDeclRefExpr should always have a nested name specifier. During template instantiation, if we found that the named context was incomplete, we would previously build a DependentScopeDeclRefExpr with an empty qualifier. This error recovery path has been asserting for some time. The other error codepaths use ExprError, so we can do the same. Fixes PR21864. llvm-svn: 224451
* Support constant evaluation for member calls on std::initializer_listRichard Smith2014-12-171-0/+3
| | | | | | temporaries. llvm-svn: 224449
* Revert "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-172-9/+11
| | | | | | | | | Fails an ASan bootstrap - I'll try to reproduce locally & sort that out before recommitting. This reverts commit r224385. llvm-svn: 224441
* CodeGen: implement __emit intrinsicSaleem Abdulrasool2014-12-172-0/+25
| | | | | | | | | | | | | | | For MSVC compatibility, add the `__emit' builtin. This is used in the Windows SDK headers, and must therefore be implemented as a builtin rather than an intrinsic. The `__emit' builtin provides a mechanism to emit a 16-bit opcode instruction into the stream. The value must be a compile time constant expression. No guarantees are made about the CPU and memory states after the execution of the instruction. Due to the unchecked nature of the builtin, only support this on Windows on ARM. llvm-svn: 224438
* [mips] Always clobber $1 for MIPS inline asm.Toma Tabacu2014-12-174-8/+8
| | | | | | | | | | | | | | | | | | | | Summary: Because GCC doesn't use $1 for code generation, inline assembly code can use $1 without having to add it to the clobbers list. LLVM, on the other hand, does not shy away from using $1, and this can cause conflicts with inline assembly which assumes GCC-like code generation. A solution to this problem is to make Clang automatically clobber $1 for all MIPS inline assembly. This is not the optimal solution, but it seems like a necessary compromise, for now. Reviewers: dsanders Reviewed By: dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6638 llvm-svn: 224428
* Teach compile_commands.json test that windows-gnu is the new name for mingw32.Yaron Keren2014-12-171-1/+1
| | | | llvm-svn: 224426
* Teach lit.cfg to recognize -windows-gnu in addition to -mingw32.Yaron Keren2014-12-171-2/+2
| | | | llvm-svn: 224421
* Sema: Don't dyn_cast a null pointer in CheckUsingDeclQualifierDavid Majnemer2014-12-171-0/+5
| | | | | | | | | This code was written with the intent that a pointer could be null but we dyn_cast'd it anyway. Change the dyn_cast to a dyn_cast_or_null. This fixes PR21933. llvm-svn: 224411
* Parse: Consume tokens more carefully in CheckForLParenAfterColonColonDavid Majnemer2014-12-171-1/+9
| | | | | | | | | We would consume the lparen even if it wasn't followed by an identifier or a star-identifier pair. This fixes PR21815. llvm-svn: 224403
* Add missing testcase from r224388.Richard Smith2014-12-171-0/+19
| | | | llvm-svn: 224401
* [CallGraph] Make sure the edges are not missed due to re-declarationsAnna Zaks2014-12-171-6/+17
| | | | | | | | | | | | | | A patch by Daniel DeFreez! We were previously dropping edges on re-declarations. Store the canonical declarations in the graph to ensure that different references to the same function end up reflected with the same call graph node. (Note, this might lead to performance fluctuation because call graph is used to determine the function analysis order.) llvm-svn: 224398
OpenPOWER on IntegriCloud