brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 1bfbbcf Raw
63 lines · plain
1## Tests the case where we fail to load a submodule. We force this by removing2## the submodule 'module baz' from the modulemap.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/module baz/module qux/' %t/sources/module.modulemap11#12# RUN: %lldb -x -o "settings set interpreter.stop-command-source-on-error false" \13# RUN:       -s %t/sources/commands.input %t.out -o exit 2>&1 | FileCheck %s --check-prefix=NO_LOG14#15# RUN: %lldb -x -o "settings set interpreter.stop-command-source-on-error false" \16# RUN:       -s %t/sources/commands-with-log.input %t.out -o exit 2>&1 | FileCheck %s --check-prefix=LOG17 18#--- main.m19@import foo.baz;20@import bar;21 22int main() { __builtin_debugtrap(); }23 24#--- foo.h25struct foo {};26 27#--- bar.h28struct bar {};29 30#--- baz.h31struct baz {};32 33#--- module.modulemap34module foo {35    header "foo.h"36    export *37 38    module baz {39        header "baz.h"40        export *41    }42}43 44module bar {45    header "bar.h"46    export *47}48 49#--- commands.input50run51## Make sure expression fails so the 'note' diagnostics get printed.52expr blah53 54# NO_LOG-NOT: couldn't load submodule 'baz' of module 'foo'55 56#--- commands-with-log.input57log enable lldb expr58run59## Make sure expression fails so the 'note' diagnostics get printed.60expr blah61 62# LOG: couldn't load submodule 'baz' of module 'foo'63