diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-10-16 07:20:28 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-10-16 07:20:28 +0000 |
commit | dc2f257680ddcd0d36c1d1068a4936a62ec226b7 (patch) | |
tree | 59b9c6b245fb4bc515632a8e11ba3dce6328d3c1 /clang/test/Misc/macro-backtrace.c | |
parent | 5371981593d69c169765d57345ad094ba3b6324e (diff) | |
download | llvm-dc2f257680ddcd0d36c1d1068a4936a62ec226b7.zip llvm-dc2f257680ddcd0d36c1d1068a4936a62ec226b7.tar.gz llvm-dc2f257680ddcd0d36c1d1068a4936a62ec226b7.tar.bz2 |
Now that the structure of this is more reasonably laid out, fix a long
standing deficiency: we were providing no macro backtrace information
whenever caret diagnostics were turned off. This sinks the logic for
suppressing the code snippet and caret to the code that actually prints
tho code snippet and caret. Along the way, clean up the naming of
functions, remove some now fixed FIXMEs, and generally improve the
wording and logic of this process.
Add a test case exerecising this functionality. It is notable that the
resulting messages are extremely low quality. I'm working on a follow-up
patch that should address this and have left a FIXME in the test case.
llvm-svn: 142120
Diffstat (limited to 'clang/test/Misc/macro-backtrace.c')
-rw-r--r-- | clang/test/Misc/macro-backtrace.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Misc/macro-backtrace.c b/clang/test/Misc/macro-backtrace.c index 819ec93..a76d4d2 100644 --- a/clang/test/Misc/macro-backtrace.c +++ b/clang/test/Misc/macro-backtrace.c @@ -31,4 +31,17 @@ void f(int *ip, float *fp) { // CHECK-LIMIT: #define M2(A, B) M1(A, B) // CHECK-LIMIT: macro-backtrace.c:4:23: note: expanded from: // CHECK-LIMIT: #define M1(A, B) ((A) < (B)) + + // FIXME: We should have higher quality messages, especially when caret + // diagnostics are off. + // RUN: %clang_cc1 -fsyntax-only -fno-caret-diagnostics %s 2>&1 \ + // RUN: | FileCheck %s -check-prefix=CHECK-NO-CARETS + // CHECK-NO-CARETS: macro-backtrace.c:18:7: warning: comparison of distinct pointer types ('int *' and 'float *') + // CHECK-NO-CARETS-NEXT: macro-backtrace.c:15:19: note: expanded from: + // CHECK-NO-CARETS-NEXT: macro-backtrace.c:14:19: note: expanded from: + // CHECK-NO-CARETS-NEXT: macro-backtrace.c:13:19: note: expanded from: + // CHECK-NO-CARETS-NEXT: note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) + // CHECK-NO-CARETS-NEXT: macro-backtrace.c:6:18: note: expanded from: + // CHECK-NO-CARETS-NEXT: macro-backtrace.c:5:18: note: expanded from: + // CHECK-NO-CARETS-NEXT: macro-backtrace.c:4:23: note: expanded from: } |