brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · a5eb4d6 Raw
63 lines · plain
1# XFAIL: target-windows2# XFAIL: system-linux3# XFAIL: system-windows && remote-linux4 5# Test that we can successfully locate decls in Clang modules for C++.6 7# RUN: split-file %s %t8# RUN: %clang_host -g -gdwarf %t/main.cpp -fmodules -fcxx-modules -o %t.out9# RUN: %lldb -o "settings set interpreter.stop-command-source-on-error false" \10# RUN:       -x -b -s %t/commands.input %t.out 2>&1 \11# RUN:       | FileCheck %s12 13#--- main.cpp14 15#include "Module.h"16 17int main() {18  foo(10);19  return 0;20}21 22#--- module.modulemap23 24module Module {25  header "Module.h"26  export *27}28 29#--- Module.h30 31// We use nodebug here ensures that LLDB tries to pick the decl out of the module.32// If debug-info is available, it would use that to construct the decl instead.33[[gnu::nodebug]] int foo(int x) { return x; }34 35int bar(int x, int y) { return x + y; }36 37#--- commands.input38 39breakpoint set -n foo40run41 42expression foo(5)43 44# FIXME: when we're stopped in a frame without debug-info, the ClangModulesDeclVendor45# is initialized properly and none of the modules in the CU are compiled (and lookup46# in the DeclVendor is not enabled).47# CHECK: expression foo(5)48# CHECK: error: 'foo' has unknown return type; cast the call to its declared return type49 50breakpoint set -p return -X main51continue52expression foo(50)53 54# However, once we're back in a frame with debug-info, the ClangModulesDeclVendor infrastructure55# is back on track.56 57# CHECK:      expression foo(50)58# CHECK-NEXT: (int) $0 = 559 60target modules dump ast --filter foo61# CHECK:     (lldb) target modules dump ast --filter foo62# CHECK-NOT: foo63