[cfe-commits] [PATCH] test/Coverage/html-diagnostics.c: a potential bug and mingw-msys tweak

NAKAMURA Takumi geek4civic at gmail.com
Sun Oct 17 21:26:01 PDT 2010

Good afternoon.

There are two issues for html-diagnostics.c.

* A potential bug: "CHECK: Dereference of null pointer" always succeeds.

  This expression always hits to the output itself in the comment.

<tr><td class="num" id="LN9">9</td><td class="line"><span
class='comment'>// CHECK: Dereference of null pointer</span></td></tr>

* MSYS's cat(1) does not glob wildcards.

  find(1) could do alternatively. Toolchain gnuwin32 has find.exe, too.

-------------- next part --------------
diff --git a/test/Coverage/html-diagnostics.c b/test/Coverage/html-diagnostics.c
index 81b2cfa..f9c4b54 100644
--- a/test/Coverage/html-diagnostics.c
+++ b/test/Coverage/html-diagnostics.c
@@ -1,9 +1,12 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-check-objc-mem -o %t %s
-// RUN: cat %t/*.html | FileCheck %s
+// RUN: find %t -type f -name '*.html' -exec cat '{}' ';' | FileCheck %s
 // CHECK: <h3>Annotated Source Code</h3>
-// CHECK: Dereference of null pointer
+// Without tweaking expr, the expr would hit to the line below
+// emitted to the output as comment.
+// CHECK: {{[D]ereference of null pointer}}
 void f0(int x) {
   int *p = &x;

More information about the cfe-commits mailing list