[Lldb-commits] [PATCH] D52270: TestMultilineExpr: validate evaluation for expressions spread over multiple lines

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 19 11:40:18 PDT 2018


sgraenitz added a comment.

In https://reviews.llvm.org/D52270#1239641, @teemperor wrote:

> Can't you just check for '5', as this is the only information we actually actually care about here?


Yes that would be the simplest way, but as LLDB still echoes all commands including comments, all CHECK lines are self-fulfilling prophecies.
This is what FileCheck will see in this case:

  (lldb) command source -s 0 '/Users/sgranitz/Develop/lldb-llvm/git-svn/llvm/tools/lldb/lit/lit-lldb-init'
  Executing commands in '/Users/sgranitz/Develop/lldb-llvm/git-svn/llvm/tools/lldb/lit/lit-lldb-init'.
  (lldb) # LLDB init file for the LIT tests.
  (lldb) settings set symbols.enable-external-lookup false
  (lldb) command source -s 0 '/Users/sgranitz/Develop/lldb-llvm/git-svn/llvm/tools/lldb/lit/Expr/TestMultilineExpr.test'
  Executing commands in '/Users/sgranitz/Develop/lldb-llvm/git-svn/llvm/tools/lldb/lit/Expr/TestMultilineExpr.test'.
  (lldb) # RUN: %lldb -b -s %s | FileCheck %s
  (lldb) # In terminal sessions LLDB hides input from subsequent lines so it's not visible in the output we check below.
  (lldb) expression
  Enter expressions, then terminate with an empty line to evaluate:
  (int) $0 = 5
  (lldb) # CHECK: (lldb) expression
  (lldb) # CHECK-NEXT: Enter expressions, then terminate with an empty line to evaluate:
  (lldb) # CHECK-NEXT: (int) {{.*}} = 5


https://reviews.llvm.org/D52270





More information about the lldb-commits mailing list