[llvm] r355929 - [llvm-cxxfilt]Add test to show that empty lines can be handled

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 08:42:38 PDT 2019


Author: jhenderson
Date: Tue Mar 12 08:42:38 2019
New Revision: 355929

URL: http://llvm.org/viewvc/llvm-project?rev=355929&view=rev
Log:
[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

Added:
    llvm/trunk/test/tools/llvm-cxxfilt/empty-line.test

Added: llvm/trunk/test/tools/llvm-cxxfilt/empty-line.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxfilt/empty-line.test?rev=355929&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-cxxfilt/empty-line.test (added)
+++ llvm/trunk/test/tools/llvm-cxxfilt/empty-line.test Tue Mar 12 08:42:38 2019
@@ -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:




More information about the llvm-commits mailing list