[PATCH] D47653: [lit, pdb] Fix two failing PDB tests on Windows

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 10:10:27 PDT 2018


zturner added a comment.

In https://reviews.llvm.org/D47653#1121175, @stella.stamenova wrote:

> These two sections switch order between builds. It looks like the CHECK command checks in order, so the two CHECKs will fail based on the order in which the symbols are produced in the output. I could make them both CHECK-DAG, but I assume they are CHECK on purpose.
>
>   CHECK: {{.*}}:   CompileUnit{{.*}}, language = "c++", file = '{{.*}}\FuncSymbols.cpp'
>   CHECK-DAG: Function{[[UID30]]}, mangled = ?FunctionCall@@YAXXZ, demangled = {{.*}}, type = [[TY30]]
>   CHECK-DAG: Function{[[UID31]]}, demangled = {{.*}}`anonymous namespace'::StaticFunction{{.*}}, type = [[TY31]]
>   CHECK-DAG: Function{[[UID32]]}, demangled = {{.*}}InlinedFunction{{.*}}, type = [[TY32]]
>  
>   CHECK: {{.*}}:   CompileUnit{{.*}}, language = "c++", file = '{{.*}}\FuncSymbolsTestMain.cpp'
>   CHECK-DAG: Function{[[UID0]]}, mangled = ?Func_arg_array@@YAHQAH at Z, demangled = {{.*}}, type = [[TY0]]
>   CHECK-DAG: Function{[[UID1]]}, mangled = ?Func_arg_void@@YAXXZ, demangled = {{.*}}, type = [[TY1]]
>   CHECK-DAG: Function{[[UID2]]}, mangled = ?Func_arg_none@@YAXXZ, demangled = {{.*}}, type = [[TY2]]
>


Yea all adjacent `CHECK-DAG`s form a single group, and items in a group can appear in any order.  So if those were made dag, then the symbols could show up with the wrong source file and it would pass.

The way to fix this is to run FileCheck multiple times, and make a different check label for each file.  E.g.

  RUN: lldb-test symbols %T/FuncSymbolsTest.exe | FileCheck --check-label=CHECK-ONE %s
  RUN: lldb-test symbols %T/FuncSymbolsTest.exe | FileCheck --check-label=CHECK-TWO %s
  
  CHECK-ONE: {{.*}}:   CompileUnit{{.*}}, language = "c++", file = '{{.*}}\FuncSymbols.cpp'
  CHECK-ONE-DAG: Function{[[UID30]]}, mangled = ?FunctionCall@@YAXXZ, demangled = {{.*}}, type = [[TY30]]
  CHECK-ONE-DAG: Function{[[UID31]]}, demangled = {{.*}}`anonymous namespace'::StaticFunction{{.*}}, type = [[TY31]]
  CHECK-ONE-DAG: Function{[[UID32]]}, demangled = {{.*}}InlinedFunction{{.*}}, type = [[TY32]]
  
  CHECK-TWO: {{.*}}:   CompileUnit{{.*}}, language = "c++", file = '{{.*}}\FuncSymbolsTestMain.cpp'
  CHECK-TWO-DAG: Function{[[UID0]]}, mangled = ?Func_arg_array@@YAHQAH at Z, demangled = {{.*}}, type = [[TY0]]
  CHECK-TWO-DAG: Function{[[UID1]]}, mangled = ?Func_arg_void@@YAXXZ, demangled = {{.*}}, type = [[TY1]]
  CHECK-TWO-DAG: Function{[[UID2]]}, mangled = ?Func_arg_none@@YAXXZ, demangled = {{.*}}, type = [[TY2]]


Repository:
  rL LLVM

https://reviews.llvm.org/D47653





More information about the llvm-commits mailing list