From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Coverage/html-diagnostics.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 clang/test/Coverage/html-diagnostics.c (limited to 'clang/test/Coverage/html-diagnostics.c') diff --git a/clang/test/Coverage/html-diagnostics.c b/clang/test/Coverage/html-diagnostics.c new file mode 100644 index 0000000..4f1b0e3 --- /dev/null +++ b/clang/test/Coverage/html-diagnostics.c @@ -0,0 +1,22 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s +// RUN: cat %t/*.html | FileCheck %s + +// CHECK:

Annotated Source Code

+ +// 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; + + if (x > 10) { + if (x == 22) + p = 0; + } + + *p = 10; +} + + -- cgit v1.2.3