brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b964e9b Raw
55 lines · plain
1## Tests the case where we fail to import modules from @import2## statements that are part of the expression being run.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#11# RUN: sed -i '' -e 's/foo\.h/baz\.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 %s15 16#--- main.m17@import foo;18@import bar;19 20int main() { __builtin_debugtrap(); }21 22#--- foo.h23struct foo {};24 25#--- bar.h26struct bar {};27 28#--- module.modulemap29module foo {30    header "foo.h"31    export *32}33 34module bar {35    header "bar.h"36    export *37}38 39#--- commands.input40run41## Make sure expression fails so the 'note' diagnostics get printed.42expr @import Foo; @import Bar43expr @import foo44 45# CHECK: error: while importing modules:46# CHECK-NEXT: header search couldn't locate module 'Foo'47# CHECK-NEXT: header search couldn't locate module 'Bar'48#49# CHECK: expr @import foo50# CHECK: error: while importing modules:51# CHECK-NEXT: couldn't load top-level module foo52## No mention of the previous import errors.53# CHECK-NOT: Foo54# CHECK-NOT: Bar55