<p>Hi Kaelyn,</p>
<div>The test cfe/trunk/test/PCH/badpch.c fails on builder<br><a href="http://lab.llvm.org:8011/builders/clang-X86_64-freebsd/builds/3155">http://lab.llvm.org:8011/builders/clang-X86_64-freebsd/builds/3155</a></div>
<div>Please have a look at this?</div>
<p>Thanks</p>
<p>Galina<br><br></p>
<div class="gmail_quote">On Tue, Jun 19, 2012 at 5:36 PM, Kaelyn Uhrain <span dir="ltr"><<a href="mailto:rikka@google.com" target="_blank">rikka@google.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">Author: rikka<br>Date: Tue Jun 19 19:36:03 2012<br>New Revision: 158772<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=158772&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=158772&view=rev</a><br>
Log:<br>Add the PCH file name to the message about not being able to read the PCH.<br><br>Also add a couple of unit tests to check the invalid-PCH error messages<br>to satisfy PR4568 and for the assertion (introduced in r149918 and fixed<br>
in r158769) that would cause clang to crash when given an empty PCH.<br><br>Added:<br>   cfe/trunk/test/PCH/badpch-dir.h.gch/<br>   cfe/trunk/test/PCH/badpch-dir.h.gch/.keep<br>   cfe/trunk/test/PCH/badpch-empty.h.gch<br>
   cfe/trunk/test/PCH/badpch.c<br>Modified:<br>   cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td<br>   cfe/trunk/lib/Serialization/ASTReader.cpp<br><br>Modified: cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td?rev=158772&r1=158771&r2=158772&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td?rev=158772&r1=158771&r2=158772&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td (original)<br>+++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Tue Jun 19 19:36:03 2012<br>
@@ -10,7 +10,7 @@<br> let Component = "Serialization" in {<br><br> def err_fe_unable_to_read_pch_file : Error<<br>-    "unable to read PCH file: '%0'">;<br>+    "unable to read PCH file %0: '%1'">;<br>
 def err_fe_not_a_pch_file : Error<<br>    "input is not a PCH file: '%0'">;<br> def err_fe_pch_malformed : Error<<br><br>Modified: cfe/trunk/lib/Serialization/ASTReader.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=158772&r1=158771&r2=158772&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=158772&r1=158771&r2=158772&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)<br>+++ cfe/trunk/lib/Serialization/ASTReader.cpp Tue Jun 19 19:36:03 2012<br>@@ -3001,7 +3001,7 @@<br>
  OwningPtr<llvm::MemoryBuffer> Buffer;<br>  Buffer.reset(FileMgr.getBufferForFile(ASTFileName, &ErrStr));<br>  if (!Buffer) {<br>-    Diags.Report(diag::err_fe_unable_to_read_pch_file) << ErrStr;<br>+    Diags.Report(diag::err_fe_unable_to_read_pch_file) << ASTFileName << ErrStr;<br>
    return std::string();<br>  }<br><br><br>Added: cfe/trunk/test/PCH/badpch-dir.h.gch/.keep<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/badpch-dir.h.gch/.keep?rev=158772&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/badpch-dir.h.gch/.keep?rev=158772&view=auto</a><br>
==============================================================================<br>   (empty)<br><br>Added: cfe/trunk/test/PCH/badpch-empty.h.gch<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/badpch-empty.h.gch?rev=158772&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/badpch-empty.h.gch?rev=158772&view=auto</a><br>
==============================================================================<br>   (empty)<br><br>Added: cfe/trunk/test/PCH/badpch.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/badpch.c?rev=158772&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/badpch.c?rev=158772&view=auto</a><br>
==============================================================================<br>--- cfe/trunk/test/PCH/badpch.c (added)<br>+++ cfe/trunk/test/PCH/badpch.c Tue Jun 19 19:36:03 2012<br>@@ -0,0 +1,13 @@<br>+// RUN: %clang_cc1 -fsyntax-only -include-pch %S/badpch-empty.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-EMPTY %s<br>
+// RUN: %clang_cc1 -fsyntax-only -include-pch %S/badpch-dir.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s<br>+<br>+// The purpose of this test is to verify that various invalid PCH files are<br>+// reported as such.<br>
+<br>+// PR4568: The messages were much improved since the bug was filed on<br>+// 2009-07-16, though in the case of the PCH being a directory, the error<br>+// message still did not contain the name of the PCH. Also, r149918 which was<br>
+// submitted on 2012-02-06 introduced a segfault in the case where the PCH is<br>+// an empty file and clang was built with assertions.<br>+// CHECK-EMPTY: error: input is not a PCH file: '{{.*[/\\]}}badpch-empty.h.gch'<br>
+// CHECK-DIR: error: unable to read PCH file {{.*[/\\]}}badpch-dir.h.gch:<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br></blockquote></div><br>