aboutsummaryrefslogtreecommitdiff
path: root/test/Misc
AgeCommit message (Collapse)Author
2013-04-26documenttion parsing. Provide a c-index testFariborz Jahanian
and limit comment extraction to public c++ bases. // rdar://13647476 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180646 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26document parsing. When a sub-class (c++ Objective-C) missing Fariborz Jahanian
a comment, grab the first comment found in its class heirarchy. Also, when a category is mossing a comment, grab comment of its primary class. // rdar://13647476 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180629 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.Andy Gibbs
VerifyDiagnosticConsumer previously would not check that the diagnostic and its matching directive referenced the same source file. Common practice was to create directives that referenced other files but only by line number, and this led to problems such as when the file containing the directive didn't have enough lines to match the location of the diagnostic in the other file, leading to bizarre file formatting and other oddities. This patch causes VerifyDiagnosticConsumer to match source files as well as line numbers. Therefore, a new syntax is made available for directives, for example: // expected-error@file:line {{diagnostic message}} This extends the @line feature where "file" is the file where the diagnostic is generated. The @line syntax is still available and uses the current file for the diagnostic. "file" can be specified either as a relative or absolute path - although the latter has less usefulness, I think! The #include search paths will be used to locate the file and if it is not found an error will be generated. The new check is not optional: if the directive is in a different file to the diagnostic, the file must be specified. Therefore, a number of test-cases have been updated with regard to this. This closes out PR15613. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179677 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15Add triple to another test.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179515 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith
the AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Do not assume the template argument is an integer only because theRichard Trieu
expressions are integer. It can also be ValueDecl expressions Use the type information from the TemplateParameterList instead Patch by Olivier Goffart! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178611 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Fix a crasher in Template Diffing.Richard Trieu
When support was added for declaration arguments, the case of variadic declaration arguments was not supported. This patch fixes that problem by not crashing when certain ValueDecl's are null. Patch by Olivier Goffart! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Fix a crasher in Template Diffing.Richard Trieu
Value depenedent expressions for default arguments cannot be evaluated. Instead, use the desugared template type to get an argument expression that can be used. This is needed for both integer and declaration arguements. Also, move this common code into a separate function. Patch by Olivier Goffart! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23Strip off local qualifiers when converting from RecordType toRichard Trieu
TemplateSpecializationType during template type diffing. This allows the correct printing of diffing qualifiers on templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22Fix DeclRefExpr::getFoundDecl() for usages by reference.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177721 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith
definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177335 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15Improve template diffing handling of default integer values.Richard Trieu
When the template argument is both default and value dependent, the expression retrieved for the default argument cannot be evaluated, thus never matching any argument value. To get the proper value, get the template argument from the desugared template specialization. Also, output the original expression to provide more information about the argument mismatch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177209 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14[PR15513/<rdar://problem/13409707>] Template arguments in diagnostics aren't ↵Douglas Gregor
always known at compile time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177110 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12Test for LLVM r176911Matt Beaumont-Gay
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176912 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06After issuing a diagnostic for undefining or redefining a builtin macro,Richard Smith
continue parsing the directive rather than silently discarding it. Allowing undef or redef of __TIME__ and __DATE__ is important to folks who want stable, reproducible builds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176540 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Update template diffing to handle template arguments that are declarations.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-24Add regression test for serialized diagnostics for notes without locations.Ted Kremenek
This meant to be included in r175802. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175986 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21AST dumping: dump template instantiations only onceDmitri Gribenko
Fixes infinite loop in PR15220. Patch by Philip Craig. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175805 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08StmtPrinter: Write large char values using \u or \U.Jordan Rose
This may not always be valid, but we were previously just emitting them raw. While here, s/isprint/isPrintable/ (using the new CharInfo). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07AST dumping: indicate the previous declaration for a redeclaration, andRichard Smith
indicate the semantic DC if it's not the lexical DC. In passing, correct the ascii-art child marker for a child of a FriendDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174570 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31When comparing two template template arguments in the template differ, considerRichard Trieu
them the same if they are actually the same; having the same name isn't enough. Similar to r174013, template template arguments were also mistakenly considered the same when they had the same name but were in different namespaces. In addition, when printing template template arguments, use the qualified name if the regular name is the same. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31Add indents to AST dumping and removed parenthesis from AST nodes.Richard Trieu
Indents were given the color blue when outputting with color. AST dumping now looks like this: Node |-Node | `-Node `-Node `-Node Compared to the previous: (Node (Node (Node)) (Node (Node))) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174022 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31When comparing two templates in the template differ, consider them theDouglas Gregor
same if they are actually the same; having the same name isn't enough. Fixes <rdar://problem/12931988>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174013 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30Diagnostics: if a line is longer than 4096 characters, don't print it.Jordan Rose
Specifically, don't print snippets, caret diagnostics, or ranges for lines over 4096 characters. We copy the line around a few times in our diagnostics machinery, and we have to print a caret line that's just as long. This uses a lot of memory just to create a poor user experience as we print out a line much too long for anyone to read...or spend extra energy trying to fit it to -fmessage-length. <rdar://problem/13106850> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30Handle passing non-Qualtypes to %diff better. Instead of asserting, fall backRichard Trieu
to printing the default case. This is a fix for PR15023. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173965 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26clang/test/Misc/diag-template-diffing-color.cpp: Symbolize color sequences ↵NAKAMURA Takumi
in FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173561 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26clang/test/Misc/ast-dump-color.cpp: Symbolize color sequences in FileCheck.NAKAMURA Takumi
FIXME: If FileCheck had expressions something predefined well-known... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173558 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26Fix test case by being more lenient on what to accept as a path name.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173553 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26Highlight various parts of the AST dump with color. Colors are controlled byRichard Trieu
-f(no-)color-diagnostics. In addition, dumpColor() function calls are added to force color printing. No structural changes to -ast-dump. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25Add missing InGroup for this warning.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173429 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24Give warn_redecl_library_builtin a flag name: ↵Nick Lewycky
-Wincompatible-library-redeclaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173319 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17Format strings: don't ever convert %+d to %lu.Jordan Rose
Presumably, if the printf format has the sign explicitly requested, the user wants to treat the data as signed. This is a fix-up for r172739, and also includes several test changes that didn't make it into that commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17Suppress all -Wunused-value warnings from macro body expansions.Matt Beaumont-Gay
This is inspired by a number of false positives in real code, including PR14968. I've added test cases reduced from these false positives to test/Sema/unused-expr.c, as well as corresponding test cases that pass the offending expressions as arguments to a no-op macro to ensure that we do warn there. This also removes my previous tweak from r166522/r166534, so that we warn on unused cast expressions in macro arguments. There were several test cases that were using -Wunused-value to test general diagnostic emission features; I changed those to use other warnings or warn on a macro argument expression. I stared at the test case for PR14399 for a while with Richard Smith and we believe the new test case exercises the same codepaths as before. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172696 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14Dump comments in -ast-dump.Alexander Kornienko
http://llvm-reviews.chandlerc.com/D269 "Added dumping of declaration comments in ASTDumper. This required moving the comment dumping code from CommentDumper so that the indentation is correct." Patch by Philip Craig! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172409 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07add a tripleRafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171808 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07Implement Attr dumping for -ast-dump.Alexander Kornienko
http://llvm-reviews.chandlerc.com/D234 Patch by Philip Craig! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171760 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-21Use a safe default width for template-diff'ing integral arguments, inDouglas Gregor
case we can't find an exact width to use. Fixes crash in <rdar://problem/12456626>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170951 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20clang/test/Misc/ast-dump-decl.c: Add triple. __thread is not supported on ↵NAKAMURA Takumi
all targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170645 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith
produce a note for that diagnostic either with a different DiagnosticEngine or after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the wrong thing if the original diagnostic was suppressed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170636 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20Implement AST dumper for Decls.Alexander Kornienko
http://llvm-reviews.chandlerc.com/D52 Patch by Philip Craig! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18Fix a crash in diagnostic printing when a template class type is diff'edEli Friedman
against itself. PR14489. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170474 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18test/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).NAKAMURA Takumi
I don't want to suppress this to be excluded with the feature "dev-fd-fs". This should work also on freebsd. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170411 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18More conservative fix for <rdar://problem/12847524> (a crash printing ↵Eli Friedman
diagnostic ranges). I'm not really happy with this fix, but I'm confident it's correct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170397 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13Revert 170049 because it fails with an assertion on one of the spec2000 ↵Nadav Rotem
workloads. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170143 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13Initial support for FreeBSD on ARM.Rafael Espindola
Patch by Andrew Turner. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13More hacking on mapDiagnosticRanges to make it handle more cases.Eli Friedman
This still isn't quite right, but it fixes a crash. I factored out findCommonParent because we need it on the result of getImmediateExpansionRange: for a function macro, the beginning and end of an expansion range can come out of different macros/macro arguments, which means the resulting range is a complete mess to handle consistently. I also made some changes to how findCommonParent works; it works somewhat better in some cases, and somewhat worse in others, but I think overall it's a better balance. I'm coming to the conclusion that mapDiagnosticRanges isn't using the right algorithm, though: chasing the caret is fundamentally more complicated than any algorithm which only considers one FileID for the caret can handle because each SourceLocation doesn't really have a single parent. We need to follow the same path of choosing expansion locations and spelling locations which the caret used to come up with the correct range in the general case. Fixes <rdar://problem/12847524>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170049 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05More workarounds for PR10867.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to beRichard Smith
the LHS of a token paste. Use "expanded from here" instead when we're not sure it's actually a macro. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169373 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01Try to make the source location information for token pastes a bit more ↵Eli Friedman
consistent. Fixes a crash printing diagnostics on the gcc testsuite, and also makes diagnostic range printing print nicer results for token pastes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169068 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30Fix the computation of highlight ranges so we produce something sane whenEli Friedman
the beginning and end of the range are in different macro arguments. PR14399. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168984 91177308-0d34-0410-b5e6-96231b3b80d8