40 lines · plain
1# This test validates that statistics generation does not force loading2# symbol tables. In order to avoid other sources of symbol loading we3# create the target without loading dependents and do not actually4# run it. Running the target is a problem because there are various5# instrumentation plugins (e.g. ASAN) that are always enabled and force6# symbol loading. If you see this test start to fail we may have added7# a new source of symbol loading unexpectedly.8 9# Build a simple test executable.10# RUN: %clang_host -g %S/Inputs/main.c -o %t-main.exe11 12# When we enable symbol preload and dump stats there should be a non-zero13# time for parsing symbol tables for the main module.14# RUN: %lldb -O "settings set plugin.jit-loader.gdb.enable off" \15# RUN: -O "settings set target.preload-symbols true" \16# RUN: -o 'target create --no-dependents "%t-main.exe"' \17# RUN: -o "statistics dump" \18# RUN: -o "q" \19# RUN: | FileCheck %s -check-prefixes=CHECK,PRELOAD_TRUE20 21# Find the module stats for the main executable and make sure22# we are looking at the symbol parse time for that module.23# CHECK: "modules": [24# CHECK: {25# CHECK: "path": {{.*}}-main.exe26 27# PRELOAD_TRUE: "symbolTableParseTime":28# PRELOAD_TRUE-SAME: {{[1-9]+}}29 30# When we disable symbol preload and dump stats the symbol table31# for main should not be parsed and have a time of 0.32# RUN: %lldb -O "settings set plugin.jit-loader.gdb.enable off" \33# RUN: -O "settings set target.preload-symbols false" \34# RUN: -o 'target create --no-dependents "%t-main.exe"' \35# RUN: -o "statistics dump" \36# RUN: -o "q" \37# RUN: | FileCheck %s -check-prefixes=CHECK,PRELOAD_FALSE38 39# PRELOAD_FALSE: "symbolTableParseTime": 0,40