58 lines · plain
1## Tests the case where the modulemap is semantically invalid and thus2## Clang fails to load it on behalf of LLDB. We force this error by3## creating a redefinition of 'module bar'.4#5# REQUIRES: system-darwin6#7# RUN: split-file %s %t/sources8# RUN: %clang_host -g %t/sources/main.m -fmodules -fcxx-modules \9# RUN: -fmodule-map-file=%t/sources/module.modulemap \10# RUN: -fmodules-cache-path=%t/ModuleCache -o %t.out11# RUN: sed -i '' -e 's/module foo/module bar/' %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: failed to parse and load48# NO_LOG-NOT: failed to parse and load49 50#--- commands-with-log.input51log enable lldb expr52run53## Make sure expression fails so the 'note' diagnostics get printed.54expr blah55 56# LOG: failed to parse and load modulemap file in {{.*}}sources57# LOG: failed to parse and load modulemap file in {{.*}}sources58