78 lines · plain
1REQUIRES: system-windows, msvc2RUN: mkdir -p %t.dir3RUN: %build --compiler=clang-cl --mode=compile --arch=64 --nodefaultlib --output=%t.dir/VariablesTest.cpp.obj %S/Inputs/VariablesTest.cpp4RUN: %build --compiler=msvc --mode=link --arch=64 --nodefaultlib --output=%t.dir/VariablesTest.cpp.exe %t.dir/VariablesTest.cpp.obj5# Note: The native plugin creates a location list for variables that's only valid for the function.6# The DIA plugin creates a location expression that's always valid. This causes DIA to output7# one line per variable where the native plugin would output two (the second would contain the8# location information). This removes the second line from the output of the native plugin.9# It's done in both cases, because LLDB might not be compiled with the DIA SDK in which case10# the native plugin is always used.11RUN: env LLDB_USE_NATIVE_PDB_READER=0 lldb-test symbols %t.dir/VariablesTest.cpp.exe | sed '/^ \+\[0x/d' > %t.dir/VariablesTest.DIA.out12RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb-test symbols %t.dir/VariablesTest.cpp.exe | sed '/^ \+\[0x/d' > %t.dir/VariablesTest.Native.out13RUN: FileCheck --check-prefix=GLOBALS --input-file=%t.dir/VariablesTest.DIA.out %s14RUN: FileCheck --check-prefix=GLOBALS --input-file=%t.dir/VariablesTest.Native.out %s15RUN: FileCheck --check-prefix=FUNC-F --input-file=%t.dir/VariablesTest.DIA.out %s16RUN: FileCheck --check-prefix=FUNC-F --input-file=%t.dir/VariablesTest.Native.out %s17RUN: FileCheck --check-prefix=FUNC-MAIN --input-file=%t.dir/VariablesTest.DIA.out %s18RUN: FileCheck --check-prefix=FUNC-MAIN --input-file=%t.dir/VariablesTest.Native.out %s19RUN: FileCheck --check-prefix=FUNC-CONSTRUCTOR --input-file=%t.dir/VariablesTest.DIA.out %s20RUN: FileCheck --check-prefix=FUNC-CONSTRUCTOR --input-file=%t.dir/VariablesTest.Native.out %s21RUN: FileCheck --check-prefix=FUNC-MEMBER --input-file=%t.dir/VariablesTest.DIA.out %s22RUN: FileCheck --check-prefix=FUNC-MEMBER --input-file=%t.dir/VariablesTest.Native.out %s23 24GLOBALS: Module [[MOD:.*]]25GLOBALS: SymbolFile {{(native-)?}}pdb ([[MOD]])26GLOBALS: CompileUnit{{.*}}, language = "c++", file = '{{.*}}\VariablesTest.cpp'27GLOBALS-DAG: Variable{{.*}}, name = "g_IntVar"28GLOBALS-SAME: scope = global, location = {{.*}}, external29GLOBALS-DAG: Variable{{.*}}, name = "g_pConst"30GLOBALS-SAME: scope = global, location = {{.*}}, external31GLOBALS-DAG: Variable{{.*}}, name = "same_name_var"32GLOBALS-SAME: scope = global, location = {{.*}}, external33GLOBALS-DAG: Variable{{.*}}, name = "Class::m_StaticClassMember"34GLOBALS-SAME: scope = global, location = {{.*}}, external35GLOBALS-DAG: Variable{{.*}}, name = "g_EnumVar"36GLOBALS-SAME: scope = global, location = {{.*}}, external37GLOBALS-DAG: Variable{{.*}}, name = "g_tls"38GLOBALS-SAME: scope = thread local, location = {{.*}}, external39GLOBALS-DAG: Variable{{.*}}, name = "ClassVar"40GLOBALS-SAME: scope = global, location = {{.*}}, external41GLOBALS-DAG: Variable{{.*}}, name = "g_Const"42GLOBALS-SAME: scope = ??? (2)43GLOBALS: Function44 45FUNC-F: Function{{.*}}, mangled = ?f@@YAHHH@Z46FUNC-F-NEXT: Block47FUNC-F-NEXT: Variable{{.*}}, name = "var_arg1"48FUNC-F-SAME: scope = parameter49FUNC-F-NEXT: Variable{{.*}}, name = "var_arg2"50FUNC-F-SAME: scope = parameter51FUNC-F-NEXT: Variable{{.*}}, name = "same_name_var"52FUNC-F-SAME: scope = local53 54FUNC-MAIN: Function{{.*}}, {{(de)?}}mangled = main55FUNC-MAIN-NEXT: Block56FUNC-MAIN-NEXT: Variable{{.*}}, name = "same_name_var"57FUNC-MAIN-SAME: scope = local58FUNC-MAIN-NEXT: Variable{{.*}}, name = "local_const"59FUNC-MAIN-SAME: scope = local60FUNC-MAIN-NEXT: Variable{{.*}}, name = "local_CString"61FUNC-MAIN-SAME: scope = local62FUNC-MAIN-NEXT: Variable{{.*}}, name = "local_pCString"63FUNC-MAIN-SAME: scope = local64FUNC-MAIN-NEXT: Variable{{.*}}, name = "a"65FUNC-MAIN-SAME: scope = local66 67FUNC-CONSTRUCTOR: Function{{.*}}, {{mangled = \?\?0Class@@QEAA@H@Z|demangled = .*Class::Class}}68FUNC-CONSTRUCTOR-NEXT: Block69FUNC-CONSTRUCTOR-NEXT: Variable{{.*}}, name = "this"70FUNC-CONSTRUCTOR-SAME: scope = parameter71FUNC-CONSTRUCTOR-NEXT: Variable{{.*}}, name = "a"72FUNC-CONSTRUCTOR-SAME: scope = parameter73 74FUNC-MEMBER: Function{{.*}}, {{mangled = \?Func@Class@@QEAAXXZ|demangled = .*Class::Func}}75FUNC-MEMBER-NEXT: Block76FUNC-MEMBER-NEXT: Variable{{.*}}, name = "this"77FUNC-MEMBER-SAME: scope = parameter78