summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[Driver] Quote clang full version in dwarf producer when invoking cc1as"Bruno Cardoso Lopes2016-05-021-2/+0
| | | | | | | | | | | | | | This reverts commit r264813 / 6484b95d634f53dd929c75265ef3c4decf397584. While using it in the shell is fine, this a problem when cc1as is invoked directly by the driver because single quoting the clang full version makes cc1as write out the version with the quotes in the final binary. If the user wants to copy-n-pastable output, it could use either -### or CC_PRINT_OPTIONS=1 clang -v ... llvm-svn: 268297
* Make thinlto clang test more robust against LLVM changes.Mehdi Amini2016-04-241-7/+2
| | | | | | | | We should just test the effect of the clang level option here, i.e. that a summary is correctly emitted with -flto=thin From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267321
* Fix Clang crash with template type diffing.Richard Trieu2016-03-301-0/+37
| | | | | | | | | | Fixes https://llvm.org/bugs/show_bug.cgi?id=27129 which is crash involving type aliases and template type diffing. Template arguments for type aliases and template arguments for the underlying desugared type may not have one-to-one relations, which could mess us the attempt to get more information from the desugared type. For type aliases, ignore the iterator over the desugared type. llvm-svn: 264940
* [Driver] Quote clang full version in dwarf producer when invoking cc1asBruno Cardoso Lopes2016-03-301-0/+2
| | | | | | | | | Convenience to allow easy copy-n-paste from clang -v output when reproducing cc1as comandline. rdar://problem/23959295 llvm-svn: 264813
* Fix typo in test from r264210, sigh.Nico Weber2016-03-231-2/+2
| | | | | | | (The test passes both with and without this change, but it's confusing without it.) llvm-svn: 264211
* clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.Nico Weber2016-03-231-10/+13
| | | | | | | | | | | Remove tests that have neither a triple nor an explicit -fmsc-version flag, since in the absence of an -fmsc-version flag, the implicit value of the flag is 17 (MSVC2013) with MSVC triples but 0 (not set) for other triples, and the default triple is platform dependent. This relands r263974 with a test fix. llvm-svn: 264210
* Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag ↵NAKAMURA Takumi2016-03-211-13/+8
| | | | | | | | formatting." It seems the test wouldn't expect if default target is *-win32. llvm-svn: 264007
* clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.Nico Weber2016-03-211-8/+13
| | | | llvm-svn: 263974
* Update test case for llvm summary format changes in D17592.Teresa Johnson2016-03-111-4/+4
| | | | llvm-svn: 263276
* Speculative fix for this test case (the test doesn't run on my typical build ↵Aaron Ballman2016-03-091-1/+1
| | | | | | environment). llvm-svn: 263034
* Misc: add a test for TargetParser usageSaleem Abdulrasool2016-03-051-0/+2
| | | | | | | | | Ensure that an invalid value passed to target parser does not cause an assertion in +Asserts builds. Supporting test for PR26839. llvm-svn: 262780
* Don't crash w/ a diagnostic range containing a null byteDavid Majnemer2016-02-171-0/+0
| | | | | | | | We prematurely ended the line at the null byte which caused us to crash down stream because we tried to reason about columns beyond the end of the line. llvm-svn: 261171
* Fix the ASTPrinter output for ascii char literals >127.Steven Watanabe2016-02-131-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D17206 llvm-svn: 260795
* Add backend dignostic printer for unsupported featuresOliver Stannard2016-02-021-2/+2
| | | | | | | | | | | | | | Re-commit of r258950 after fixing layering violation. The related LLVM patch adds a backend diagnostic type for reporting unsupported features, this adds a printer for them to clang. In the case where debug location information is not available, I've changed the printer to report the location as the first line of the function, rather than the closing brace, as the latter does not give the user any information. This also affects optimisation remarks. llvm-svn: 259499
* Template Type Diffing changeRichard Trieu2016-02-023-35/+25
| | | | | | | When all the arguments of a template are elided, print "A<...>" instead of "A<[2 * ...]>". Also remove comment fragment that means nothing. llvm-svn: 259445
* Revert r259036, it introduces a cyclic library dependencyOliver Stannard2016-01-281-2/+2
| | | | llvm-svn: 259043
* Add backend dignostic printer for unsupported featuresOliver Stannard2016-01-281-2/+2
| | | | | | | | | | | | | | | | | | Re-commit of r258950 after fixing layering violation. Add backend dignostic printer for unsupported features The related LLVM patch adds a backend diagnostic type for reporting unsupported features, this adds a printer for them to clang. In the case where debug location information is not available, I've changed the printer to report the location as the first line of the function, rather than the closing brace, as the latter does not give the user any information. This also affects optimisation remarks. Differential Revision: http://reviews.llvm.org/D16591 llvm-svn: 259036
* Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported ↵NAKAMURA Takumi2016-01-281-2/+2
| | | | | | | | | | | features" It broke layering violation in LLVMIR. clang r258950 "Add backend dignostic printer for unsupported features" llvm r258951 "Refactor backend diagnostics for unsupported features" llvm-svn: 259016
* Add backend dignostic printer for unsupported featuresOliver Stannard2016-01-271-2/+2
| | | | | | | | | | | | | | The related LLVM patch adds a backend diagnostic type for reporting unsupported features, this adds a printer for them to clang. In the case where debug location information is not available, I've changed the printer to report the location as the first line of the function, rather than the closing brace, as the latter does not give the user any information. This also affects optimisation remarks. Differential Revision: http://reviews.llvm.org/D16591 llvm-svn: 258950
* [MSVC Compat] Only warn for unknown clang-cl argumentsEhsan Akhgari2016-01-251-2/+2
| | | | | | | | | | | | | | | | | Summary: MSVC's driver accepts all unknown arguments but warns about them. clang by default rejects all unknown arguments. This causes issues specifically with build systems such as autoconf which liberally pass things such as $LDFLAGS to the compiler and expect everything to work. This patch teaches clang-cl to ignore unknown driver arguments. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16511 llvm-svn: 258720
* Fixing more issues with template type diffingRichard Trieu2016-01-151-0/+56
| | | | | | | | | | | | 1) Print qualifiers for templates with zero arguments 2) Add a few more tests for the template type diffing refactoring. Specifically, PR24587 has been fixed and has a test case from http://reviews.llvm.org/D15384 3) Adds asserts to check the DiffTree is in correct state when moving nodes 4) Rename the field FromType and ToType since it is heavily used within member functions. llvm-svn: 257870
* Add new diff modes to template type diffing.Richard Trieu2016-01-152-2/+103
| | | | | | | | Remove an old assertion that does not hold. It is possible for a template argument to be a declaration in one instantiation and an integer in another. Create two new diff kinds for these (decl vs int and int vs decl). llvm-svn: 257869
* Save the integer type for integral template arguments.Richard Trieu2016-01-151-1/+15
| | | | | | | | | Save the integer type when diffing integers in template type diffing. When integers are different sizes, print out the type along with the integer value. Also with the type information, print true and false instead of 1 and 0 for boolean values. llvm-svn: 257861
* Make template type diffing use the new desguared iterator.Richard Trieu2016-01-151-4/+4
| | | | | | | | | | | | | If available, use the canonical template argument to fill in information for template type diffing instead of attempting to special case and evaluate Expr's for the value. Since those are the values used in template instantiation, we don't have to worry about difference between our evaluator and theirs. Also move the nullptr template arguments from DiffKind::Expression to DiffKind::Declaration and allow DiffKind::Declaration to set an Expr. The only effect that should result is that a named nullptr will show up as 'ptr aka nullptr' in diagnostics. llvm-svn: 257853
* Refactor template type diffingRichard Trieu2016-01-141-1/+1
| | | | | | | | | | | | | | | 1) Instead of using pairs of From/To* fields, combine fields into a struct TemplateArgInfo and have two in each DiffNode. 2) Use default initialization in DiffNode so that the constructor shows the only field that is initialized differently on construction. 3) Use Set and Get functions per each DiffKind to make sure all fields for the diff is set. In one case, the Expr fields were not set. 4) Don't print boolean literals for boolean template arguments. This prevents printing 'false aka 0' Only #3 has a functional change, which is reflected in the test change. llvm-svn: 257831
* Improve AST dumping:Richard Smith2016-01-121-3/+18
| | | | | | | | 1) When dumping a declaration that declares a name for a type, also dump the named type. 2) Add a #pragma clang __debug dump X, that dumps the lookup results for X in the current context. llvm-svn: 257529
* Properly track that a character literal is UTF-8, and pretty print the ↵Aaron Ballman2016-01-071-0/+24
| | | | | | prefix properly. llvm-svn: 257097
* [diagnostics] Avoid crashes while printing macro backtracesReid Kleckner2015-12-081-0/+26
| | | | | | | | | | | | | | | | | | | When attempting to map a source into a given level of macro expansion, this code was ignoring the possibility that the start and end of the range might take wildly different paths through the tree of macro expansions. It was assuming that the begin spelling location would always precede the end spelling location, which is false. A macro can easily transpose its arguments. This also fixes a related issue where there are extra macro arguments between the begin location and the end location. In this situation, we now highlight the entire macro invocation. Pair programmed with Richard Smith. Fixes PR12818. llvm-svn: 254981
* Do not crash when dumping the objc_bridge_related attribute when its ↵Aaron Ballman2015-11-301-0/+4
| | | | | | | | optional arguments are not supplied. Patch thanks to Joe Ranieri! llvm-svn: 254303
* Use %select to merge similar diagnostics. NFCCraig Topper2015-11-142-4/+3
| | | | llvm-svn: 253119
* Recommit "Clang support for -flto=thin."Teresa Johnson2015-10-151-0/+9
| | | | | | | | | This recommits r250398 with fixes to the tests for bot failures. Add "-target x86_64-unknown-linux" to the clang invocations that check for the gold plugin. llvm-svn: 250455
* Revert "Clang support for -flto=thin." (bot failures)Teresa Johnson2015-10-151-9/+0
| | | | | | | | | | | Rolling this back for now since there are a couple of bot failures on the new tests I added, and I won't have a chance to look at them in detail until later this afternoon. I think the new tests need some restrictions on having the gold plugin available. This reverts commit r250398. llvm-svn: 250402
* Clang support for -flto=thin.Teresa Johnson2015-10-151-0/+9
| | | | | | | | | | | | | | | | | | | Summary: Add clang support for -flto=thin option, which is used to set the EmitFunctionSummary code gen option on compiles. Add -flto=full as an alias to the existing -flto. Add tests to check for proper overriding of -flto variants on the command line, and convert grep tests to FileCheck. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D11908 llvm-svn: 250398
* Add warning flags for #include_next and some nearby warnings.Richard Smith2015-10-121-6/+2
| | | | llvm-svn: 250105
* [ATTR] Automatic line feed after pragma-like attribute.Alexey Bataev2015-10-121-0/+9
| | | | | | | Automatically insert line feed after pretty printing of all pragma-like attributes + fix printing of pragma-like pragmas on declarations. Differential Revision: http://reviews.llvm.org/D13546 llvm-svn: 250017
* Keep the IfStmt node even if the condition is invalidOlivier Goffart2015-10-111-0/+23
| | | | | | | This is important to keep the information in IDE or other tools even if the code contains a few errors llvm-svn: 249982
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-1/+1
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* Promote a warning on ill-formed code (redeclaration missing an exceptionRichard Smith2015-09-301-2/+1
| | | | | | | | | | | | | | | | | specification) to an error. No compiler other than Clang seems to allow this, and it doesn't seem like a useful thing to accept as an extension in general. The current behavior was added for PR5957, where the problem was specifically related to mismatches of the exception specification on the implicitly-declared global operator new and delete. To retain that workaround, we downgrade the error to an ExtWarn when the declaration is of a replaceable global allocation function. Now that this is an error, stop trying (and failing) to recover from a missing computed noexcept specification. That recovery didn't work, and led to crashes in code like the added testcase. llvm-svn: 248867
* Improve the printing of ranges when macros are involved.Richard Trieu2015-09-244-64/+73
| | | | | | | | | | | | Trace the ranges through the macro backtrace better. This allows better range highlighting through all levels of the macro bracktrace. Also some improvements to backtrace printer for omitting different backtraces. Patch by Zhengkai Wu. Differential Revision: http://reviews.llvm.org/D12379 llvm-svn: 248454
* C11 _Bool bitfield diagnosticRachel Craik2015-09-141-3/+1
| | | | | | | | | | | | Summary: Implement DR262 (for C). This patch will mainly affect bitfields of type _Bool Reviewers: fraggamuffin, rsmith Subscribers: hubert.reinterpretcast, cfe-commits Differential Revision: http://reviews.llvm.org/D10018 llvm-svn: 247618
* Put ext_implicit_lib_function_decl in ImplicitFunctionDeclare.Ed Schouten2015-09-041-2/+1
| | | | | | | | | | | | | | If we build with -Werror=implicit-function-declaration, only implicit function declarations of non-library functions throw compiler errors. For library functions, we only produce a warning. There is no way to promote both of these cases to an error without promoting other warnings. It makes little sense to introduce an additional compiler flag just to control this specific warning. In my opinion it should just be part of the same group. llvm-svn: 246857
* Fix macro backtrace printing.Richard Trieu2015-08-271-0/+50
| | | | | | | | Sometimes, a macro that expands to another macro name will not be printed in the macro backtrace. This patch finds the missed macro expansions and prints them. Fixes PR16799 llvm-svn: 246237
* Stop printing macro backtraces that don't help diagnostics.Richard Trieu2015-08-123-6/+80
| | | | | | | | | | | | | | | When displaying the macro backtrace, ignore some of the backtraces that do not provide extra information to the diagnostic. Typically, if the problem is entirely contained within a macro argument, the macro expansion is often not needed. Also take into account SourceRange's attached to the diagnostic when selecting which backtraces to ignore. Two previous test cases have also been updated. Patch by Zhengkai Wu, with minor formatting fixes. Differential Revision: http://reviews.llvm.org/D11778 llvm-svn: 244788
* [Frontend] Fix crash when serializing diagnostics with really long text.Argyrios Kyrtzidis2015-08-061-0/+30
| | | | | | rdar://21896690 llvm-svn: 244245
* [modules] Add an assert for redeclarations that we never added to their redeclRichard Smith2015-07-271-1/+1
| | | | | | | | | | | | | | | chain and fix the cases where it fires. * Handle the __va_list_tag as a predefined decl. Previously we failed to merge sometimes it because it's not visible to name lookup. (In passing, remove redundant __va_list_tag typedefs that we were creating for some ABIs. These didn't affect the mangling or representation of the type.) * For Decls derived from Redeclarable that are not in fact redeclarable (implicit params, function params, ObjC type parameters), remove them from the list of expected redeclarable decls. llvm-svn: 243259
* Fix the cc1as crash when it outputs assemblySteven Wu2015-07-241-0/+3
| | | | | | | | In clang cc1as_main, when the output file type is “asm”, AsmStreamer owns a formatted_raw_ostream which has a reference to FDOS (raw_ostream), so AsmStreamer must be closed before FDOS is closed. llvm-svn: 243085
* PR10405 - Desugar FunctionType and TemplateSpecializationType if any type ↵Nikola Smiljanic2015-07-161-0/+17
| | | | | | that appears inside needs to be desugared. llvm-svn: 242371
* Erase REQUIRES: shell-preserves-root from remaining tests, see r242312.þYaron Keren2015-07-151-4/+0
| | | | llvm-svn: 242323
* Reenable Misc/interpreter.c as r239388 correctly handles such targetsDavid Majnemer2015-06-091-1/+1
| | | | llvm-svn: 239389
* Disable clang/test/Misc/interpreter.c, for now, since r239273 mishandled ↵NAKAMURA Takumi2015-06-091-1/+1
| | | | | | *-msvc-elf. llvm-svn: 239387
OpenPOWER on IntegriCloud