summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/message-length.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug in caret-line-pruning logic that only happens when we have aDouglas Gregor2010-04-161-3/+13
| | | | | | | | source line wider than the terminal where the associated fix-it line is longer than the caret line. Previously, we would crash in this case, which was rather unfortunate. Fixes <rdar://problem/7856226>. llvm-svn: 101426
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-2/+2
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Switch this test to use clang-cc.Daniel Dunbar2009-12-081-2/+2
| | | | llvm-svn: 90875
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-1/+1
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Tweak test, with -strict-whitespace $ won't match on Windows because the bufferDaniel Dunbar2009-10-251-1/+1
| | | | | | | | will have \r\n. - Perhaps we should make FileCheck normalize line-endings, even in strict-whitespace mode? llvm-svn: 85066
* Workaround a bug exposed by the FileCheckify of message-length.c, the caret endDaniel Dunbar2009-10-191-2/+2
| | | | | | | | | column computation isn't correct and could exceed the line length, which resulted in a buffer overflow later. - Chris, is there a better way for this code to compute the final column used by the caret? llvm-svn: 84475
* convert this to FileCheck, PR5232Chris Lattner2009-10-191-9/+6
| | | | llvm-svn: 84466
* When word-wrapping, be more defensive about a ridiculously small number of ↵Douglas Gregor2009-05-151-1/+1
| | | | | | columns. Fixes <rdar://problem/6892178> llvm-svn: 71870
* Update test case... the location given for this error makes it lookDaniel Dunbar2009-05-041-2/+2
| | | | | | rather odd when truncated. llvm-svn: 70866
* Fix an infinite loop in diagnostic printing.Daniel Dunbar2009-05-031-1/+14
| | | | | | | | | | - The diagnostic is still poor, however. Doug, can you investigate? - Improved the test case to not depend on the file name, now it can be extended to actually check the formatting of the diagnostics (I'm hoping grep -A is portable here). llvm-svn: 70807
* When printing a source line as part of a diagnostic, the source lineDouglas Gregor2009-05-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | might be wider than we're supposed to print. In this case, we try to select the "important" subregion of the source line, which contains everything that we want to show (e.g., with underlining and the caret itself) and tries to also contain some of the context. From the fantastically long line in the test case, we get an error message that slices down to this: message-length.c:18:120: warning: comparison of distinct pointer types ('int *' and 'float *') a_func_to_call(ip == FloatPointer, ip[ALongIndexName], ~~ ^ ~~~~~~~~~~~~ There are a bunch of gee-it-sounds-good heuristics in here, which seem to do well on the various simple tests I've thrown at it. However, we're going to need to look at a bunch more diagnostics to tweak these heuristics. This is the second part of <rdar://problem/6711348>. Almost there! llvm-svn: 70597
* Implement -fmessage-length=N, which word-wraps diagnostics to N columns. Douglas Gregor2009-05-011-0/+13
Also, put a line of whitespace between the diagnostic and the source code/caret line when the start of the actual source code text lines up (or nearly lines up) with the most recent line of the diagnostic. For example, here it's okay for the last line of the diagnostic to be (vertically) next to the source line, because there is horizontal whitespace to separate them: decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin type can only take one argument typeof(int)(a,5)<<a; However, here is a case where we need the vertical separation (since there is no horizontal separation): message-length.c:10:46: warning: incompatible pointer types initializing 'void (int, float, char, float)', expected 'int (*)(int, float, short, float)' int (*fp1)(int, float, short, float) = f; This is part one of <rdar://problem/6711348>. llvm-svn: 70578
OpenPOWER on IntegriCloud