60 lines · plain
1## Tests the case where a module fails to load. We force this by2## replacing the contents of the 'module foo' declaration with garbage.3#4# REQUIRES: system-darwin5#6# RUN: split-file %s %t/sources7# RUN: %clang_host -g %t/sources/main.m -fmodules -fcxx-modules \8# RUN: -fmodule-map-file=%t/sources/module.modulemap \9# RUN: -fmodules-cache-path=%t/ModuleCache -o %t.out10# RUN: sed -i '' -e 's/foo\.h/baz\.h/' %t/sources/module.modulemap11# RUN: sed -i '' -e 's/bar\.h/qux\.h/' %t/sources/module.modulemap12#13# RUN: %lldb -x -o "settings set interpreter.stop-command-source-on-error false" \14# RUN: -s %t/sources/commands.input %t.out -o exit 2>&1 | FileCheck %s --check-prefix=NO_LOG15#16# RUN: %lldb -x -o "settings set interpreter.stop-command-source-on-error false" \17# RUN: -s %t/sources/commands-with-log.input %t.out -o exit 2>&1 | FileCheck %s --check-prefix=LOG18 19#--- main.m20@import foo;21@import bar;22 23int main() { __builtin_debugtrap(); }24 25#--- foo.h26struct foo {};27 28#--- bar.h29struct bar {};30 31#--- module.modulemap32module foo {33 header "foo.h"34 export *35}36 37module bar {38 header "bar.h"39 export *40}41 42#--- commands.input43run44## Make sure expression fails so the 'note' diagnostics get printed.45expr blah46 47# NO_LOG-NOT: couldn't load top-level module foo48# NO_LOG-NOT: error: header49 50#--- commands-with-log.input51log enable lldb expr52run53## Make sure expression fails so the 'note' diagnostics get printed.54expr blah55 56# LOG: couldn't load top-level module foo57# LOG: error: header 'baz.h'58# LOG: couldn't load top-level module bar59# LOG: error: header 'qux.h'60