From: James Henderson Date: Tue, 12 Mar 2019 15:42:38 +0000 (+0000) Subject: [llvm-cxxfilt]Add test to show that empty lines can be handled X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3b95a8046bb82cf8fe95ae2b4e2e07bc877c9fc;p=llvm [llvm-cxxfilt]Add test to show that empty lines can be handled I recently discovered a bug in llvm-cxxfilt introduced in r353743 but was fixed later incidentally due to r355031. Specifically, llvm-cxxfilt was attempting to call .back() on an empty string any time there was a new line in the input. This was causing a crash in my debug builds only. This patch simply adds a test that explicitly tests that llvm-cxxfilt handles empty lines correctly. It may pass under release builds under the broken behaviour, but it fails at least in debug builds. Reviewed by: mattd Differential Revision: https://reviews.llvm.org/D58785 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355929 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/llvm-cxxfilt/empty-line.test b/test/tools/llvm-cxxfilt/empty-line.test new file mode 100644 index 00000000000..1b62ee0812f --- /dev/null +++ b/test/tools/llvm-cxxfilt/empty-line.test @@ -0,0 +1,9 @@ +# Show that llvm-cxxfilt can handle empty lines in the input. +RUN: echo "" > %t +RUN: echo "_Z3foov" >> %t +RUN: echo "" >> %t +RUN: llvm-cxxfilt < %t | FileCheck %s + +CHECK: {{^$}} +CHECK-NEXT: foo() +CHECK-EMPTY: